Claude Code: Your AI Coding Agent
This content was developed with AI assistance and is regularly reviewed for accuracy.
Snapshot: October 2026. Model names, prices, and product features change monthly; What's New in AI is the maintained chronology.
Claude Code is Anthropic's coding agent. It reads your project, edits files, runs commands and tests, opens pull requests, and keeps working through a multi-step task until it is done or needs you. It is also the most-used coding agent among developers who use one: Stack Overflow's 2026 survey (October 6, 2026) puts it at 66 percent of coding-agent users. This page takes you from a first session to the primitives practitioners use for unattended work.
Last tested with Claude Code in October 2026.
Learning focus
- Install Claude Code, start a session, and set up project memory with
/initand CLAUDE.md - Choose the right permission mode: Plan Mode, approvals, or auto mode
- Pick between subagents, agent teams, and workflows, and between
/loop,/goal, and Routines - Add hooks, Code Review, and cost limits so the agent stays inside safe boundaries
Where Claude Code runs
The same agent runs on several surfaces, and your CLAUDE.md files, skills, settings, and MCP servers follow you between them.
| Surface | Best for |
|---|---|
| Terminal CLI | The full feature set, scripting, and CI |
| VS Code and JetBrains extensions | Working with editor context and inline diffs |
| Desktop app (macOS and Windows; Linux in beta) | A graphical session without a terminal, plus local scheduled tasks |
| Web at claude.ai/code and the iOS and Android apps | Cloud sessions you can start from anywhere and check on later |
Claude Code is included on paid Claude plans and through the Anthropic Console with pay-as-you-go billing; the free Claude plan does not include it. Plan details change often, so check AI Coding Tools Compared for the current comparison against Copilot, Codex, and Cursor.
Your first session
Install with the native installer, which updates itself in the background.
curl -fsSL https://claude.ai/install.sh | bash
On Windows PowerShell, use irm https://claude.ai/install.ps1 | iex (install Git for Windows first). Then open a project folder and start the agent:
cd your-project
claude
Begin with read-only questions. They build your understanding of the codebase and your trust in the agent before it changes anything.
"Give me an overview of this codebase: the main modules, how data flows between them, and where [authentication] is handled."
Use @ to point at specific files (@src/utils/auth.js) instead of waiting for Claude to search, and paste or drag in screenshots when an error is visual. When you are ready for a change, brief it the way you would brief a colleague, including how to verify it:
"Write a validateEmail function in [src/utils]. Test cases: user@example.com is valid, 'invalid' is not, user@.com is not. Run the tests after implementing and fix any failures."
A verification step is the single most effective thing you can add. Tests, an expected output, or a screenshot to compare against turn "looks done" into "is done."
Project memory: /init and CLAUDE.md
CLAUDE.md is a file Claude reads at the start of every session. It holds what the agent cannot infer from code alone: build and test commands, conventions, and workflow rules. Generate a starter file with:
/init
Claude scans the project and writes a CLAUDE.md with the commands and conventions it found. Edit it down to what matters:
# Code style
- Use ES modules (import/export), not CommonJS (require)
# Workflow
- Run `npm test` before committing
- Prefer running single tests, not the whole suite
Place a personal file at ~/.claude/CLAUDE.md, a team file at the project root (check it into git), and module-specific files in subfolders. For each line, ask whether removing it would cause a mistake; if not, cut it. Claude Code also keeps auto memory of what it learns while working, and it reads an AGENTS.md file in place of CLAUDE.md, so a repository that already uses the cross-tool standard works without duplication. Skills, AGENTS.md, and CLAUDE.md covers how the instruction files and skills fit together.
Permission modes: Plan Mode, approvals, and auto mode
How much the agent does without asking is the most important setting you control.
Plan Mode is read-only. Claude explores the code and produces a plan but changes nothing. Start a session in it with claude --permission-mode plan, or press Shift+Tab during a session to cycle modes. Use it for anything bigger than a small edit: explore, ask for a written plan, refine it, then switch to a normal mode to execute.
"I need to move our authentication to OAuth2. Read the current implementation and write a step-by-step migration plan with risks. Do not change any files."
Default approvals ask before edits and commands. They are safe but tiring. Anthropic reported that users approved about 93 percent of prompts, which is the condition called approval fatigue: when every prompt gets a yes, prompts stop protecting you.
Auto mode (published March 25, 2026) replaces most approval prompts with a model-based classifier that blocks actions it judges overeager or risky. Anthropic's own numbers are worth remembering: a 0.4 percent false-positive rate, and a 17 percent false-negative rate on a small sample of real overeager actions, which the company called "the honest number." Auto mode reduces interruptions; it does not replace a sandbox, scoped credentials, or a review of what changed. See Agent Safety and Guardrails for why that matters.
Skills and subagents
A skill is a folder with a SKILL.md file that the agent loads only when it is relevant, which keeps the context window lean. Claude Code's skills follow the open Agent Skills standard, and it ships bundled skills such as /code-review, /debug, /verify, /batch, and /loop. A project skill lives in .claude/skills/ and can be invoked by name:
---
name: fix-issue
description: Fix a GitHub issue end to end. Use when given an issue number.
---
Fix GitHub issue $ARGUMENTS.
1. Read the issue with `gh issue view`
2. Find the relevant files and implement the fix
3. Write and run tests
4. Commit with a descriptive message and open a PR
Invoke it with /fix-issue 1234. The skills page covers writing skills that work in other agents too.
A subagent runs in its own context window and returns only a summary, so a verbose investigation does not crowd out your main conversation. Ask for one ("use a subagent to investigate how token refresh works") or define one in .claude/agents/ with a narrow tool list. Defaults allow 20 concurrent subagents and three layers of nesting.
Choosing a parallelism mode
Claude Code's documentation (October 2026) lists five ways to run more than one agent at once. The choice is about cost and coordination, not capability.
| Mode | What it is | Use it when |
|---|---|---|
| Subagents | Helpers with their own context, reporting to the main session | A sub-task is noisy or needs a narrow tool set |
| Background agents | Sessions that keep running while you work (claude agents, research preview) | You want to start several tasks and check back |
| Agent teams | Peers with a shared task list and mailbox (experimental, off by default) | Large divisible work on shared files, with budget to match |
| Dynamic workflows | A script Claude writes to orchestrate dozens to hundreds of agents, capped at 1,000 per run | Batch work across many files or records |
| Projects | Cloud threads (public beta on Pro and Max) | Long-running work you return to across devices |
Agent teams use roughly seven times the tokens of a standard session when teammates plan, so start with one agent and add more only for a reason you can name. Patterns and Multi-Agent Systems maps these modes to the underlying design patterns.
Unattended work: /loop, /goal, and Routines
Three primitives let Claude Code keep working without you typing each turn.
/loop re-runs a prompt on an interval you set, or one Claude picks between a minute and an hour. It is session-scoped, allows up to 50 tasks per session, and expires after seven days so a forgotten loop cannot run forever. Its built-in maintenance prompt continues unfinished work, tends the open pull request, and cleans up.
/goal sets a completion condition. After every turn a separate small model checks whether the condition is met, not yet met, or impossible, and Claude keeps going until it is met or progress stalls for several turns. The docs summarize the pairing neatly: auto mode removes per-tool prompts, and /goal removes per-turn prompts.
/goal All tests in [tests/api] pass and the linter reports zero errors.
Routines run in Anthropic's cloud (research preview on Pro, Max, Team, and Enterprise) on a schedule, from an API call, or from a GitHub event, with a minimum interval of one hour. They use your claude.ai connectors, and they include all of them by default; the docs warn that Claude can use every tool from an included connector, writes included, without asking. Remove the ones a routine does not need. Also note that a green status in the run list means the run finished, not that the task succeeded; check the output. The desktop app offers local scheduled tasks for the same pattern on your own machine.
The Loops and Harnesses sub-track covers stop conditions, budgets, and recipes such as the overnight coding loop in depth.
Hooks, connectors, and Code Review
Hooks run your own scripts at defined points in the agent's lifecycle; there are 33 events, including PreToolUse, PostToolUse, and Stop. The canonical example is a PreToolUse hook that blocks rm -rf. Anthropic's documentation is explicit that hooks are best-effort for enforcement, so hard allow and deny rules belong in the permission system, with hooks as a second layer.
Connectors come through MCP. Add a server with claude mcp add, and any connector you added at claude.ai appears in Claude Code automatically. Verify every server before connecting it; Connect Your First MCP Server walks through it.
Code Review became generally available on October 15, 2026 for Team and Enterprise plans. It reviews pull requests in roughly six to ten minutes, with Quick, Standard, or Deep depth set per repository. It is a reviewer, not an approver: a human still decides what merges.
For scripts and CI, claude -p "[task]" runs non-interactively, and --output-format json returns structured results.
Managing context and cost
Anthropic's cost documentation (October 2026) puts the average at about 13 dollars per developer per active day, with 90 percent of users under 30 dollars. Spend climbs with long sessions, many agents, and runaway loops, so use runtime limits rather than alerts.
- Run
/clearbetween unrelated tasks and/compactto summarize a long session. - Send verbose research to subagents so it stays out of the main context.
- Set a hard ceiling with the
--max-budget-usdflag on unattended runs. - Check
/usageto see which skills, subagents, MCP servers, and loops consumed tokens.
When the agent goes the wrong way, press Esc to stop it, press Esc twice or use /rewind to restore an earlier state, and after two failed corrections start fresh with /clear and a better brief.
Key takeaways
- Claude Code is an agent, not a chat window: it reads, edits, runs, and verifies. Give every task a way to check itself.
/initand a short CLAUDE.md (or AGENTS.md) are the highest-value setup steps.- Plan Mode for anything non-trivial; auto mode to cut approval fatigue, with the 17 percent false-negative rate in mind.
- Pick the smallest parallelism mode that works, and give unattended work a stop condition and a budget.
- Hooks, permission rules, scoped connectors, and Code Review are layers; none of them alone is a guarantee.
From the author
Skills can carry scripts and drive real tools, not just instructions. Shutter, a Claude Code plugin by the author of this site, is a worked example: four skills that operate a browser and ffmpeg so Claude Code can take screenshots, make GIFs, and record showcase videos from a plain-English request.
Next steps
- Continue to: Skills, AGENTS.md, and CLAUDE.md
- For unattended runs with stop conditions and budgets: Anatomy of an Agent Loop
- For connecting tools safely: Connect Your First MCP Server
- For the wider market of coding agents: AI Coding Tools Compared