Claude Code is Anthropic’s terminal coding agent for developers who want Claude to inspect, edit, test, and explain code inside a real repository; for the wider product context, see our Claude features guide.

c-ai.chat is an independent guide. We are not Anthropic, and we do not operate claude.ai.
- The short answer
- How it works
- What you can do with it
- Claude Code vs alternatives
- FAQ
- The honest take
- Sources
The short answer
Use Claude Code when you already have a project, a terminal, version control, and a specific coding task. Good tasks include fixing a failing test, explaining a service, adding a small endpoint, refactoring a module, or reviewing a diff.
- What it does: reads, edits, explains, tests, and debugs code in your repository.
- Where it runs: in your terminal, alongside Git, test runners, linters, and build tools.
- Best use: bounded tasks with clear verification steps.
- Main risk: it can make plausible but wrong changes, so you must review diffs and run tests.
The basic workflow is simple: open your project, run claude, ask for a concrete change, review the plan, approve only sensible edits or commands, then verify the result before committing. Treat it as a supervised pair programmer with shell access, not as an unattended autopilot.
You can use the regular Claude web app at claude.ai for planning, writing, and code snippets. Claude Code is different because it works against files in your local repository. If you are comparing plans, see our Claude pricing guide.
Free
$0
Entry-level Claude access with usage limits.
Pro
$20/month or $17/month annual
Paid individual plan for heavier Claude use.
Max
From $100/month
Higher-usage individual plan.
Team Standard
$25/seat or $20/seat annual
Team plan for shared organisational use.
Team Premium
$125/seat or $100/seat annual
Higher-tier team plan.
Enterprise
$20/seat base + API rates
Enterprise access with API-based usage costs.
Claude Code packaging can change. Check claude.com/pricing before subscribing or rolling it out to a team.
How it works

Claude Code works as an agentic command-line tool. You run it from a project directory. It can inspect files, search the repository, propose edits, and use approved shell commands such as test runners, linters, package managers, or build tools.
The value is context. Instead of pasting one file into a chat window, you let Claude reason across the repository structure, the task, and the commands that prove whether the change worked.
The core loop is plan, act, verify. You give a task in plain English. Claude reads relevant files, explains what it intends to do, and may ask permission before modifying files or running commands. You review its work as you would review a teammate’s patch.
Prepare the project
Open a clean Git branch. Confirm the project installs, builds, and tests before you ask Claude to change it.
Install and authenticate
Use Anthropic’s current Claude Code setup instructions in the official documentation at docs.claude.com.
Start it in the repository
From the project root, run
claude. Starting in the right directory matters because Claude needs the repository context.Give a small, testable task
Use a prompt such as:
Find why the checkout total test is failing and propose the smallest fix.Review every change
Inspect diffs, approve commands deliberately, run tests, and commit only changes you understand.
A good first session is not “rewrite this app.” Start with one failing test, one endpoint, one component, or one confusing module. Claude performs better when you define the goal, the boundary, and the verification command.
# Good first prompt
Explain how authentication works in this repository.
Do not edit files yet.
List the main files involved and the request flow.
# Better than "fix everything"
The test `orders.calculateTotals applies coupon before tax` is failing.
Find the cause, propose a minimal fix, then ask before editing files.
If you build with the Claude API instead of using Claude Code, pricing works differently. Current documented API model prices include Opus 4.7 at $5 input and $25 output per million tokens, Sonnet 4.6 at $3 input and $15 output per million tokens, and Haiku 4.5 at $1 input and $5 output per million tokens. Prompt caching gives 90% off cached input. Batch API gives 50% off both input and output. See our Claude API docs guide and Claude models guide for more context.
| Model | Input price | Output price | Context and output notes |
|---|---|---|---|
| Opus 4.7 | $5 per million tokens | $25 per million tokens | 1M context |
| Sonnet 4.6 | $3 per million tokens | $15 per million tokens | 1M context; 128K max output |
| Haiku 4.5 | $1 per million tokens | $5 per million tokens | Fastest and cheapest current option |
What you can do with it

