What Is Claude Code?
Claude Code is Anthropic's official terminal-native coding agent.
You run claude inside any project directory and it can read files, run
shell commands, edit code, run tests, and explain its reasoning — all backed by Claude
Sonnet 4 (or Opus / Haiku, your choice). Think of it as the missing CLI between you
and the model.
What it is: a Node.js CLI (@anthropic-ai/claude-code)
that gives Claude full read/write access to your local repo, with permission prompts
for destructive actions. Conversation lives in your terminal, not a browser tab.
What Claude Code can do
- Read any file in the repo — it indexes your project on first run.
- Edit files in place — applies diffs, asks before overwriting.
- Run shell commands —
npm test,git diff,grep, etc. - Run tests in a loop — fix until green.
- Use external tools (MCP servers) — connect to your DB, your linter, your custom CLI.
- Multi-file refactors — long-context model holds the whole module set.
- Interactive mode + headless (
claude -p) mode — chat or one-shot.
How it differs from Cursor, Copilot, Aider
| Tool | Surface | Model | Best at |
|---|---|---|---|
| Claude Code | Terminal CLI | Claude (Sonnet/Opus/Haiku) | Long-running multi-file tasks, agentic loops |
| Cursor | VS Code fork (IDE) | Claude / GPT / others | Inline edits while you type |
| GitHub Copilot | IDE extension | OpenAI | Autocomplete + chat |
| Cline | VS Code extension | Bring-your-own (Claude/GPT) | Visual agent inside VS Code |
| Aider | Terminal CLI (Python) | Bring-your-own | Git-integrated AI commits |
Most people end up with two: an inline editor (Cursor or Copilot) for while-you-type completions, and a terminal agent (Claude Code) for long tasks like "make all 14 tests pass" or "migrate this module to TypeScript."
How it bills
Two pricing surfaces:
- Anthropic Pro / Max subscription — flat $20–200/month, daily caps, tied to your Anthropic login.
- API key (pay-as-you-go) — pay only the tokens you actually
consume. Required
ANTHROPIC_API_KEYenv var.
Cost comparison: Claude Code Proxy vs Official Subscription.
Install in 2 commands
npm install -g @anthropic-ai/claude-code
cd your-project
claude
First run asks for your API key (or signs you into Anthropic Pro). After that,
everything is one claude command away. Full guide:
Claude Code Setup.
What a typical session looks like
$ cd my-app
$ claude
claude> the user signup endpoint is throwing 500. Find and fix.
[claude reads server/auth.ts]
[claude reads server/db.ts]
[claude runs: npm test --grep signup]
…
claude> The bcrypt comparison was using `===` instead of `bcrypt.compare`.
I edited server/auth.ts (lines 47–52) and the test now passes.
Want me to commit?
claude> yes
[claude runs: git add . && git commit -m "fix(auth): use bcrypt.compare"]
Tips for using it well
- Keep prompts specific. "Fix the bug in /api/users" beats "fix bugs."
- Let it run shell commands. Auto-approve
npm testandgit status— most of its value is in the loop. - Use
claude -pfor one-shot scripts. Great in CI / makefiles. - Watch token spend — multi-file edits in long projects can burn tokens fast. Sonnet is the sweet spot; Opus only when you need it.
- Add a CLAUDE.md to your repo — Claude reads it as a project manual on every session.
When NOT to use Claude Code
- Tiny ad-hoc scripts where the IDE plugin is faster (
tab, done). - Air-gapped environments where you can't reach the API.
- Code that requires GUI inspection (Cursor's preview is better for UI work).
Get a key, halve your Claude Code bill
TokenProvider = pay-as-you-go Claude API at proxy rates. Same CLI, same features, ~50% off.
Sign up free → Already a member