
How to Use Claude Code: Anthropic's Terminal Coding Agent
How to use Claude Code: the 1M token context window, 80.8% SWE-bench score, Plan Mode, every surface it runs on, installation, and how it compares to Cursor.
Learning how to use Claude Code starts with what it actually is: Anthropic's agentic coding tool, one that runs in your terminal, reads your entire codebase, and executes development tasks from natural-language instructions[1]. It has accumulated 101,000 GitHub stars and 15,500 forks since general availability, which makes it one of the most widely adopted AI coding tools of 2026[2].
The structural difference from earlier tools is worth stating plainly, because it decides whether the workflow suits you. Copilot-style autocomplete suggests the next line based on what you already wrote. Claude Code reads the whole project, plans an approach, edits across many files at once, runs the tests, handles the failures, iterates, and commits. You do not tell it which files matter.
This guide covers what it does, where it runs, how to install it, the five jobs it is disproportionately good at, how it compares to Cursor and Copilot, and what to do when you want that behavior inside your own product rather than in a terminal.
TL;DR
- 1M token context window, roughly 25,000 to 30,000 lines of code in one session without fragmentation[1].
- 80.8% on SWE-bench Verified, the highest publicly reported score among available tools at the time of writing[1].
- Plan Mode shows you the file-by-file plan before it touches anything, which is what makes autonomous operation acceptable on a production repo[1].
- Runs almost everywhere: terminal CLI, VS Code, Cursor, Windsurf, JetBrains, a desktop app, the web, and
@claudeon a GitHub issue[1]. - Access requires a Claude Pro or Max subscription, or a Claude Console account with API access[1].
- MCP support connects it to databases, internal APIs, ticketing, and observability, so it reasons about more than the repo[1].
What Claude Code is

Claude Code is a coding agent rather than a completion engine. Point it at a project and it navigates the structure the way a senior developer would: start at the entry points, follow the dependency graph, build a working model of how the components interact, then make changes that are architecturally coherent instead of locally correct and globally broken.
That distinction matters most on the tasks that actually consume engineering time. Debugging a production issue that behaves differently in staging. Implementing a feature that needs an ORM change, three endpoint updates, and a migration. Those are multi-file problems, and multi-file problems are where a full-context agent separates from autocomplete.
The capabilities that matter
A 1M token context window
Claude Code reads up to a million tokens in one context window, roughly 25,000 to 30,000 lines of code in a single session without chunking or retrieval augmentation[1]. When a refactor touches 40 files across a 200,000-line codebase, you do not hand it a file list. It finds them.
80.8% on SWE-bench Verified
SWE-bench Verified evaluates a model against real GitHub issues from open-source repositories, scored by whether the proposed fix passes the repository's own test suite. Claude Code reaches 80.8%, the highest publicly reported figure among available tools[1]. The benchmark measures genuine codebase understanding rather than pattern-matching on isolated snippets, which is why it tracks real usefulness better than most coding evals.
Plan Mode
Before executing anything, Claude Code presents a structured plan: which files it will modify, what changes it will make, in what order. You review it, question it, adjust it, and only then approve[1].
This is the feature that makes the rest of it usable on a production repo. Supervised autonomy keeps the developer in the loop at the one moment where being out of the loop is expensive.
Agent Teams
Multiple Claude Code instances work on different parts of a problem simultaneously, coordinated by a lead agent that assigns subtasks and merges results[1]. For a feature that decomposes into independent workstreams, a backend change, a frontend update, and a docs update running in parallel, this compresses calendar time rather than just token time.
Where Claude Code runs

Broad adoption has a boring explanation: it meets developers where they already are[1].
- Terminal CLI is the core experience. Navigate to the project, run
claude, describe the task. - VS Code extension, with visual diff review and interactive change selection. The same extension works in Cursor and Windsurf.
- JetBrains plugin covers IntelliJ IDEA, PyCharm, WebStorm, and the rest.
- Desktop app adds visual diff review across parallel sessions, session scheduling, and cloud execution for long-running jobs.
- Web at claude.ai/code, no local install, plus the Claude iOS app.
- GitHub: tag
@claudeon an issue and get a pull request back, without asking teammates to change how they work.