Claude Code is strongest when the answer depends on several files. It is weaker when the goal is vague, the codebase has no tests, or important behaviour lives in external systems Claude cannot inspect.
Understand an unfamiliar codebase
Use Claude Code as a guided code reader before you edit anything. Ask it to map the architecture, identify entry points, and explain the flow through relevant files.
Explain this repository like I am joining the team.
Focus on:
1. How requests enter the app
2. Where database access happens
3. How tests are organised
4. The riskiest files to change
Do not edit files.
This is often the safest first use case. You get orientation without letting the tool modify code. Then you can ask follow-up questions about the files it found.
Fix a failing test
A failing test gives Claude a clear target. Provide the test name and the command to run it. Ask for the smallest change that makes the test pass.
Worked example
Fix one failing checkout test
This works because Claude has a concrete failure, a bounded area, and a command that proves whether the fix helped.
The test `CheckoutTotals applies coupon before tax` is failing.
Please:
1. Run only that test first
2. Explain the failure in plain English
3. Propose the smallest code change
4. Ask before editing files
5. Run the test again after the change
Add a small feature
Claude Code can add a feature across routes, components, tests, and documentation. The key is scope. Do not ask for a broad settings page if you only need one field and one validation rule.
Add a `displayName` field to user profile settings.
Constraints:
- Keep the existing API style
- Add validation for 2-50 characters
- Add or update tests
- Do not change the database schema until you show me the migration plan
Ask Claude to show the files it expects to touch before editing. That gives you a chance to catch overreach early.
Refactor a messy module
Refactoring is useful but risky. Claude can identify duplication, split functions, and improve naming. It can also break subtle behaviour if tests are weak. Use it incrementally.
Review `src/billing/invoiceCalculator.ts`.
Goal:
- Reduce duplication
- Keep public behaviour unchanged
- Do not introduce new dependencies
- Suggest a step-by-step refactor plan before editing
- After each step, run the billing tests
A good refactor session has several small commits, not one huge diff. Ask Claude to preserve behaviour first. Style improvements can come later.
Review a pull request before human review
Claude Code can act as a pre-review checker. It can inspect a branch diff, look for missing tests, flag risky changes, and suggest questions for the reviewer. You still need human judgment, especially for security, privacy, payments, and production infrastructure.
Review the current branch against main.
Look for:
- Logic errors
- Missing tests
- Backwards compatibility issues
- Security-sensitive changes
- Files that deserve careful human review
Do not edit files. Return findings grouped by severity.
Claude Code vs alternatives
Claude Code competes with AI coding tools such as Cursor, GitHub Copilot, Sourcegraph Cody, and open-source editor agents. The right choice depends on where you want the assistant to live: terminal, editor, code host, or a broader development environment.
| Tool | Where it fits | Strengths | Trade-offs |
|---|---|---|---|
| Claude Code | Terminal-based coding agent | Repo-level tasks, command-line workflows, test-driven changes, and multi-file edits. | Requires careful review; less natural if you want everything inside the editor UI. |
| Cursor | AI-focused code editor | Integrated editing, inline changes, and chat inside the IDE. | Requires adopting or mirroring work into Cursor; behaviour depends on model and project setup. |
| GitHub Copilot | Editor and GitHub workflow assistant | Autocomplete, broad IDE support, and GitHub integration. | Often feels completion-first; larger repository tasks may need more manual steering. |
| Sourcegraph Cody | Code search and enterprise code intelligence | Large codebases, search-heavy workflows, and Sourcegraph-backed context. | Most useful when code search and indexing are central to the workflow. |
| Open-source agents | Self-hosted or local developer workflows | Flexible, inspectable, and easier to customise for some teams. | More setup, more maintenance, and model quality varies by configuration. |
The practical difference is control surface. Claude Code suits developers who already live in terminals and want an assistant to run commands, inspect files, and work through tasks. Cursor is more natural for developers who want AI inside the editor. Copilot is often the easiest addition for teams already using GitHub.
Pick Claude Code when
- You want an agent for terminal-driven tasks.
- You prefer reviewing diffs and commands in a normal Git workflow.
- Your tasks span several files and need repository context.
- You already use Claude for reasoning, planning, or writing.
Skip it when
- You only want inline autocomplete.
- Your team requires one approved IDE extension.
- You cannot send code context to an external AI service.
- Your project has no tests and little structure for verifying changes.
Decision rule
Choose Claude Code for bounded repository tasks that can be verified with tests or diffs. Choose an editor-native assistant if your main need is autocomplete, inline suggestions, or tight IDE integration.
If you need to build Claude into your own product rather than use a coding assistant, start with our Claude API guide and Anthropic’s platform documentation at platform.claude.com.
FAQ
These are the related questions people usually ask after learning how to use Claude Code. For broader account and product questions, see our Claude FAQ.
Is Claude Code free?
Claude has a Free plan at $0, but Claude Code availability depends on Anthropic’s current plan packaging. Paid plans include Pro at $20/month or $17/month annual, Max from $100/month, Team Standard at $25/seat or $20/seat annual, Team Premium at $125/seat or $100/seat annual, and Enterprise at a $20/seat base plus API rates. Check claude.com/pricing before subscribing.
Does Claude Code edit files automatically?
It can propose and make edits, but you should keep control of the workflow. Use Git, review diffs, and ask Claude to explain changes before applying them. For sensitive repositories, follow your company’s AI and data policies.
Can Claude Code run tests?
Yes. The typical workflow includes asking Claude Code to run your project’s test commands after you approve the relevant shell actions. Passing tests still do not guarantee correctness, so review the code as well.
Which Claude model does Claude Code use?
Anthropic controls model availability inside Claude products and plans. Separately, the documented active API models include Claude Opus 4.7, Claude Sonnet 4.6, and Claude Haiku 4.5. Do not assume the terminal product exposes every API model option in the same way.
Is Claude Code safe for private code?
Safety depends on your plan, settings, organisation policy, and the data you provide. Review Anthropic’s trust materials at trust.anthropic.com. Do not provide secrets, credentials, customer data, or regulated data unless your organisation has approved that workflow.
Can Claude Code replace a developer?
No. It can speed up reading, editing, testing, and review preparation, but a developer still needs to set scope, judge trade-offs, check security, and own the final code.
What should I ask Claude Code first?
Start with a read-only task. Ask it to explain the repository, map a request flow, or identify the files involved in one feature. Move to edits only after you trust its understanding of the codebase.
The honest take
Claude Code is worth trying if you already work in a terminal and want help with real repository tasks. It is especially useful for understanding unfamiliar code, fixing bounded bugs, writing tests, and making small multi-file changes.
It is not a substitute for software engineering judgment, code review, security review, or a working test suite. The best workflow is deliberate: start on a branch, give a narrow task, ask for a plan, approve actions one by one, inspect the diff, and run tests yourself.
If that workflow feels natural, Claude Code can become a useful part of your development process. If you mainly want autocomplete, an editor-native tool may fit better.
Last updated: 2026-05-12
This article is part of the Claude Code hub on c-ai.chat.





