Blog
How to use Claude Code: a practical guide for teams
Install it, write a CLAUDE.md, pick a permission mode, plan before you code, and keep every change small, tested and reviewed.
Alex Mercer
To use Claude Code, install it with one command, run claude inside your project folder, sign in with a paid Claude plan or a Claude Console account, and describe what you want in plain English. Claude Code then reads your files, edits code and runs commands, and the permission mode you choose decides how much it does before asking you.
That gets you started. Getting reliable results across a team takes a little more: a CLAUDE.md file, a deliberate permission mode, plan mode for bigger changes, and habits that keep every change small, tested and reviewed. Commands and settings come from Anthropic's Claude Code docs as of October 12, 2026. Claude Code ships changes often, so check the docs if something looks different on your machine.
Claude Code is also the source of most AI-written code in Bug Bench, our public benchmark that ranks AI coding models by the bugs found in the code they write. It wrote 78.1% of that code in the latest full week, up from 64.8% in the first week of Bug Bench's ranking window. These shares describe code reviewed by cubic, not the whole market, and Bug Bench's AI coding statistics have the latest figures. If you are still choosing an agent, start with our ranking of the best AI coding tools or the head-to-head Codex vs Claude Code.
Install Claude Code and sign in
Claude Code runs on macOS 13.0 or later, Windows 10 1809 or later (or Windows Server 2019 or later), Ubuntu 20.04+, Debian 10+ and Alpine Linux 3.19+, on a machine with at least 4 GB of RAM. Install it with the native installer for your system:
Native installs update themselves in the background. Homebrew, WinGet, apt, dnf and apk installs don't by default, and the setup docs cover installing and upgrading with each. On native Windows, install Git for Windows so Claude Code can use Bash; without it, Claude Code uses PowerShell instead.
Check the install with claude --version, then start a session:
On first use, Claude Code asks you to log in, and for a Claude plan or Console account you finish in the browser. It accepts:
A Claude Pro, Max, Team or Enterprise plan, which Anthropic recommends
A Claude Console account, which pays for API usage with prepaid credits
Amazon Bedrock, Google Cloud's Agent Platform or Microsoft Foundry, for enterprise cloud accounts
Claude Code is included in every paid Claude plan and shares that plan's usage limits; the Free plan doesn't include it. To switch accounts later, type /login inside a session.
You don't have to work in a terminal. The same agent runs as a VS Code extension, in JetBrains IDEs, in the Claude desktop app, on the web at claude.ai/code and in Slack. This guide uses the CLI, as Anthropic's quickstart does.
Your first session
Open a terminal in a project and start Claude Code:
Ask questions before you ask for changes. Claude Code reads project files as it needs them, so you don't paste code in:
Then try one small change, such as adding input validation to a form, and watch what happens: which files Claude reads, what it proposes and whether it runs your tests.
A few keys and prefixes do most of the work in a session:
Key or prefix | What it does |
|---|---|
| Shows the commands and skills you can run |
| Autocompletes a file path so you can point Claude at a file |
| Runs a shell command directly and adds its output to the session |
| Stops Claude mid-action and keeps the context |
| Opens the rewind menu to restore code, conversation or both |
| Cycles through permission modes |
From your shell, claude -c continues the most recent conversation in the current directory, claude -r lets you pick an older one, and claude -p "query" runs one prompt and exits.
Write a CLAUDE.md (or reuse your AGENTS.md)
Every session starts with a fresh context window. CLAUDE.md is how your project's rules carry over from one session to the next: a Markdown file Claude Code reads at the start of every session.
Run /init in your first session. Claude analyzes the codebase and writes a starter CLAUDE.md with build commands, test instructions and the conventions it finds. If a CLAUDE.md already exists, /init suggests improvements instead of overwriting it.
File | What it's for | Commit it? |
|---|---|---|
| Your preferences, in every project | No, it lives in your home directory |
| Project instructions for the whole team | Yes |
| Your personal notes for this project | No, add it to |
Keep each file short. Anthropic's docs suggest staying under 200 lines per CLAUDE.md, because longer files use more context and Claude follows them less reliably. Write down what you would otherwise explain again: build and test commands, conventions, project layout and "always do X" rules. Add an entry when Claude makes the same mistake twice, or when a code review catches something Claude should have known about the codebase. Move multi-step procedures into skills, and rules that only apply to part of the codebase into path-scoped rules under .claude/rules/.
Claude reads CLAUDE.md as guidance, so if an action must be blocked every time, use a hook. If your repository already has an AGENTS.md for other coding agents and no CLAUDE.md, Claude Code uses it as the project instructions. If both exist, it reads only the CLAUDE.md files, so put the line @AGENTS.md at the top of your CLAUDE.md to import it and keep one source of truth.
Our CLAUDE.md and AGENTS.md guide goes deeper on what belongs in each file, what to leave out, and a copyable example. Instruction files only state your rules, though. Checking that code follows them is a review job, covered in how to configure coding agents that follow your team's standards.
Pick a permission mode
Permission modes decide what Claude Code may do without asking you first. There are six:
Mode | Runs without asking | Best for |
|---|---|---|
| Reads only | Sensitive work, unfamiliar code |
| Reads, file edits and common filesystem commands such as | Iterating on code you're reviewing |
| Reads, plus classifier-approved commands when auto mode is available | Exploring before you change anything |
| Everything, with background safety checks | Long tasks, fewer prompts |
| Reads and pre-approved tools; anything that would prompt is denied | Locked-down CI and scripts |
| Everything | Isolated containers and VMs only |
Since version 2.1.283, interactive terminal and VS Code sessions start in auto mode on every plan and provider, unless your settings or your organization pick another mode. In auto mode, a separate classifier model reviews actions before they run and blocks anything that goes beyond your request, targets infrastructure it doesn't recognize, or appears driven by hostile content Claude read. Anthropic's docs say auto mode reduces permission prompts but does not guarantee safety, so it doesn't replace review on sensitive operations.
Press Shift+Tab to switch modes during a session. The status bar shows the active one. To change the mode new sessions start in, set permissions.defaultMode in ~/.claude/settings.json for yourself, or in managed settings for your organization. A project's .claude/settings.json can set any starting mode except auto and bypassPermissions.
Modes set the baseline. On top of them, /permissions manages allow, ask and deny rules. Deny rules apply in every mode, including bypassPermissions, and an ask rule such as Bash(git push *) keeps pushes behind a prompt even in auto mode. Rules in the project's .claude/settings.json reach everyone who works in the repository once you commit the file.
Plan before you code
Plan mode separates research from editing. Claude reads files, runs commands to explore and writes a plan, but it doesn't edit your source until you approve. Enter it with Shift+Tab, prefix a single prompt with /plan, or start the session in it:
When the plan is ready, you can approve it and continue in auto mode, approve it and approve each edit yourself, or keep planning and tell Claude what to change. Press Ctrl+G to open the plan in your text editor and change it before Claude starts.
Anthropic's best practices guide recommends four phases for anything non-trivial:
Explore in plan mode, for example: "read /src/auth and understand how we handle sessions and login."
Plan: ask which files need to change and how the flow works, then edit the plan.
Implement: approve the plan and ask Claude to write tests, run the suite and fix failures.
Commit: ask Claude to commit with a descriptive message and open a pull request.
Skip the plan for small changes. The docs suggest asking directly whenever you could describe the diff in one sentence.
Slash commands worth knowing
Type / to see everything available in your session. Besides /init, /plan and /permissions from the sections above, these come up most:
Command | What it does |
|---|---|
| Switches the model and saves it as your default |
| Sets how much reasoning the model applies |
| Shows what is filling the context window |
| Summarizes the conversation to free space, with optional focus instructions |
| Starts a fresh conversation for a new task |
| Asks a side question without adding it to the conversation |
| Restores code or conversation to an earlier checkpoint |
| Shows the changes in your working tree, including Claude's edits |
| Shows session cost and plan usage limits |
| Checks your installation and setup for problems |
Checkpoints only cover changes made through Claude's file editing tools, not changes made by shell commands, so /rewind is not a replacement for git. Our Claude Code slash commands guide covers the rest of the list.
Extend Claude Code with skills, hooks, subagents, plugins and MCP
Claude Code has several ways to add knowledge or behavior. They overlap, so pick by what you need:
Feature | What it is | Use it when | Where it lives |
|---|---|---|---|
CLAUDE.md | Instructions loaded into every session | Claude needs a fact every time |
|
Skill | A | You keep pasting the same procedure |
|
Hook | A shell command that runs at a lifecycle event | Something must happen every time, or never |
|
Subagent | A helper with its own context, prompt and tools | A side task would flood your main context |
|
MCP server | A connection to an outside tool or data source | Claude needs to reach a service |
|
Plugin | A package of skills, agents, hooks and MCP servers | You want to share a setup across repositories | A plugin marketplace |
Skills
A skill is a folder with a SKILL.md file: YAML frontmatter that tells Claude when to use it, followed by the instructions. Claude loads a skill when your request matches its description, or you run it with /skill-name. Only the description stays in context until the skill is used, so a long checklist costs little until you need it. Custom slash commands have been merged into skills, and existing .claude/commands/ files keep working. Our Claude Code skills guide covers writing and sharing them.
Hooks
Hooks are shell commands Claude Code runs at set points in its lifecycle, such as when a session starts or before a tool call. They are deterministic: a CLAUDE.md line asks Claude to format code, while a hook makes sure it happens. This example from Anthropic's hooks guide runs Prettier on every file Claude edits. It goes in .claude/settings.json:
A PreToolUse hook can block a tool call: exit with code 2 and write the reason to stderr. A Stop hook can run your checks and keep Claude from ending its turn until they pass. Our Claude Code hooks guide covers every event.
Subagents
A subagent works in its own context window, with its own system prompt, tools and permissions, and returns a summary, so search results and logs stay out of your main conversation. Claude Code ships with built-in subagents, such as Explore, a read-only agent for searching code, and delegates to them on its own. Subagent requests count toward the same usage limits as your main session. To add your own, ask Claude to create one, or write a Markdown file in .claude/agents/ (this project) or ~/.claude/agents/ (all your projects). Our Claude Code subagents guide covers the built-in agents and custom definitions.
Plugins
A plugin bundles skills, agents, hooks and MCP servers into one unit that Claude Code installs and loads together. Claude Code adds Anthropic's official marketplace the first time you start an interactive terminal session, so you can browse it with /plugin or install a plugin by name:
That plugin adds commands for committing, pushing and opening pull requests. Add other marketplaces with /plugin marketplace add owner/repo. A plugin can run code on your machine with your user privileges, so read Anthropic's plugin security guidance before you trust a marketplace you don't know. Our Claude Code plugins guide covers marketplaces, install scopes and team setups.
MCP servers
MCP servers connect Claude Code to outside tools and data. Add a remote server with one command, here the example from Anthropic's MCP docs:
By default a server loads only in the project where you added it and stays private to you. Add --scope project to write it to .mcp.json at the project root, then commit that file so the team gets the same tools. Run /mcp to check connections and sign in to servers that use OAuth.
Run Claude Code headless and in CI
Add -p to run one prompt without the interactive interface. That's how Claude Code runs in scripts, pre-commit hooks and CI pipelines:
For scripted runs, Anthropic recommends adding --bare. It skips auto-discovery of hooks, skills, plugins, MCP servers, auto memory and CLAUDE.md, so the run starts faster. Without it, a -p run executes the hooks in the project's .claude/settings.json and connects the servers in its .mcp.json with no trust prompt, even in a folder you've never trusted. Keep that in mind for CI jobs that run on code from outside contributors. Save --dangerously-skip-permissions for runs inside a container or VM.
The same agent loop is available as the Agent SDK for Python and TypeScript. On GitHub, Claude Code GitHub Actions runs Claude Code inside your workflows to respond to @claude mentions, turn issues into pull requests or run a prompt on any GitHub event.
Team habits that keep quality up
Claude Code makes code cheap to write. The work shifts to making sure it's right. These habits keep that work manageable.
Keep tasks small
Give each session one task. Run /clear between unrelated tasks, because a long session full of old context makes Claude worse at the current one. If you've corrected Claude more than twice on the same issue, the docs recommend clearing and starting over with a better prompt that includes what you learned. Scope investigations narrowly, or hand them to a subagent. Small tasks also produce small pull requests; does PR size actually matter? collects the research on how size affects review.
Write the test first
The first practice in Anthropic's best practices guide is to give Claude a check it can run: tests, a build, a linter or a screenshot to compare against. Without one, "looks done" is the only signal Claude has, and you become the verification loop. Write the test before the code, or put the cases in the prompt ("example test cases: user@example.com is true, user@.com is false. run the tests after implementing"). Ask Claude to show the test output rather than tell you it passed. A Stop hook turns this into a hard gate. In the docs' words: if you can't verify it, don't ship it.
Commit your setup with your code
Treat Claude Code configuration like code. Commit the shared parts so every teammate gets the same behavior, and keep personal settings out of git:
What | Where | In git? |
|---|---|---|
Project instructions |
| Yes |
Team permissions, hooks and plugins |
| Yes |
Skills |
| Yes |
Subagents |
| Yes |
MCP servers |
| Yes |
Personal project notes |
| No |
Personal settings |
| No; Claude Code keeps it out of git when it creates the file |
Choose the model on evidence
/model switches models. On Pro, Max, Team and Enterprise plans and on the Anthropic API, Claude Code defaults to Claude Opus 5.5. Anthropic's model configuration docs explain what each alias is for: sonnet for daily coding tasks, and fable for the Fable models, which the docs call the most capable in Claude Code.
Bug Bench adds a second input. These are the relative bug rates inside Claude Code on Bug Bench, where 1.00 is the average across all AI-attributed lines and lower is better:
Model in Claude Code | Relative bug rate | Weeks of data |
|---|---|---|
Claude Fable 5.1 | 1.09 (statistically tied with Sonnet 5.5) | 6 |
Claude Sonnet 5.5 | 1.24 (statistically tied with Fable 5.1 and Opus 5) | 2 |
Claude Opus 5 | 1.33 (statistically tied with Sonnet 5.5) | 12 |
Claude Opus 5.5 | 1.49 | 3 |
A counted bug is a cubic review finding on AI-written code that a developer upvoted or an AI coding agent addressed. "Statistically tied" means the 95% confidence intervals overlap. Bug Bench is observational, not causal: teams choose their models, so a rate reflects the code each model was used for as well as the model. Sonnet 5.5's rate rests on two weeks of data and Opus 5.5's on three, so both can still move. The Claude Code page on Bug Bench has the latest numbers, and our Bug Bench ranking of the best LLMs for coding covers every agent.
Review every change before it merges
Claude Code can commit and open pull requests for you, which makes it easy to skip the part where someone reads the diff. Don't skip it. Read the change with /diff before you commit, run /code-review to have Claude check the diff for correctness bugs, and treat a Claude Code pull request like one from a new teammate: CI runs, a person reviews it, and nothing merges on the agent's word alone. Our Claude Code review guide compares the built-in review options and shows how to review changes before you push.
An AI reviewer helps with the volume. On GitHub, cubic takes the first pass on each pull request and comments on bugs, security issues and breaks from your team's rules, so human reviewers can spend their time on design and intent. The AI code review guide explains how that works. When a review catches something Claude should have known, add it to CLAUDE.md, as Anthropic's docs suggest. For the wider process, see how successful teams ship AI-generated code to production.
More Claude Code guides
Each of these guides goes deeper on one part of Claude Code:
Claude Code review: the built-in review commands, Code Review for pull requests, and reviewing Claude's changes with cubic's plugin before you push.
Claude Code skills: the
SKILL.mdformat, where skills live, how Claude decides to load one, and three skills to copy.Claude Code plugins: installing plugins, using the plugin marketplace and packaging your own.
Claude Code hooks: lifecycle events, matchers and hooks that format, block or test.
Claude Code subagents: the built-in subagents, custom ones and when delegating helps.
CLAUDE.md and AGENTS.md: where Claude Code looks for each file, what belongs in them, and a copyable setup that keeps one source of truth.
Claude Code slash commands: the built-in commands to learn first, the
claudeCLI commands and custom commands with arguments.
FAQ
How does Claude Code work?
Claude Code works in a loop. It gathers context by searching and reading your files, takes action by editing code and running commands, then checks the result, for example by running your tests, and repeats until the task is done. You can interrupt at any point to steer it. Beyond code, it can help with anything you can do from the command line, such as writing docs, running builds and searching files (how Claude Code works).
Is Claude Code free?
No. Claude Code is included in every paid Claude plan (Pro, Max, Team and Enterprise) and shares that plan's usage limits, and the Free plan doesn't include it. You can also pay for API usage through a Claude Console account, or run it through Amazon Bedrock, Google Cloud's Agent Platform or Microsoft Foundry. Claude's pricing page lists the current plans.
Can I use Claude Code in VS Code?
Yes. In VS Code, open the Extensions view (Cmd+Shift+X on Mac, Ctrl+Shift+X on Windows and Linux), search for "Claude Code" and click Install. Sessions in the extension start in auto mode like the CLI, and you switch modes with the mode indicator. There is also a plugin for JetBrains IDEs.
Do I need to know how to code to use Claude Code?
You can start without much experience, because you describe changes in plain English, and Anthropic's quickstart links a terminal guide for people who have never used one. You are still responsible for what ships, though. If you can't judge the diff yourself, lean harder on tests, small changes and review by someone who can.