How to use Claude Code: installation and first run
macOS and Linux:
curl -fsSL https://claude.ai/install.sh | bashOr with Homebrew:
brew install --cask claude-codeWindows:
irm https://claude.ai/install.ps1 | iexOr with WinGet:
winget install Anthropic.ClaudeCodeThen navigate to your project and run claude. It indexes the project structure and asks what you want to do.
One step matters more than the install method. Create a CLAUDE.md at the repository root and put your conventions in it: which test framework you use, which files must never be modified automatically, how you name things[1]. It is read at the start of every session. Teams use it to encode the institutional knowledge a senior developer would otherwise pass on during onboarding, and it is the single highest-leverage configuration in the tool.
Five jobs it is disproportionately good at
Large-codebase refactoring. When a refactor touches dozens of files and needs consistent changes to signatures, imports, and tests at once, coordination is the hard part. Claude Code builds a dependency map, finds every call site, makes coordinated changes, and runs the suite before showing you the result. Rakuten's team documented it working autonomously for seven hours on an activation-vector extraction method inside a large multi-language library, producing 99.9% numerical accuracy against the reference implementation[1].
Cross-file debugging. When a bug surfaces in user behavior but originates in the interaction between three modules written by different people at different times, full-context navigation lets it follow the execution path, hypothesize failure modes, write diagnostics, and fix every place the broken assumption is made rather than the most obvious one.
Test generation for untested code. It reads the implementation, infers intended behavior from the code and whatever docs exist, and generates tests covering normal paths, edge cases, and error conditions. It tends to find bugs while doing it.
Git workflow automation. Describe the commit in plain language, including what to leave out, and it handles staging, the commit message, the push, and a pull request with a structured description. With the GitHub MCP integration it can read open issues, implement fixes, run tests, and open the PR with full context.
Architecture analysis. Point it at an unfamiliar codebase and ask it to explain the architecture. You get a structured walkthrough of the organization, each major component, the data flow between services, and the critical paths. Useful for onboarding, technical due diligence, and writing the documentation nobody ever wrote.
MCP integration
Claude Code supports the Model Context Protocol, Anthropic's open standard for connecting models to external tools and data[1]. That extends its reasoning past the repository: query the production database to understand the data model before writing a migration, read the ticket to understand acceptance criteria before implementing, check the observability platform for error patterns before debugging.
The plugins directory carries a growing library of community integrations, so most common tools are already covered.
Claude Code, Cursor, or Copilot
| Claude Code | Cursor | GitHub Copilot | |
|---|---|---|---|
| Interface | Terminal CLI + IDE extensions | Custom VS Code fork | IDE extension |
| Context window | 1M tokens | ~128K tokens | ~128K tokens |
| SWE-bench score | 80.8% | Not reported | Not reported |
| Agentic operation | Full: plan, execute, test, commit | Partial (composer mode) | Partial (Copilot Workspace) |
| Multi-file editing | Native, coordinated | Yes | Limited |
| Pricing | Claude Pro/Max, $20 to $100/mo | $20/mo | $10 to $39/mo |
Source for the comparison rows is the same guide referenced throughout[1].
The honest read is that these are not really competing for the same minutes. Cursor is a VS Code fork with AI integrated throughout the editor: fast inline completion, multi-model support, a visual IDE. Copilot is the most widely deployed because it ships inside enterprise Microsoft subscriptions, and it handles routine completion well without operating as a full agent on complex multi-file work.
Most developers who use both use Cursor for daily editing and Claude Code for the tasks that need deep codebase understanding: large refactors, architecture changes, security audits, subtle cross-file bugs.
When you want this behavior inside your own product
Claude Code is Anthropic's agent, and it is the right tool when the work happens in your terminal. It is the wrong shape for a different job: putting the same behavior inside software you ship. A code-review bot in your CI, a migration agent for your customers, an internal tool that reads a repo and answers questions about it. None of those are a CLI on a developer's laptop.
That job needs the models directly. Access to Claude Code itself runs through a Claude Pro or Max subscription, or a Claude Console account with API access[1], and when you build your own agent you are working at that second layer.
reAPI exposes the Claude models through an OpenAI-compatible /v1/chat/completions endpoint, so one client and one key cover Claude alongside GPT and Gemini:
from openai import OpenAI
client = OpenAI(
api_key="YOUR_REAPI_KEY",
base_url="https://api.reapi.ai/v1",
)
resp = client.chat.completions.create(
model="claude-opus-5",
messages=[{"role": "user", "content": "Review this diff and report issues with severity."}],
max_tokens=16000,
stream=True,
)The native Anthropic /v1/messages surface is available too, so SDKs written for either format work unchanged. Model pages and rates are at reapi.ai/models, and the endpoint reference for the current Opus generation is at reapi.ai/docs/claude-opus-5.
Use Claude Code for your own repo. Use the API when the agent has to run in someone else's.
FAQ
What model powers Claude Code?
It runs on Anthropic's current frontier Claude models, and the default tracks whatever Anthropic has most recently shipped rather than staying pinned to one version. Check Anthropic's documentation for the model behind your plan at any given time.
Is Claude Code free?
No. It requires a Claude Pro or Max subscription, priced between $20 and $100 per month, or a Claude Console account with API access[1].
How big a codebase can Claude Code handle?
The context window is 1M tokens, roughly 25,000 to 30,000 lines in a single session without fragmentation[1]. Larger repositories still work, because it navigates the dependency graph rather than loading everything at once.
What is CLAUDE.md for?
Persistent per-project instructions read at the start of every session: coding conventions, test framework, files that must never be modified automatically. It is where teams encode onboarding knowledge[1].
Is Claude Code better than Cursor?
They solve different problems. Cursor is a full IDE experience with fast inline editing; Claude Code is a terminal agent with a much larger context window and full plan-execute-test-commit operation. Many developers run both[1].
Can Claude Code open pull requests?
Yes. It integrates with git directly, and tagging @claude on a GitHub issue returns a pull request. With the GitHub MCP integration it can read the issue, implement, test, and submit with full context[1].
What is Plan Mode?
A review gate. Claude Code presents the file-by-file plan before making changes, and waits for approval[1].
How do I build a coding agent of my own?
Call the models through an API rather than the CLI. Point an OpenAI-compatible client at https://api.reapi.ai/v1 and set the model string, or use the native Anthropic /v1/messages surface.
Picking the right layer
Claude Code earns its adoption on one property: it holds an entire project in view and acts on it, rather than guessing at the next line. The million-token window, the 80.8% SWE-bench score, and Plan Mode are three expressions of the same design decision, and they land hardest on refactors, cross-file debugging, and unfamiliar codebases.
Know which layer your problem lives at. If the work is in your repo and your terminal, install it and write a good CLAUDE.md before anything else. If the work is inside a product you ship to other people, you want the model API underneath, not the CLI on top of it. Learning how to use Claude Code well mostly means recognizing which of those two you are actually doing.
References
- Anthropic. Claude Code — overview, capabilities, surfaces, and configuration. Retrieved July 2026 from platform.claude.com/docs/claude-code
- Anthropic. Claude Code — official repository. Retrieved July 2026 from github.com/anthropics/claude-code
- Anthropic. Claude Code documentation. Retrieved July 2026 from docs.claude.com/en/docs/claude-code/overview
Further reading
- reAPI. How to use Claude Opus 5. reapi.ai/blog/how-to-use-claude-opus-5
- reAPI. How to use Claude Fable 5. reapi.ai/blog/how-to-use-claude-fable-5
- reAPI. Model catalog. reapi.ai/models
作者

分类
CLAUDE.md for?Is Claude Code better than Cursor?Can Claude Code open pull requests?What is Plan Mode?How do I build a coding agent of my own?Picking the right layerReferencesFurther reading更多文章

Cheapest Seedance 2.0 in 2026: Real Prices, Compared
Where is Seedance 2.0 cheapest? Verified per-second prices across the official API, Replicate, fal.ai, subscriptions, and reAPI — down to a $0.03/s floor.


Best CometAPI Alternatives in 2026: 5 Options Compared
Looking for CometAPI alternatives in 2026? Compare OpenRouter, WaveSpeed, Together AI, Replicate, and reAPI on models, pricing, speed, and API design.


How to Use Nano Banana 2 Lite: Speed, Price, and Limits
How to use Nano Banana 2 Lite: four-second 1K images, the official benchmarks, the corrected cost math, what the 1K ceiling rules out, and how to prompt it.
