01What is Claude Code?
Start here: what Claude Code actually is, what it can do in a real codebase, and how it differs from the Claude you use in a browser.
What is Claude Code?
Claude Code is Anthropic's agentic coding tool. It runs in your terminal as a CLI, reads your entire codebase, and does real engineering work on your behalf: editing files, running shell commands and tests, fixing bugs, and making git commits — all from natural-language instructions. Unlike a chat assistant that suggests code for you to paste, Claude Code acts directly on your project, looping through plan-edit-run-verify cycles until the task is done. Announced by Anthropic in February 2025 and generally available since May 2025, it also ships as VS Code and JetBrains extensions, a desktop app for Mac and Windows, and a web version at claude.ai/code — all powered by the latest Claude models.
The core product is the claude command. You open a terminal in a project directory, type claude, and describe what you want in plain English. Install on macOS or Linux with one line:
curl -fsSL https://claude.ai/install.sh | bash
Access requires a paid Claude subscription — Claude Pro ($20/month, roughly $17/month billed annually), Claude Max 5x ($100/month), Claude Max 20x ($200/month), or Team and Enterprise plans — or pay-per-token billing through an Anthropic API key. There is no permanent free tier. Usage on subscriptions is governed by 5-hour rolling session windows plus weekly caps shared with the Claude chat app.
What separates Claude Code from autocomplete tools is agency: it maintains project memory in a CLAUDE.md file, extends itself through MCP (Model Context Protocol) servers, Skills, hooks, and subagents, and can run headless in scripts and CI pipelines. Official docs live at code.claude.com/docs.
What does Claude Code do?
Claude Code takes a plain-English task, builds a plan, and executes it against your actual codebase. It searches and reads files, edits code across multiple files, runs shell commands, executes your test suite, and commits to git — iterating until the work verifiably passes. A permission system gates every risky action, so you decide how much autonomy to grant.
In practice, a session looks like this: you type a request ("fix the failing checkout test and explain what was wrong"), Claude Code greps the repo, reads the relevant files, proposes edits, runs the tests, and reports back. It is a read-eval loop for software work, not a code-completion widget.
The mechanics that make it work:
- Codebase awareness — it explores your project with search and file-read tools; no manual copy-pasting of context.
- Tool execution — it runs real commands (build, test, lint, git) and reads their output to check its own work.
- Plan Mode — press Shift+Tab to make it research and propose a plan before touching any file.
- Permissions — file edits and shell commands prompt for approval by default;
/permissions manages allowlists, and --dangerously-skip-permissions removes the guardrails entirely (use with care).
- Context management — long sessions auto-compact when the context window fills;
/compact, /clear, and /rewind give you manual control.
What can you do with Claude Code?
You can build entire features from a description, fix bugs from an error message or issue link, refactor legacy code, write and run tests, handle git workflows (commits, branches, PRs, merge-conflict resolution), generate documentation, answer questions about an unfamiliar codebase, and script data work — all from the terminal or your editor.
Common real-world uses, roughly in order of how often daily users reach for them:
- Feature development — describe the feature; Claude Code plans, implements across files, and verifies with your tests.
- Debugging — paste a stack trace or failing test name; it traces the root cause and patches it.
- Refactoring — modernize legacy modules, extract functions, migrate APIs, with tests as the safety net.
- Testing — generate unit tests, reproduce a bug as a failing test, then make it pass.
- Git and GitHub — write commit messages, create PRs, resolve merge conflicts, triage issues; a GitHub Actions integration lets it respond to
@claude mentions in issues and PRs.
- Documentation — generate or update READMEs, changelogs, and inline docs from the actual code.
- Codebase Q&A — "how does auth work in this repo?" is often the first thing new users try.
- Data and ops work — one-off scripts, log analysis, CSV munging, infrastructure files.
Headless mode extends all of this to automation — pipe a prompt in and get output back without the interactive UI:
claude -p "summarize the failing tests in this repo"
Is Claude Code an IDE?
No. Claude Code is not an IDE — it has no built-in code editor, file tree, or debugger. It is an agentic command-line tool that lives in your terminal and works alongside whatever editor you already use. Official extensions embed it inside VS Code and JetBrains IDEs, but the agent itself is editor-agnostic.
This is the key architectural difference from tools like Cursor, which is a fork of VS Code. Claude Code deliberately stays unopinionated about where you write code: it operates on the filesystem and shell, so it works identically whether you edit in Vim, VS Code, IntelliJ, or nothing at all.
| Surface | What it is |
| Terminal CLI | The core product — the claude command in any shell |
| VS Code extension | Native panel with inline diffs and IDE context sharing |
| JetBrains plugin | Same agent inside IntelliJ, PyCharm, WebStorm, etc. |
| Desktop app | Mac and Windows app for running parallel local sessions |
| Web (claude.ai/code) | Cloud-hosted sessions running against your GitHub repos |
If you want an AI-native IDE, Claude Code is not that. If you want an agent that plugs into the editor and terminal you already have, that is exactly what it is.
Is Claude Code an AI agent?
Yes. Claude Code is a true AI agent: it autonomously plans multi-step work, uses tools (file editing, shell execution, web fetching, git), observes the results, and adjusts course until the goal is met. It is not a chatbot or an autocomplete engine — it takes actions in your environment, with a permission system keeping you in control.
The agentic loop is the whole design: read the codebase, form a plan, act, verify, repeat. Several features push this further:
- Subagents — it can spawn parallel agents with isolated context windows for research, review, or independent subtasks.
- MCP client —
claude mcp add connects external tools and data sources (databases, browsers, Slack, internal APIs) via the Model Context Protocol.
- Skills and hooks —
SKILL.md folders package reusable expertise; hooks run your own scripts at defined points in the agent loop.
- Headless and CI operation —
claude -p runs the agent non-interactively inside scripts, cron jobs, and GitHub Actions.
- Claude Agent SDK — the same agent harness that powers Claude Code is available as an SDK for building your own agents.
Anthropic itself describes Claude Code as an agentic coding tool, and it is widely used as the reference example of what a production coding agent looks like.
What is the Claude Code CLI?
The Claude Code CLI is the command-line program, installed as claude, that runs Anthropic's coding agent in a terminal. Launch it with claude for an interactive session, or claude -p "prompt" for scripted, non-interactive use. It is the original and primary form of Claude Code; the IDE extensions and apps are wrappers around the same engine.
Install options:
# macOS / Linux (native installer)
curl -fsSL https://claude.ai/install.sh | bash
# Windows (PowerShell)
irm https://claude.ai/install.ps1 | iex
# npm (requires Node.js 18+)
npm install -g @anthropic-ai/claude-code
Inside a session, slash commands control the tool itself: /model switches models, /compact and /clear manage context, /rewind restores a checkpoint, /usage and /context show consumption, and /permissions edits allowlists. You can define custom slash commands per project. Exit with /exit or Ctrl+C twice; update with claude update.
Windows support is native as of current versions — early 2025 releases required WSL or Git Bash, which is why older tutorials still mention it.
What is the difference between Claude and Claude Code?
Claude is Anthropic's AI assistant — the chat interface at claude.ai and in the desktop and mobile apps. Claude Code is a separate developer tool that puts the same Claude models into an agent that works directly in your terminal and codebase: reading files, running commands, and committing code. Same brain, different body — chat answers questions; Claude Code performs the work.
| Claude (claude.ai / desktop) | Claude Code |
| Interface | Chat window, artifacts, projects | Terminal CLI, IDE extensions, desktop and web sessions |
| Access to your machine | None — you paste context in | Reads your filesystem, runs shell commands, uses git |
| Interaction model | Conversational Q&A | Agentic: plans, acts, verifies, iterates |
| Primary users | General users, writers, analysts | Developers and technical teams |
| Billing | Shared — one Pro/Max subscription covers both, drawing from the same usage limits |
Claude Desktop is simply the chat product packaged as a Mac/Windows app — it is not Claude Code, though the separate Claude Code desktop app blurs the naming. Anthropic also ships Claude Cowork, an agentic tool aimed at non-coding knowledge work; think of it as Claude Code's sibling for documents and business tasks. If you can describe your task as "talk to an AI," use Claude. If it is "make changes to my project," use Claude Code.
What model does Claude Code use?
Claude Code uses Anthropic's latest Claude models — the current Opus, Sonnet, and Haiku tiers. The default varies by plan and shifts as Anthropic releases new models. You can switch anytime with the /model command or the --model flag, and Max plans unlock heavier Opus usage.
Model selection in practice:
/model # interactive picker
/model opus # strongest reasoning
/model sonnet # balanced default
/model haiku # fastest and cheapest
/model opusplan # Opus for planning, Sonnet for execution
claude --model opus # set at launch
Rules of thumb from daily use: Sonnet handles the large majority of coding work; Opus earns its cost on architecture decisions, gnarly debugging, and large refactors; Haiku is for bulk mechanical edits. On subscription plans, Opus burns your usage allowance several times faster than Sonnet, which is why opusplan — expensive model for the plan, cheaper model for the typing — is a popular middle ground. API users pay per token at each model's standard rate instead. Anthropic updates the lineup regularly, so check /model in your own session rather than trusting hardcoded model names in tutorials.
What language is Claude Code written in?
Claude Code is written primarily in TypeScript, running on Node.js. Its terminal interface is built with React, rendered to the console via the Ink library — the same component model as a web app, drawing text UI instead of DOM. It is distributed as a bundled, minified JavaScript package and is not open source.
The TypeScript/React/Ink stack explains some of Claude Code's characteristic feel: the interactive prompt, live-updating spinners, diffs, and menus are React components re-rendering in your terminal. The npm distribution (@anthropic-ai/claude-code) requires Node.js 18+, while the native installers bundle their own runtime.
On the open-source question: the GitHub repository anthropics/claude-code hosts the issue tracker, docs, and changelog — but not the source. What ships is a compiled, minified bundle. In 2025, de-minified reconstructions of that bundle circulated publicly (often reported as a "source code leak"), which confirmed the TypeScript-plus-Ink architecture but did not change the product's licensing: Claude Code remains proprietary. Developers who want the underlying agent machinery officially can use the Claude Agent SDK, which Anthropic publishes for building custom agents on the same foundations.
When was Claude Code released?
Claude Code was announced on February 24, 2025, as a limited research preview launched alongside the Claude 3.7 Sonnet model. It became generally available in May 2025 during Anthropic's Claude 4 launch. IDE extensions, the web version, and the desktop app followed over late 2025, making it a multi-surface product by 2026.
| Date | Milestone |
| Feb 24, 2025 | Announced as a research preview alongside Claude 3.7 Sonnet |
| May 2025 | General availability, announced with the Claude 4 model family |
| Mid–late 2025 | VS Code and JetBrains extensions, subagents, hooks, Skills, plugins |
| Late 2025 | Web version (claude.ai/code) and desktop app |
| 2026 | Continued rapid iteration across the CLI, IDE, desktop, and web surfaces |
The pace of change matters more than the birthday: Claude Code ships updates near-weekly, and the changelog in the anthropics/claude-code GitHub repo is the authoritative record. Features that define the tool today — Plan Mode, checkpoints and /rewind, MCP support, subagents, Skills, plugin marketplaces — arrived incrementally after launch, so guides written in early 2025 describe a much smaller product than the one you install now.
Who created Claude Code?
Claude Code was created at Anthropic by engineer Boris Cherny, who built it as an internal tool that spread rapidly among Anthropic's own engineers before its public release in February 2025. Anthropic — the AI safety company founded in 2021 by former OpenAI researchers including Dario and Daniela Amodei — develops and maintains it.
The origin story is part of why the tool feels the way it does. Cherny started with a simple idea — give Claude a terminal and see what it can do — and the internal version became so popular inside Anthropic that dogfooding shaped the product before any outside user touched it. Anthropic has said the overwhelming majority of Claude Code's own code is now written with Claude Code.
Cherny briefly made headlines in July 2025 when he left Anthropic for Cursor-maker Anysphere and returned to Anthropic about two weeks later — a story widely covered as a proxy for the AI coding talent war. Today Claude Code is developed by a full product team at Anthropic, with its direction visible in the public changelog and issue tracker at anthropics/claude-code on GitHub.
02Claude Code pricing & plans
Every plan that includes Claude Code, what each tier actually costs in mid-2026, and how to tell whether the subscription earns its keep.
How much does Claude Code cost?
Claude Code costs $20/month at minimum. It is included with Claude Pro ($20/month, about $17/month billed annually), Claude Max 5x ($100/month), Claude Max 20x ($200/month), Team Premium seats ($100–$125 per seat), and Enterprise. Alternatively, you can pay per token with a Claude API key from the Anthropic Console. There is no free tier.
| Plan | Price | Claude Code usage |
| Claude Pro | $20/mo (~$17/mo annual) | Included, smallest limits; shared with claude.ai chat |
| Claude Max 5x | $100/mo | ~5× Pro session limits, higher weekly caps |
| Claude Max 20x | $200/mo | ~20× Pro; built for all-day agentic work |
| Team Standard | $25/seat/mo ($20 annual) | Not included — Standard seats cover Claude chat, not Claude Code |
| Team Premium | $125/seat/mo ($100 annual) | Included; ~6.25× Pro usage per seat; Team plans have a 5-seat minimum |
| Enterprise | Custom | Custom limits, SSO, managed policies |
| API (Console) | Pay per token | No session caps; you pay for exactly what you burn |
Two billing models, one tool. Subscriptions give you a flat monthly price with usage limits (5-hour rolling session windows plus weekly caps). The API route has no caps but bills every token; a heavy day of agentic coding can cost more on the API than a whole month of Pro, which is why most individual developers pick a subscription. Non-interactive usage (headless claude -p, the Agent SDK, GitHub Actions) draws from the same subscription limits — Anthropic announced a separate monthly credit pool for that usage in May 2026, then cancelled the change before its June 15 start date.
If you already have a Claude subscription, there is nothing extra to buy — install Claude Code, run claude, and log in with your Claude account.
Is Claude Code free?
No. Claude Code is not free and has no permanent free tier — Claude's free plan covers chat only, not Claude Code. The cheapest ongoing option is Claude Pro at $20/month. You can trial it briefly: new Anthropic Console accounts get a small API credit (roughly $5, per third-party reports), and Pro/Max subscribers can gift a subscription (1 to 12 months) at claude.ai/gift.
Ways to try Claude Code without committing to a subscription, as of mid-2026:
- New API credits. Create an account at the Anthropic Console, claim the introductory credit (no card required, phone verification needed), and point Claude Code at your API key. Expect it to last a handful of sessions — agentic coding burns tokens fast.
- Guest pass. Existing Claude Code subscribers can send a pass that gives a new user 7 days of full access to Claude and Claude Code.
- Programs. Anthropic has run targeted free-access programs, such as Claude for Open Source (six months of Max 20x for qualifying open-source maintainers; applications ran February through June 2026) and university-wide Claude for Education licenses.
Beware of "Claude promo code" sites — Anthropic does not issue public discount codes, and listings claiming 50% off are fake. The only legitimate discount is annual billing on Pro (about $17/month instead of $20).
Does Claude Pro include Claude Code?
Yes. Claude Pro ($20/month) includes Claude Code. Pro's usage limits are shared across claude.ai chat and Claude Code — everything draws from one pool, governed by a 5-hour rolling session window and a weekly cap. Pro suits light-to-moderate daily coding; developers who hit the session limit most days should move to Max 5x.
To use it, install Claude Code and authenticate with your Claude account rather than an API key:
curl -fsSL https://claude.ai/install.sh | bash
claude # then choose "Log in with Claude account"
One thing to watch: because chat and coding share the same allowance on Pro, a long claude.ai research session eats into the same budget your terminal work uses. Heavy users of both often find that alone justifies Max. Note that Anthropic briefly tested removing Claude Code from Pro for a small group of new signups in April 2026 and reversed course within a day (details below) — as of mid-2026, Pro includes Claude Code for everyone.
What is the Claude Code Pro plan and what are its limits?
There is no separate "Claude Code Pro plan" — it is the standard Claude Pro subscription ($20/month) used for Claude Code. Limits work on two layers: a 5-hour rolling session window that starts at your first prompt, plus a weekly cap. Anthropic publishes multipliers rather than exact token counts, and usage is shared with claude.ai chat.
How the limits behave in practice:
- 5-hour session window. The clock starts on your first prompt, not on a fixed schedule. When you hit the ceiling, Claude Code tells you when the window resets. Anthropic doubled the 5-hour limits for Pro, Max, and Team plans in May 2026 and removed the peak-hours reduction at the same time.
- Weekly cap. A second ceiling across the week, with a fixed reset time assigned to your account. Run
/usage to see both meters and their reset times.
- Burn rate varies. Model choice, conversation length, codebase size, and features like subagents all change how fast you consume the allowance. Switching to a Sonnet-tier model with
/model stretches a Pro plan considerably versus running Opus-tier models.
- Headless counts too. Non-interactive usage (
claude -p, the Agent SDK, GitHub Actions) draws from the same subscription limits. Anthropic announced a separate monthly credit for it in May 2026, then cancelled that change before its June 15 start date.
Rule of thumb from daily use: Pro comfortably covers a couple of focused coding sessions per day on Sonnet-tier models. If you routinely see the session-limit warning, that is the signal to upgrade — not a bug.
Claude Code Pro vs Max: which plan should you get?
Get Pro ($20/month) if you code with Claude a few hours a day and can live on Sonnet-tier models. Get Max 5x ($100/month) if you hit Pro's session limits most days or want generous Opus-tier usage. Max 20x ($200/month) is for running Claude Code most of the working day, often with parallel sessions and subagents.
| Pro ($20/mo) | Max 5x ($100/mo) | Max 20x ($200/mo) |
| Session allowance | Baseline | ~5× Pro | ~20× Pro |
| Weekly caps | Lowest | Higher, incl. a separate Opus-tier weekly cap | Highest |
| Opus-tier models | Constrained; Sonnet is the practical default | Comfortable Opus usage | Sustained Opus usage |
| Best for | Evenings, side projects, light daily use | Full-time developers | Power users, parallel agents, all-day sessions |
The honest decision rule: start on Pro and watch /usage for two weeks. If the 5-hour window blocks you more than a couple of times a week, upgrade to Max 5x — the interrupted flow costs you more than the $80 difference. Very few people need Max 20x on day one; it earns its price when you orchestrate multiple simultaneous sessions or long-running agentic workloads, where its allowance still beats equivalent API spend by a wide margin.
How much does Claude Code cost per token on the API?
On API billing, Claude Code costs whatever the underlying model charges per million tokens (MTok): Opus-tier models run $5 input / $25 output, Sonnet-tier $3 / $15, and Haiku 4.5 $1 / $5, as of mid-2026. Prompt caching, which Claude Code uses automatically, cuts repeated-context input costs by about 90%.
| Model tier (mid-2026) | Input / MTok | Output / MTok | Notes |
| Opus 4.x | $5 | $25 | Current flagship is Opus 4.8; 1M-token context bills at these standard rates on Opus 4.6 and later — no long-context surcharge |
| Sonnet 4.x / 5 | $3 | $15 | The workhorse default; Sonnet 5 carries introductory $2 / $10 pricing through August 2026 |
| Haiku 4.5 | $1 | $5 | Cheapest; good for bulk mechanical subagent work |
Cache reads bill at a tenth of the base input rate (e.g., $0.50/MTok on Opus-tier), and Claude Code leans on caching heavily — your system prompt, CLAUDE.md, and conversation prefix are re-read every turn. That is why real-world Claude Code API bills are dominated by output tokens and cache writes, not raw input.
To use API billing, set your key and watch spend in-session:
export ANTHROPIC_API_KEY=sk-ant-...
claude
/cost # shows the current session's API spend
Budget reality check: an intense day of agentic coding on Opus-tier models can run tens of dollars on the API. If your monthly API spend on Claude Code exceeds $20, a Pro subscription is already cheaper; past roughly $100, Max 5x wins. Verify current rates at platform.claude.com/docs/en/about-claude/pricing before committing to a budget.
Was Claude Code removed from the Pro plan?
No — Claude Code is still included in Claude Pro. In April 2026, Anthropic changed its public pricing page and support docs to show Claude Code as Max-only, calling it a pricing experiment on about 2% of new signups. Existing subscribers were never cut off, and after intense backlash Anthropic restored the pages within about a day.
What actually happened, in order:
- On April 21, 2026, claude.com/pricing showed an X next to Claude Code in the Pro column, and the support article "Using Claude Code with your Pro or Max plan" was retitled to mention only Max. There was no announcement.
- Anthropic then explained it was testing removal for a small share of new prosumer signups because Claude Code usage per subscriber had grown far beyond what the $20 plan was designed for — subscription plans reportedly charge well under the book value of tokens consumed.
- The community reaction was severe across Reddit, Hacker News, and X, and critics noted the public pages had changed for everyone — not what a 2% test flag looks like. Claude Code kept working for Pro users in the terminal throughout.
- Anthropic reversed the pricing-page and documentation changes in less than 24 hours and publicly acknowledged the communication error.
The durable takeaway: as of mid-2026, Pro includes Claude Code, but Anthropic has openly signaled that its subscription tiers predate Claude Code's usage patterns and may be restructured. If you rely on the $20 entry point, check the current plan matrix at claude.com/pricing before assuming the status quo holds.
Is Claude Code free for students?
Not individually. Anthropic offers no student discount on Claude Pro or Claude Code. Students get free access only through Claude for Education — an institutional license where partner universities provision Claude's premium tier, including Claude Code, via school SSO — or through Anthropic's campus programs (Campus Ambassadors and Builder Clubs), which grant Pro access plus API credits.
The legitimate student routes, as of mid-2026:
- Claude for Education. Launched April 2025. If your university is a partner (examples include Northeastern, the London School of Economics, and Champlain College), you get premium Claude access — including Claude Code — for as long as you are enrolled. There is no individual signup; your institution must provision it.
- Campus programs. Campus Ambassadors and student-run Builder Clubs receive Claude Pro access and monthly API credits from Anthropic.
- Student API credits. Anthropic has offered builder credits (around $50) with .edu verification, which you can spend through Claude Code by authenticating with an API key.
- Coursework partnerships. Anthropic's partnership with CodePath integrates Claude and Claude Code into CS courses reaching 20,000+ students at community colleges, state schools, and HBCUs.
If none of those apply, the paths are the same as everyone else's: the small new-account API credit, a gifted subscription from an existing subscriber (Pro/Max gifts run 1 to 12 months, at claude.ai/gift), or $20/month for Pro. Ignore any site advertising a Claude student promo code — those codes do not exist.
How do you track and reduce Claude Code spending?
Check spend inside Claude Code with /cost (API billing), /usage (rate-limit status), and /status. For detailed accounting most people use ccusage, a popular open-source tool you can run without installing: npx ccusage shows daily and monthly token spend, and npx ccusage blocks --live tracks your active 5-hour window in real time (it reads the local logs in ~/.claude/projects). Rule of thumb: if your API-equivalent usage tops $100/month, Max 5x ($100) is cheaper; above $200, Max 20x ($200). Subscriptions win big because most tokens are cached reads the flat plan already covers. Cut costs further by defaulting to Sonnet and clearing context between tasks.
Is Claude Code worth it?
For most working developers, yes — at $20/month, Claude Code pays for itself if it saves one hour of work a month, and subscription plans deliver tokens at well below API book value, sometimes by 10x or more. It is not worth it if you code occasionally, work in an environment that bans cloud AI tools, or only need autocomplete.
The honest cost/benefit from daily use:
- The math favors subscribing. A single serious agentic session can consume tokens that would cost several dollars at API rates, and reporting around Anthropic's April 2026 pricing experiment indicated heavy subscribers consume many times their plan's price in API book value. This is exactly why Anthropic tested pulling Claude Code from Pro — the plans are underpriced relative to consumption.
- Where it earns the money: multi-file refactors, test writing, debugging from logs, codebase Q&A, boilerplate, migrations, and headless automation. Whole-task delegation, not line completion, is the value proposition.
- Where it does not: if you want inline autocomplete while you type, GitHub Copilot is cheaper. If you mostly write small scripts, the free-tier chat at claude.ai plus copy-paste may be enough.
- Hidden cost: the usage caps. Pro's limits interrupt heavy users mid-task; factor in the real price ($100/month for Max 5x) if Claude Code becomes your primary workflow.
The low-risk evaluation path: one month of Pro, real work, and a /usage check at the end. If you never thought about the $20 again, it was worth it.
How do you check your Claude Code usage and limits?
Run /usage inside Claude Code. It shows your current 5-hour session window and weekly cap consumption, with exact reset times. Use /status for plan and account details, /context for a live context-window breakdown, and /cost for session spend on API billing. On claude.ai, Settings > Usage shows the combined dashboard across Claude and Claude Code.
/usage # session (5-hour) + weekly limit meters and reset times
/status # plan, account, model, connectivity
/context # what's filling the context window right now
/cost # API-billed session spend (Console accounts)
How to read the numbers:
- The 5-hour window is rolling. It starts at your first prompt, not on the clock hour. When you hit it, Claude Code reports when the window resets — usage is not lost, just paused.
- Weekly caps reset at a fixed time assigned to your account;
/usage and Settings > Usage on claude.ai both show your next reset. Max plans carry two weekly meters: one across all models and one specific to Opus-tier usage.
- Chat counts too. On Pro and Max, claude.ai conversations and Claude Code draw from the same pool, so a heavy chat day shrinks your terminal budget.
- So does headless. Non-interactive usage (
claude -p, the Agent SDK, GitHub Actions) draws from the same subscription limits as your terminal sessions; a separate credit pool announced for June 15, 2026 was cancelled before it took effect.
Practical habit: check /usage before starting a long agentic task, and switch to a Sonnet-tier model with /model when the weekly meter runs hot — Opus-tier tokens deplete the allowance fastest.
03How to install Claude Code
Every way to get Claude Code running — macOS, Windows, Linux, npm, Homebrew, and the VS Code extension — plus how to update it and how to remove it cleanly.
How do you install Claude Code?
Install Claude Code with Anthropic's native installer: run curl -fsSL https://claude.ai/install.sh | bash on macOS, Linux, or WSL, or irm https://claude.ai/install.ps1 | iex in Windows PowerShell. Alternatives are npm (npm install -g @anthropic-ai/claude-code, Node 18+) and Homebrew (brew install --cask claude-code). Then run claude in a project folder and sign in with a Claude or Anthropic Console account.
The native installer is what Anthropic recommends: it has zero dependencies (no Node.js required), installs a standalone binary to ~/.local/bin/claude, and auto-updates in the background. The package-manager routes exist for teams that standardize on npm, Homebrew, WinGet, apt, dnf, or apk.
| Method | Command | Auto-updates |
| Native (macOS/Linux/WSL) | curl -fsSL https://claude.ai/install.sh | bash | Yes |
| Native (Windows PowerShell) | irm https://claude.ai/install.ps1 | iex | Yes |
| npm | npm install -g @anthropic-ai/claude-code | Yes, if the npm global dir is writable |
| Homebrew (macOS/Linux) | brew install --cask claude-code | Not by default — brew upgrade claude-code |
| WinGet (Windows) | winget install Anthropic.ClaudeCode | Not by default — winget upgrade Anthropic.ClaudeCode |
After installing, verify and launch:
claude --version # confirm the install
claude doctor # detailed health check
cd your-project && claude
System requirements: macOS 13.0+, Windows 10 1809+, Ubuntu 20.04+/Debian 10+, 4 GB+ RAM, and an internet connection. You need a paid account — Claude Pro ($20/month), Max, Team, Enterprise, or a pay-per-token Anthropic Console API account. The free Claude.ai plan does not include Claude Code.
How do you install Claude Code on Mac?
On macOS, open Terminal and run curl -fsSL https://claude.ai/install.sh | bash. That installs the standalone Claude Code binary to ~/.local/bin/claude — no Node.js or Xcode needed. Homebrew users can run brew install --cask claude-code instead. Requires macOS 13.0 or later; both Apple Silicon (ARM64) and Intel Macs are supported.
curl -fsSL https://claude.ai/install.sh | bash
The native installer auto-updates in the background, which is why it is the recommended path. If you prefer Homebrew, there are two official casks:
brew install --cask claude-code # stable channel (~1 week behind)
brew install --cask claude-code@latest # latest channel, every release
Install one or the other, not both — two copies cause version conflicts. Homebrew installs do not auto-update by default; run brew upgrade claude-code yourself. Note that brew install --cask claude (without -code) is a different product: the Claude desktop app.
After installing, run claude from any project directory and complete the browser sign-in. If claude is not found, restart Terminal so ~/.local/bin is picked up on your PATH. Mac users who want a graphical interface instead of the terminal can use the Claude Code panel in the desktop app (download at claude.com/download) or the VS Code extension — but the CLI itself installs via terminal only.
How do you install Claude Code on Windows?
On Windows, open PowerShell and run irm https://claude.ai/install.ps1 | iex. Claude Code runs natively on Windows 10 (1809+) and Windows 11 — no WSL required, no administrator rights needed. Early 2025 versions required WSL or Git Bash, but that requirement is gone. WinGet (winget install Anthropic.ClaudeCode) and npm also work.
# PowerShell
irm https://claude.ai/install.ps1 | iex
# CMD
curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd
Use the command that matches your shell — if your prompt starts with PS C:\ you are in PowerShell; without the PS you are in CMD. Two Windows-specific notes:
- Git for Windows is recommended (not required). It provides Git Bash, which Claude Code uses for its Bash tool. Without it, Claude Code falls back to running shell commands through PowerShell.
- WSL is still a valid option. Run the Linux installer (
curl -fsSL https://claude.ai/install.sh | bash) inside your WSL 2 distribution if your projects and toolchain live there — WSL 2 also enables sandboxed command execution, which native Windows does not support.
| Option | Requires | Best for |
| Native Windows | Nothing (Git for Windows optional) | Windows-native projects and tools |
| WSL 2 | WSL 2 enabled | Linux toolchains, sandboxing support |
The old advice that "Claude Code needs Git Bash or WSL on Windows" refers to the research-preview era in early 2025; native Windows support has shipped since.
How do you install Claude Code on Linux or Ubuntu?
On Linux, run curl -fsSL https://claude.ai/install.sh | bash — it works on Ubuntu 20.04+, Debian 10+, and Alpine 3.19+, on both x64 and ARM64, and auto-updates. Anthropic also publishes signed apt, dnf, and apk repositories, so Ubuntu/Debian users can sudo apt install claude-code after adding the repo.
The one-line installer is the fastest path and needs no root:
curl -fsSL https://claude.ai/install.sh | bash
If you prefer managed packages on Ubuntu or Debian, add Anthropic's signed apt repository (stable channel shown):
sudo install -d -m 0755 /etc/apt/keyrings
sudo curl -fsSL https://downloads.claude.ai/keys/claude-code.asc \
-o /etc/apt/keyrings/claude-code.asc
echo "deb [signed-by=/etc/apt/keyrings/claude-code.asc] https://downloads.claude.ai/claude-code/apt/stable stable main" \
| sudo tee /etc/apt/sources.list.d/claude-code.list
sudo apt update && sudo apt install claude-code
Fedora/RHEL users get an equivalent dnf repo, and Alpine an apk repo (Alpine additionally needs libgcc, libstdc++, and ripgrep, plus USE_BUILTIN_RIPGREP=0 in settings). Package-manager installs update through your normal apt upgrade workflow rather than auto-updating. npm (npm install -g @anthropic-ai/claude-code) works too if you already have Node 18+. Headless servers are fine — authenticate once via the browser flow on first run, or set an API key, and use claude -p for non-interactive scripting.
How do you install Claude Code with npm?
Run npm install -g @anthropic-ai/claude-code. It requires Node.js 18 or later and installs the same native binary as the standalone installer — npm just delivers it via a per-platform optional dependency. Never use sudo npm install -g; if you hit EACCES permission errors, fix your npm prefix or use a Node version manager like nvm instead.
npm install -g @anthropic-ai/claude-code
claude --version
Things worth knowing about the npm path:
- It's a wrapper for a native binary. The package pulls in a platform-specific dependency (e.g.
@anthropic-ai/claude-code-darwin-arm64) and links it into place. The installed claude command does not run through Node — so your package manager must allow optional dependencies.
- Permission errors: the classic
EACCES failure means your npm global directory is root-owned. Do not reach for sudo — it creates security and ownership problems. Either point npm at a user-writable prefix (npm config set prefix ~/.npm-global and add it to PATH) or install Node via nvm, which keeps globals in your home directory.
- Upgrading: run
npm install -g @anthropic-ai/claude-code@latest. Avoid npm update -g, which respects the original semver range and may not move you to the newest release. Claude Code can also auto-update npm installs when the global directory is writable.
- Supported platforms: darwin-arm64/x64, linux-x64/arm64 (glibc and musl), win32-x64/arm64.
If you don't already have Node 18+ installed, skip npm entirely and use the native installer — it has no runtime dependencies.
Is there a Claude Code VS Code extension?
Yes. Anthropic publishes an official Claude Code extension (anthropic.claude-code) on the VS Code Marketplace. It adds a graphical chat panel with side-by-side diff review, @-mentions of files and line ranges, editable plans, checkpoints/rewind, session history, and multiple parallel conversations in tabs. Requires VS Code 1.98.0+ and any paid Claude plan or Console account.
To install: open the Extensions view (Cmd+Shift+X / Ctrl+Shift+X), search "Claude Code", click Install, then click the Spark icon in the editor toolbar and sign in via the browser. Alternatively, running claude in VS Code's integrated terminal auto-installs the extension.
Two details trip people up:
- The extension bundles its own copy of the CLI for the chat panel, but it does not put
claude on your shell PATH. To run claude in the integrated terminal, install the standalone CLI too (see the install methods above). The two share conversation history — claude --resume in the terminal picks up extension sessions.
- The extension exposes a subset of features. Some things remain CLI-only, like the
! bash shortcut, tab completion, and full MCP server configuration (claude mcp add runs in the terminal; /mcp in the panel manages existing servers).
A JetBrains plugin exists as well for IntelliJ, PyCharm, WebStorm, and the rest of that family. Full docs: code.claude.com/docs/en/vs-code.
Can you use Claude Code inside Cursor?
Yes, two ways. Because Cursor is a VS Code fork, the official Claude Code extension installs directly in it — search "Claude Code" in Cursor's Extensions view, and Anthropic's docs even provide a one-click cursor:extension/anthropic.claude-code install link. Alternatively, run the claude CLI inside Cursor's integrated terminal; it works in any terminal.
This setup is common: developers keep Cursor's own tab completion and editor features while using Claude Code as the agent doing multi-file work. Notes for fork users:
- Anthropic explicitly supports the extension in VS Code forks — the docs provide the Cursor install link and note it also installs in other forks (naming Devin Desktop and Kiro as examples). If a fork can't reach the Microsoft Marketplace, the extension is also published on the Open VSX registry (
open-vsx.org/extension/Anthropic/claude-code).
- If the extension won't install in a given fork, the fallback is always the CLI: install Claude Code normally, open the fork's integrated terminal, and run
claude. Diff viewing and diagnostics integrate with the editor when the companion extension is present.
- You pay for each tool separately: a Cursor subscription covers Cursor's models; Claude Code bills through your Claude plan or Anthropic API key regardless of the editor it runs in.
The same pattern applies to any editor with a terminal — Zed, JetBrains (which also has a dedicated plugin), or a plain tmux session. The CLI is editor-agnostic.
How do you update Claude Code?
Run claude update to update immediately. If you used the native installer, updates also happen automatically in the background — Claude Code checks on startup and installs new versions that take effect on next launch. npm installs auto-update too when the global directory is writable; Homebrew and WinGet installs require brew upgrade claude-code or winget upgrade Anthropic.ClaudeCode by default.
claude update # manual update, any native install
claude doctor # shows the result of the last update attempt
Update commands by install method:
| Install method | Update command |
| Native installer | Automatic; claude update to force |
| npm | npm install -g @anthropic-ai/claude-code@latest |
| Homebrew | brew upgrade claude-code (or claude-code@latest) |
| WinGet | winget upgrade Anthropic.ClaudeCode |
| apt / dnf / apk | Normal system upgrade, e.g. sudo apt upgrade claude-code |
Homebrew and WinGet users can opt in to hands-off updates by setting CLAUDE_CODE_PACKAGE_MANAGER_AUTO_UPDATE to 1, which has Claude Code run the upgrade command in the background. You can pick a release channel with the autoUpdatesChannel setting: "latest" (default, every release) or "stable" (about a week behind, skips releases with major regressions). To turn background updates off, set DISABLE_AUTOUPDATER to "1" in the env block of ~/.claude/settings.json — claude update still works manually. Historical note: early npm versions self-updated in place, which caused permission headaches; the current architecture (a native binary on all install paths) replaced that behavior.
How do you uninstall Claude Code?
Uninstall depends on how you installed: for the native installer, delete the binary with rm -f ~/.local/bin/claude && rm -rf ~/.local/share/claude; for npm, run npm uninstall -g @anthropic-ai/claude-code; for Homebrew, brew uninstall --cask claude-code. Settings and history live separately in ~/.claude/ and ~/.claude.json — delete those too for a full removal.
# Native install (macOS, Linux, WSL)
rm -f ~/.local/bin/claude
rm -rf ~/.local/share/claude
# npm
npm uninstall -g @anthropic-ai/claude-code
# Homebrew
brew uninstall --cask claude-code # or claude-code@latest
# WinGet
winget uninstall Anthropic.ClaudeCode
On Windows native installs, remove %USERPROFILE%\.local\bin\claude.exe and %USERPROFILE%\.local\share\claude in PowerShell. Then, optionally, remove configuration — this deletes all settings, permission allowlists, MCP server configs, and session history:
rm -rf ~/.claude
rm ~/.claude.json
# per-project, from the project root:
rm -rf .claude && rm -f .mcp.json
Two gotchas. First, if claude still runs after uninstalling, you almost certainly have a second installation (e.g. both npm and native) or a leftover shell alias — check with which -a claude. Second, the VS Code extension, JetBrains plugin, and desktop app write to ~/.claude/ too and will recreate it; uninstall those first if you want the directory gone for good.
Do you need to download Claude Code? Where from?
There is no separate download file for the Claude Code CLI — no .dmg, .exe, or .zip to hunt for. You install it from the terminal with one command: curl -fsSL https://claude.ai/install.sh | bash (macOS/Linux) or irm https://claude.ai/install.ps1 | iex (Windows PowerShell). The installer fetches the signed binary from Anthropic's servers automatically.
"Download Claude Code" searches usually mean one of four things:
- The CLI — installed via the terminal one-liner above, npm, Homebrew, or WinGet. The install script and binaries come from Anthropic's own domains (
claude.ai and downloads.claude.ai); release manifests are GPG-signed and the macOS/Windows binaries carry Anthropic code signatures. Don't download Claude Code from third-party mirror sites.
- The desktop app — the one thing that is a traditional download. Claude Desktop (macOS, Windows, and Linux, from claude.com/download) includes a graphical Claude Code interface for people who prefer clicking to typing in a terminal.
- The VS Code extension — installed from the VS Code Marketplace inside the editor, not downloaded from a website.
- The web version — claude.ai/code runs Claude Code sessions in the browser against your GitHub repos; nothing to install at all.
Note that the GitHub repository anthropics/claude-code is not a download source either — Claude Code is not open source, and that repo hosts the issue tracker, docs, and changelog rather than installable source code. Everything official starts at code.claude.com/docs/en/setup.
04How to use Claude Code
Everything from your first claude command to daily-driver habits: launching and exiting, resuming sessions, Plan Mode, slash commands, and getting the permission system to work for you instead of against you.
How do you use Claude Code?
To use Claude Code, open a terminal, cd into your project, and run claude. Describe what you want in plain English — fix a bug, add a feature, explain the codebase. Claude reads your files, proposes changes, and asks permission before editing or running commands. You approve, review the diff, and iterate. That loop — ask, approve, review — is the entire workflow.
The minimal first session looks like this:
cd ~/projects/my-app
claude
> explain what this codebase does
> add input validation to the signup form, then run the tests
Claude Code is agentic: it doesn't just suggest code, it takes actions. It searches your repo, edits files, runs shell commands (tests, linters, git), and reads the output to correct itself. Each action that touches your system triggers a permission prompt the first time, so nothing happens behind your back by default.
A typical working rhythm, once you're past the first session:
- Scope the task. One feature or one bug per request. Point at specific files when you know them.
- Let Claude plan first for anything non-trivial (see Plan Mode below).
- Approve and watch. Review diffs as they appear; interrupt with Esc if it goes sideways.
- Verify. Ask Claude to run the test suite or build — a green command beats "looks right".
- Commit, then
/clear and move to the next task.
Claude Code runs in the terminal, but the same agent is available in VS Code and JetBrains extensions, a desktop app, and on the web at claude.ai/code. The terminal remains the canonical experience.
How do you start Claude Code in the terminal?
Start Claude Code by typing claude inside your project directory — that opens an interactive session. Use claude "prompt" to launch with an initial task, claude -p "prompt" for a one-shot headless answer that prints and exits, claude --continue to reopen your most recent session in that directory, or claude --resume to pick from past sessions.
# interactive session (the normal way)
claude
# start with a task already queued
claude "fix the failing test in auth.spec.ts"
# headless / scripting mode: answer, print, exit
claude -p "summarize this repo's architecture" > overview.md
# reopen the most recent conversation in this directory
claude --continue
# pick a specific past session from an interactive list
claude --resume
Two details that matter in practice:
- Where you launch matters. Claude Code treats the current directory as its workspace, so always
cd into the project first. Launching from ~ gives it your whole home directory as context — slower and messier.
-p (print mode) is the automation gateway. It's how you use Claude Code in shell scripts, cron jobs, and CI. Pair it with --output-format json for machine-readable output.
The first launch walks you through login — either a Claude subscription account or an Anthropic Console API key. After that, claude just works.
How do you get started with Claude Code as a beginner?
As a beginner, spend your first 30 minutes like this: run claude in a real project, type /init so Claude generates a CLAUDE.md memory file, then give it one small, well-scoped task — fix a specific bug or write one test. Review every diff before approving. Commit when it works. Do not start with "refactor my whole app".
A concrete first-session script:
- Minute 0–5:
cd into a project you know well (ideally with git initialized, so everything is reversible) and run claude.
- Minute 5–10: Run
/init. Claude scans the repo and writes CLAUDE.md — build commands, conventions, architecture notes. This file is loaded at the start of every future session, so Claude stops re-learning your project each time. Edit it; it's yours.
- Minute 10–15: Ask questions before asking for changes: "how does authentication work here?", "where is the payment logic?". This builds your trust in what it actually understands.
- Minute 15–30: Give it one small task with a verifiable finish line: "write a test that reproduces the bug in
parseDate, then fix it and make the test pass." Read each diff at the permission prompt before approving.
Beginner habits that pay off immediately: keep tasks small enough that you can review the output; ask Claude to prove changes with a command (tests, build, typecheck) rather than accepting "done"; and commit after each working change so a bad run costs you nothing. The failure mode for new users is almost always over-scoping, not the tool.
How do you exit Claude Code?
Exit Claude Code by typing /exit at the prompt, pressing Ctrl+C twice in quick succession, or pressing Ctrl+D twice — the first Ctrl+D shows a confirmation so you don't exit by accident. Your conversation is saved automatically on exit — nothing is lost, and you can reopen it later with claude --continue.
| Method | What it does |
/exit | Cleanly ends the session |
| Ctrl+C (twice) | First press interrupts the current action; second press exits |
| Ctrl+D (twice) | EOF exit at an empty prompt; first press asks for confirmation |
The single-vs-double Ctrl+C distinction is useful, not annoying: one Ctrl+C stops whatever Claude is currently doing (a long command, a runaway edit) without killing the session, which is usually what you actually want. Esc does the same interrupt without any risk of exiting.
Every session is persisted to disk automatically, keyed to the directory you launched from. Quitting is cheap — treat exit and resume as pause and unpause, not as losing your work.
How do you restart Claude Code and resume a session?
Resume Claude Code with claude --continue (or -c), which reopens the most recent conversation in the current directory, or claude --resume (or -r), which shows an interactive picker of past sessions and also accepts a specific session ID. The full conversation history and context are restored, so Claude picks up exactly where it left off.
# reopen the latest session in this directory
claude --continue
# choose from all past sessions in this directory
claude --resume
# resume a specific session by ID (useful in scripts)
claude --resume <session-id>
# resume the latest session and immediately run a task, headless
claude -c -p "finish the migration we were working on"
Rules of thumb:
--continue is the zero-friction option — same repo, latest thread, no IDs.
--resume is for juggling multiple threads of work in one project; the picker shows each session's age and summary.
/resume works inside a running session too — you can switch conversations without exiting.
- For automation, prefer
--resume with an explicit session ID, so the script controls exactly which conversation it picks up.
Sessions are stored per directory, so claude --continue in ~/projects/app-a will never resurrect a conversation from ~/projects/app-b.
What is Plan Mode in Claude Code?
Plan Mode is Claude Code's read-only research mode, toggled by pressing Shift+Tab (cycle until the status line shows "plan"). In it, Claude reads files and explores the codebase but cannot edit anything or run state-changing commands — instead it presents a written implementation plan you approve, edit, or reject before any code changes happen.
Shift+Tab cycles through permission modes: default → auto-accept edits → plan. You can also launch directly into it:
claude --permission-mode plan
Why plan-then-execute wins for anything non-trivial:
- Cheap course-correction. Rejecting a wrong plan costs one paragraph of feedback. Rejecting a wrong implementation costs a review, a revert, and a re-run.
- Better decomposition. Forced to write the plan first, Claude surfaces its assumptions — which files it will touch, what order, how it will verify. Wrong assumptions get caught before they become wrong code.
- Safe exploration. Plan Mode is also the right mode for "walk me through this unfamiliar codebase" sessions, since it structurally cannot modify anything.
The daily-driver heuristic: single-file tweaks go straight to default mode; anything touching three or more files, a migration, a refactor, or code you don't fully understand starts in Plan Mode. When you approve the plan, Claude switches to execution and works through it step by step. Combined with a verification command at the end ("run the tests before declaring done"), plan-then-execute is one of the biggest quality levers in the tool.
What are Claude Code slash commands?
Slash commands are instructions typed with a leading "/" inside a Claude Code session that control the tool itself rather than talking to the model — things like /init, /clear, /compact, /model, and /permissions. You can also define custom slash commands as Markdown files in .claude/commands/, which become reusable prompts for your whole team.
| Command | What it does |
/init | Scans the project and generates a CLAUDE.md memory file |
/clear | Wipes conversation history — start fresh between unrelated tasks |
/compact | Summarizes the conversation to free context window space |
/model | Switches between Claude models (Opus/Sonnet/Haiku tiers) |
/permissions | Views and edits tool allow/deny rules without restarting |
/usage | Shows your current plan usage against session and weekly limits |
/rewind | Rolls code and/or conversation back to a checkpoint (also: double-Esc) |
/resume | Switches to a different saved session |
/exit | Ends the session |
Custom commands are just Markdown. Create .claude/commands/review.md containing your review checklist prompt, and /review becomes available in every session in that repo; use $ARGUMENTS as a placeholder for anything typed after the command. Put commands in ~/.claude/commands/ to make them available across all projects. Teams commit .claude/commands/ to git so everyone shares the same workflows — deploy checklists, PR-description generators, test-writing conventions.
What does --dangerously-skip-permissions do?
The flag claude --dangerously-skip-permissions launches Claude Code with all permission prompts disabled: every file edit and shell command executes immediately, with no approval step. It exists for sandboxed automation. The risk is real — a prompt injection hidden in a file or webpage Claude reads could trigger destructive or data-exfiltrating commands with nothing between it and your shell.
claude --dangerously-skip-permissions
Often called "YOLO mode", this corresponds to the bypassPermissions permission mode. The concrete failure modes:
- Prompt injection. Claude reads untrusted content constantly — READMEs, dependencies, web pages, issue comments. Malicious instructions embedded in that content can direct an unattended agent, and without prompts nothing stops the resulting
curl or rm.
- Irreversible mistakes. Claude Code's checkpoints only track its own file edits, not changes made through bash commands — so a bad
rm -rf or git push --force has no /rewind.
- Credential exposure. Anything readable in the environment (
.env files, cloud credentials, SSH keys) is reachable.
Anthropic's own guidance: use it only in an isolated environment — a container or VM without your real credentials and ideally without open internet access. Team admins can block the flag entirely with the disableBypassPermissionsMode setting.
If what you actually want is "stop asking me about every command", you don't need the nuclear option. Auto-accept edit mode (Shift+Tab) plus an allowlist of trusted commands in /permissions removes most prompts while keeping the guardrails — see the next answer.
Why does Claude Code keep asking for permission and how do you configure it?
Claude Code asks because its default permission mode prompts before file edits and shell commands — that is the safety model working as designed. To reduce prompts, add allowlist rules with the /permissions command or in .claude/settings.json, and press Shift+Tab to switch to auto-accept-edits mode, which approves file edits automatically while still gating shell commands.
The fastest fix is at the prompt itself: when asked, choose the "always allow" option and the rule is saved. For anything systematic, put rules in .claude/settings.json (committed, shared with your team) or .claude/settings.local.json (personal, gitignored):
{
"permissions": {
"defaultMode": "acceptEdits",
"allow": [
"Bash(npm run test:*)",
"Bash(npm run lint)",
"Bash(git diff *)"
],
"deny": [
"Read(./.env)",
"Bash(curl *)"
]
}
}
Rules are evaluated deny → ask → allow, and deny always wins — so you can safely broaden the allowlist while hard-blocking secrets and risky commands. The main modes:
| Mode | Behavior |
default | Prompts on first use of each tool/command |
acceptEdits | Auto-approves file edits; still prompts for shell commands |
plan | Read-only; Claude researches and plans, changes nothing |
bypassPermissions | No prompts at all (the --dangerously-skip-permissions mode) |
The sustainable setup for daily work: acceptEdits as the default mode, a growing allowlist of the read-only and test commands you trust, and explicit deny rules for .env files and network commands. Run /permissions anytime to see every active rule and which settings file it came from.
How do you use Claude Code effectively?
Use Claude Code effectively by maintaining a good CLAUDE.md, starting non-trivial work in Plan Mode, working in small steps that end with a verification command, running /clear between unrelated tasks to keep context clean, and delegating research-heavy side work to subagents. The pattern behind all five: give Claude tight scope and a way to prove it succeeded.
The expert checklist, in rough order of impact:
- Invest in CLAUDE.md. Build commands, test commands, architecture notes, conventions, things Claude got wrong before. It's loaded every session; every line you add is a correction you never make again. Keep it under a page — bloat costs tokens on every turn.
- Plan before executing. Shift+Tab into Plan Mode for anything multi-file. Approving a plan is minutes; reverting a bad implementation is an afternoon.
- Demand verification, not vibes. Phrase tasks with a finish line: "make the failing test pass", "typecheck must be green". Claude will loop on a verifiable goal until it's actually done.
- Manage context deliberately.
/clear between unrelated tasks, /compact at natural break points, /rewind instead of arguing when a turn goes sideways. A polluted context degrades every subsequent answer.
- Use subagents for bulk side-work. Ask Claude to spin off subagents for codebase exploration, log analysis, or mass mechanical changes — the verbose output stays in the subagent's context and only the summary returns to yours.
- Commit constantly. Git is your real undo. Small commits after each verified step make any Claude mistake a one-command revert.
Everything else — custom slash commands, hooks, MCP servers, Skills — compounds on top of these fundamentals, and none of it rescues a session with vague scope and no verification.
05Agents, Skills, MCP & plugins
This is where Claude Code stops being a chat-in-a-terminal and becomes a platform: subagents and agent teams for parallel work, Skills for reusable expertise, MCP servers for external tools, hooks for automation, and a plugin ecosystem that bundles all of it.
What are Claude Code agents and subagents?
Subagents are specialized helper instances that Claude Code spawns via its Task tool to handle a scoped job — exploring a codebase, reviewing a diff, running tests — in a separate, isolated context window. Custom subagents are defined as Markdown files in .claude/agents/ (project) or ~/.claude/agents/ (personal), each with its own system prompt, tool permissions, and model.
The isolation is the point. A subagent can read fifty files and run twenty commands, and only its final summary returns to your main conversation — the noise stays in the subagent's context. That keeps your primary session's context window clean on long tasks.
A custom agent is a Markdown file with YAML frontmatter:
# .claude/agents/code-reviewer.md
---
name: code-reviewer
description: Reviews diffs for correctness bugs and security issues.
Use proactively after any code change.
tools: Read, Grep, Glob, Bash
model: sonnet
---
You are a senior code reviewer. Check the current diff for logic
errors, unhandled edge cases, and injection or authz issues.
Report findings by severity with file:line references.
Key details:
- The
description field tells Claude when to delegate automatically; you can also invoke an agent explicitly ("use the code-reviewer agent").
tools restricts what the agent can touch — a review agent with read-only tools cannot accidentally edit files.
model lets you tier costs: route mechanical work to Haiku or Sonnet while your main session runs Opus.
- Run
/agents inside Claude Code to create, edit, and manage agents interactively.
Claude Code also ships built-in agents (a general-purpose worker and a fast read-only Explore agent). Subagents cannot spawn other subagents, and they report only to the session that launched them — for peer-to-peer coordination you need agent teams, covered next.
What are Claude Code agent teams?
Agent teams are an experimental Claude Code feature (shipped in early 2026) that runs multiple full Claude Code sessions in parallel: one session acts as team lead, spawning teammates that each get their own context window and can message each other directly. Enable them with the CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS environment variable, then describe the team you want in plain language.
The difference from subagents is communication topology. Subagents only report back to the session that spawned them. Teammates in an agent team coordinate peer-to-peer through direct messages and a shared task list — one can flag a discovery mid-task and another can act on it without the lead relaying every message.
# settings.json or shell
{ "env": { "CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1" } }
# then, in the session:
"Spawn three teammates: one audits auth, one audits the API
layer, one writes the report. Coordinate and merge findings."
Practical guidance from daily use:
- Best fits: parallel research and review, and features that decompose into independent modules. Give each teammate exclusive ownership of its files — two agents editing the same file is how you get merge chaos.
- Cost: every teammate is a full context window, so a team burns tokens several times faster than one session. For routine tasks, stay single-session.
- Manual alternative: before agent teams existed, the standard pattern was launching several
claude sessions yourself, each in its own git worktree so parallel work never collides on the same checkout. That orchestrator-and-worktrees pattern still works and gives you more control:
git worktree add ../myapp-auth feature/auth
cd ../myapp-auth && claude
Full docs: code.claude.com/docs/en/agent-teams.
What are Claude Code Skills?
Skills are reusable instruction packages for Claude Code: folders containing a SKILL.md file (YAML frontmatter plus Markdown instructions) and optional scripts and reference files. They live in ~/.claude/skills/ (personal) or .claude/skills/ (project). Claude loads a skill's full instructions only when a task matches its description, so hundreds of skills cost almost nothing until used.
Think of a Skill as expertise on demand. A CLAUDE.md file is always in context; a Skill loads lazily. At startup Claude scans only each skill's name and description (a few dozen tokens per skill). When your request matches a description, the full SKILL.md — and any files it references — gets pulled in. Anthropic calls this progressive disclosure, and it is why a well-written description matters more than anything else in the file.
What a skill folder can contain:
SKILL.md — required; frontmatter plus instructions (keep it under ~500 lines).
scripts/ — executable code Claude can run instead of re-deriving logic.
references/ — detailed docs loaded only when needed.
assets/ — templates and output files.
Useful frontmatter controls: disable-model-invocation: true makes a skill user-only (good for side-effect commands like a deploy), user-invocable: false makes it Claude-only background knowledge, allowed-tools restricts tool access, and context: fork runs the skill in an isolated subagent that returns just a summary.
Skills are also an open standard: the same Agent Skills format is supported by OpenAI Codex CLI, Cursor, Gemini CLI, and GitHub Copilot, so one skill folder ports across tools. Anthropic publishes open-source examples at github.com/anthropics/skills. Docs: code.claude.com/docs/en/skills.
How do you add Skills to Claude Code?
Create a folder under ~/.claude/skills/ (personal, all projects) or .claude/skills/ (this project, shareable via git), and put a SKILL.md inside it with YAML frontmatter containing a name and description. The folder name becomes a slash command, and Claude auto-loads the skill whenever a task matches the description. No restart needed — edits take effect in a running session.
Minimal working example:
mkdir -p ~/.claude/skills/changelog
# ~/.claude/skills/changelog/SKILL.md
---
name: changelog
description: Write a changelog entry from recent git commits.
Use when the user asks to update or generate a changelog.
---
1. Run `git log --oneline -20` to collect recent commits.
2. Group changes under Added / Changed / Fixed.
3. Append the entry to CHANGELOG.md in Keep a Changelog format.
Now /changelog works as a command, and Claude will also reach for the skill on its own when you say "update the changelog." Three ways skills get onto a machine:
| Method | Location | Best for |
| Personal folder | ~/.claude/skills/ | Your own workflows, every project |
| Project folder | .claude/skills/ (committed) | Team conventions shared through the repo |
| Plugins | /plugin install ... | Distributing skill bundles at scale |
Debugging tips: run /skills to see what is installed, and /doctor if a skill is not appearing or triggering. The most common failure is a vague description — write it as "does X; use when the user asks Y," because that sentence is the only thing Claude sees when deciding whether to load the skill.
What are Claude Code plugins and the plugin marketplace?
Plugins are installable bundles that can package Skills, slash commands, subagents, hooks, and MCP servers into one unit. Marketplaces are catalogs of plugins: Anthropic's official marketplace is built into Claude Code, and anyone can host their own from a git repo. You browse and install with the /plugin command — one install can wire up an entire workflow.
A plugin is a directory with a .claude-plugin/plugin.json manifest plus optional commands/, agents/, skills/, hooks/, and an .mcp.json. That composition is what makes plugins more than skill packs — a single PR-review plugin can ship a review agent, a /review-pr command, and the GitHub MCP connection it depends on.
Common commands:
# browse and install from the built-in official marketplace
/plugin
/plugin install pr-review-toolkit@claude-plugins-official
# add Anthropic's community marketplace (vetted third-party plugins)
/plugin marketplace add anthropics/claude-plugins-community
# add any git-hosted marketplace
/plugin marketplace add your-org/your-plugins
The marketplace landscape as of mid-2026:
| Marketplace | What it is | How you get it |
| claude-plugins-official | Anthropic-managed directory: LSP/code-intelligence plugins, security-guidance, commit-commands, pr-review-toolkit, agent-sdk-dev | Available by default; browse via /plugin or claude.com/plugins |
| anthropics/claude-plugins-community | Third-party plugins that passed Anthropic's automated validation; each pinned to a commit SHA | /plugin marketplace add anthropics/claude-plugins-community |
| Self-hosted | Any repo or URL with a marketplace.json — teams use this for internal tooling | /plugin marketplace add <repo-or-url> |
If an install reports "not found in any marketplace," run /plugin marketplace update claude-plugins-official to refresh the catalog. Docs: code.claude.com/docs/en/discover-plugins.
How do you add an MCP server to Claude Code?
Run claude mcp add from your terminal. For a local stdio server: claude mcp add <name> -- <command>. For a remote server: claude mcp add --transport http <name> <url>. Servers can be scoped to you (--scope user), one project (default, local), or shared with your team via a checked-in .mcp.json file (--scope project).
MCP (Model Context Protocol) is the open standard — originally created by Anthropic — that lets Claude Code call external tools: databases, browsers, issue trackers, SaaS APIs. Claude Code is an MCP client; each server you add contributes tools Claude can invoke.
# local stdio server (runs as a subprocess)
claude mcp add playwright -- npx @playwright/mcp@latest
# remote HTTP server (the standard for hosted services)
claude mcp add --transport http sentry https://mcp.sentry.dev/mcp
# HTTP with an auth header (e.g. a GitHub PAT)
claude mcp add --transport http github \
https://api.githubcopilot.com/mcp \
-H "Authorization: Bearer YOUR_GITHUB_PAT"
# manage what you have
claude mcp list
claude mcp remove playwright
Scopes:
- local (default) — just you, just this project.
- user (
--scope user) — you, in every project.
- project (
--scope project) — writes .mcp.json at the repo root, committed so teammates get the same servers. Reference tokens as environment variables in that file; never commit secrets inline.
Two practical notes: SSE transport is deprecated in favor of streamable HTTP (if --transport sse fails, retry with --transport http on the same URL), and remote servers that need OAuth will pop a browser login the first time Claude connects — /mcp inside a session shows connection status and lets you authenticate or disable servers. Docs: code.claude.com/docs/en/mcp.
What are the best MCP servers for Claude Code?
The most useful MCP servers for Claude Code as of mid-2026 are GitHub (issues, PRs, repo automation), Playwright and Chrome DevTools (browser automation and debugging), Context7 (up-to-date library docs), Sentry (production errors), database servers like Postgres, and Slack. Most developers need only four to eight servers — installing dozens degrades tool selection and wastes context.
| Server | What Claude gains | Install |
| GitHub | Read issues, review PRs, search repos, act as a contributor | claude mcp add --transport http github https://api.githubcopilot.com/mcp -H "Authorization: Bearer <PAT>" |
| Playwright | Drive a browser via accessibility snapshots — verify UI changes end to end | claude mcp add playwright -- npx @playwright/mcp@latest |
| Chrome DevTools | Debug a real Chrome: console, network, performance traces, Core Web Vitals | claude mcp add chrome-devtools -- npx chrome-devtools-mcp@latest |
| Context7 | Current, version-accurate library documentation instead of stale training data | claude mcp add --transport http context7 https://mcp.context7.com/mcp |
| Sentry | Stack traces and error trends — from production alert to draft fix | claude mcp add --transport http sentry https://mcp.sentry.dev/mcp |
| Postgres / DB | Query schemas and data for debugging and migrations | varies by database vendor |
| Slack | Read channels, post updates from long-running sessions | via connector or team MCP |
Three hard-won rules. First, Claude Code does not need a filesystem MCP server — file reads, edits, and shell access are built in; that server matters for other MCP clients. Second, prefer a first-party CLI when one exists: gh for GitHub is often cheaper in tokens than the dozens of tool schemas the GitHub MCP server loads. Third, keep the active tool count low — as the number of visible tools climbs, models get worse at picking the right one. Claude Code's tool-search lazy loading helps, but curation beats mitigation.
Skills vs slash commands vs subagents: when do you use each?
The difference is who pulls the trigger. Skills auto-invoke when your request matches their description — Claude decides. Slash commands are typed by you — you decide. Subagents are isolated workers Claude spawns in their own context window for parallel or research-heavy jobs. Use a Skill for reusable know-how that should load automatically (you can bundle reference files and scripts with it); a slash command for a repeatable procedure you want to fire explicitly; a subagent when you need concurrency or a clean context. They compose — a slash command can spawn a subagent — and note that as of mid-2026 custom commands and Skills have merged, so a file in .claude/commands/ and a skill in .claude/skills/ both create a slash command.
How do you connect Claude Code to GitHub?
Three ways, in order of setup effort: use the gh CLI (if it is installed and authenticated, Claude Code uses it immediately — no configuration); add the GitHub MCP server for structured API access; or run /install-github-app to set up GitHub Actions so you can tag @claude in any issue or PR and Claude works in CI.
1. The gh CLI (start here). Claude Code shells out to any CLI you have. After gh auth login, Claude can create PRs, read issues, and check CI runs with zero extra config — and CLI calls cost fewer tokens than MCP tool schemas:
brew install gh && gh auth login
2. GitHub MCP server. Structured tools for issues, PRs, and cross-repo search; supports a read-only lockdown header for safety:
claude mcp add --transport http github \
https://api.githubcopilot.com/mcp \
-H "Authorization: Bearer YOUR_GITHUB_PAT"
3. GitHub Actions (@claude in PRs and issues). Run this inside Claude Code:
/install-github-app
It installs the Claude GitHub App on your repo (you need admin rights), adds the workflow file, and stores your credential as a repo secret — either ANTHROPIC_API_KEY or, for Pro/Max subscribers, a CLAUDE_CODE_OAUTH_TOKEN generated with claude setup-token. After setup, comment @claude fix the failing test in auth.spec.ts on any issue or PR and Claude implements the change and pushes a branch. Manual setup and the action source live at github.com/anthropics/claude-code-action; docs at code.claude.com/docs/en/github-actions.
In practice the three layers stack: gh for everyday local work, MCP when you want structured multi-repo tooling, Actions for asynchronous work that starts from a GitHub comment.
What are Claude Code hooks?
Hooks are shell commands that Claude Code runs automatically at lifecycle events — before a tool call (PreToolUse), after one (PostToolUse), when Claude finishes a turn (Stop), on session start, and more. Configured in settings.json, they turn suggestions into guarantees: auto-format every edited file, block dangerous commands, or refuse to let Claude stop until tests pass.
The difference from CLAUDE.md instructions: an instruction is something Claude usually follows; a hook is something the harness always executes. Events fall into three cadences — per session (SessionStart, SessionEnd), per turn (UserPromptSubmit, Stop), and per tool call (PreToolUse, PostToolUse).
A PostToolUse hook that formats every file Claude writes, in .claude/settings.json (the hook reads the event JSON from stdin and extracts the file path with jq):
{
"hooks": {
"PostToolUse": [
{
"matcher": "Write|Edit",
"hooks": [
{
"type": "command",
"command": "jq -r '.tool_input.file_path' | xargs npx prettier --write"
}
]
}
]
}
}
How control flow works:
- Hooks receive JSON about the event on stdin (tool name, arguments, file paths).
- Exit 0 = proceed. Exit 2 = block: a PreToolUse hook exiting 2 cancels the tool call and feeds stderr back to Claude; a Stop hook exiting 2 forces Claude to keep working (check the
stop_hook_active field to avoid infinite loops).
- PreToolUse hooks can also return structured JSON with a
permissionDecision of allow, deny, or ask.
- Project hooks live in
.claude/settings.json (shared via git); personal hooks in ~/.claude/settings.json. The interactive /hooks command walks you through creating one.
Classic uses: blocking edits to .env files, running the linter after every change, requiring a green test suite before Claude declares a task done, and sending a desktop notification when a long session needs input. Reference: code.claude.com/docs/en/hooks.
How do you create custom slash commands in Claude Code?
Create a Markdown file in .claude/commands/ (project) or ~/.claude/commands/ (personal). The filename becomes the command — fix-issue.md creates /fix-issue — and the file body is the prompt that runs. Use $ARGUMENTS inside the file to receive whatever you type after the command.
Full example:
# .claude/commands/fix-issue.md
Find and fix GitHub issue #$ARGUMENTS.
1. Run `gh issue view $ARGUMENTS` to read the issue.
2. Locate the relevant code and implement a fix.
3. Write a test that reproduces the bug, confirm it passes.
4. Commit with message "fix: resolve #$ARGUMENTS".
Then in any session:
/fix-issue 123
Useful extras:
- Positional arguments:
$1, $2, etc. split the arguments, when one blob is not enough.
- Namespacing: subdirectories create prefixes —
.claude/commands/git/sync.md becomes /git:sync.
- Frontmatter: optional YAML at the top can set a
description (shown in the / autocomplete menu) and allowed-tools.
- Shell context: lines like
!`git status` execute before the prompt runs and inline their output, so a command can gather live state.
As of 2026, custom commands and Skills have converged: .claude/commands/deploy.md and .claude/skills/deploy/SKILL.md both create /deploy and behave the same, with the skill format adding supporting-file folders and invocation-control frontmatter. Rule of thumb — single-file prompt, use commands/; anything with scripts, reference docs, or auto-trigger behavior, make it a Skill.
Can you use Claude Code with an API key instead of a subscription?
Yes. Set the ANTHROPIC_API_KEY environment variable (or log in with Anthropic Console credentials) and Claude Code bills per token at standard API rates instead of using a Claude Pro or Max subscription. Caution: if that variable is set, Claude Code prefers it over your subscription and silently bills the API key — check with /status.
export ANTHROPIC_API_KEY=sk-ant-...
claude
When each billing path wins:
| Path | Cost model | Best for |
| Claude Pro | $20/month (~$17/month billed annually), limited usage | Light daily coding sessions |
| Claude Max 5x / 20x | $100 / $200 per month, 5x or 20x Pro's usage bucket | Heavy daily use — power users report large savings vs. raw API cost |
| API key (Console) | Pay per token, no session caps beyond your credit balance | CI/CD, headless claude -p automation, the Claude Agent SDK, occasional users under ~$10–20/month of usage |
Rules of thumb from running both:
- Interactive coding → subscription. Subscription plans are flat-rate; sustained agentic work on the API adds up fast.
- Automation → API key. Scripts and CI should never depend on your personal session limits, and Anthropic has signaled that programmatic Agent SDK usage will move to separate, API-style billing (a credit-based change announced for June 2026 was paused before taking effect — check current policy). For GitHub Actions specifically, Pro/Max users can alternatively generate an OAuth token with
claude setup-token.
- Audit your shell. A stray
ANTHROPIC_API_KEY in .zshrc, a .env file, or a devcontainer will override your subscription without warning. Run /status inside Claude Code to confirm which account is active; unset the stray variable and sign back in with /login using your Pro/Max credentials to stay on subscription billing.
You can hold both — many developers run their terminal sessions on Max and keep a separate Console key for CI.
06Claude Code vs the alternatives
Straight comparisons, no vendor spin: how Claude Code stacks up against OpenAI Codex, Cursor, GitHub Copilot, Gemini CLI, Google Antigravity, and the open-source field — plus which IDE and terminal to run it in.
Claude Code vs Codex vs Cursor vs Copilot vs the field: at a glance
At a glance: Claude Code has the deepest agent harness but no free tier; OpenAI Codex, Gemini CLI, and OpenCode offer a free or open-source on-ramp; Cursor and GitHub Copilot are editor-first; Google Antigravity and Claude Cowork are broader platforms. Here is every tool this guide compares, side by side — drill into each below.
| Tool | Type | Open source | Entry price | Best for |
| Claude Code | Terminal/IDE/web agent | No | $20 (Pro) | Delegating whole tasks; deepest harness |
| OpenAI Codex | Agent (CLI + cloud) | CLI yes (Apache-2.0) | Free / $8 Go | Budget entry; cloud/parallel tasks |
| Cursor | AI-native IDE | No | Free / $20 | Hands-on editing, visual diffs |
| GitHub Copilot | In-editor assistant | No | $10 | Unmetered autocomplete while you type |
| Gemini CLI | Terminal agent | Yes (Apache-2.0) | Was free → Antigravity | Free large-context (winding down for consumers) |
| Google Antigravity | Agent platform | No | Free / $20 | Free on-ramp; managing parallel agents |
| OpenCode | Terminal agent | Yes (MIT) | Free (pay per-token) | Model freedom, local models, no lock-in |
| Claude Cowork | Knowledge-work agent | No | In paid Claude plans | Documents, data, research (not coding) |
Claude Code vs OpenAI Codex: which is better?
Claude Code is the stronger agent harness: CLAUDE.md project memory, hooks, subagents, Skills, plugins, and MCP support give it the deepest customization stack among mainstream coding agents. OpenAI Codex is cheaper to start — it has a free tier and an $8/month Go plan — and its CLI is open source. For long, multi-step engineering tasks, most heavy users pick Claude Code; for budget flexibility, Codex.
| Claude Code | OpenAI Codex |
| Maker | Anthropic | OpenAI |
| Models | Latest Claude models (Opus/Sonnet/Haiku tiers, switch with /model) | GPT-5.x Codex family (gpt-5.3-codex as of mid-2026, plus the Codex Spark low-latency research preview on Pro) |
| Interfaces | CLI, VS Code + JetBrains extensions, desktop app, web (claude.ai/code) | CLI, IDE extension, cloud tasks (chatgpt.com/codex) |
| Open source | No (bundled npm package; GitHub repo is issues/docs only) | CLI is open source (Rust, Apache-2.0) |
| Pricing | Claude Pro ($20/mo), Max 5x ($100), Max 20x ($200), Team/Enterprise, or API pay-per-token | Free, Go ($8), Plus ($20), Pro 5x ($100), Pro 20x ($200), Business ($25/user, annual billing); token-based credits since April 2026 |
| Harness depth | CLAUDE.md, hooks, subagents, Skills, plugins, MCP, Agent SDK, Plan Mode | AGENTS.md config, MCP support, strong cloud/parallel task execution |
The pricing ladders converged in 2026: OpenAI added its $100/month Pro 5x tier on April 9, 2026 — widely read as an answer to Claude Max 5x — so the top tiers now mirror each other. The real differences are the harness and the models. Claude Code's extension points — hooks that fire on tool events, SKILL.md folders, custom slash commands, plugin marketplaces — make it the better platform to build a durable workflow on. Codex counters with an open-source CLI you can audit and a genuinely usable free tier. Try both against your own repo:
curl -fsSL https://claude.ai/install.sh | bash # Claude Code
npm install -g @openai/codex # Codex CLI
Claude Code vs Cursor: which should you use?
They're different categories: Claude Code is a terminal agent you delegate whole tasks to; Cursor is an AI-native IDE built around inline editing and Tab completions. Choose Claude Code for long autonomous tasks, refactors, and scripting; choose Cursor for hands-on-keyboard editing with instant visual diffs. Many developers use both — Claude Code running inside Cursor's integrated terminal.
| Claude Code | Cursor |
| Type | Terminal agent — delegate whole tasks | AI-native IDE — inline editing + Tab completions |
| Models | Latest Claude models (/model) | First-party Composer for routine work; frontier models incl. Claude from a usage pool |
| Interfaces | CLI, VS Code + JetBrains, desktop, web | The editor (also ships a CLI now) |
| Pricing | Pro $20, Max 5x $100, Max 20x $200, or API | Hobby free, Pro $20, Pro+ $60, Ultra $200, Teams $40/user (~$32 annual) |
| Best for | Long autonomous tasks, refactors, CI, scripting agents | Hands-on editing, visual diff review, staying in flow |
Cursor's plans as of mid-2026: Hobby (free), Pro ($20/month), Pro+ ($60), Ultra ($200), Teams from $40/user/month ($32/seat billed annually). Its first-party Composer models make routine "Auto" work cheap, while frontier models (including Claude) draw from a usage pool. Cursor also ships its own CLI now, but its center of gravity remains the editor.
- Cursor wins when you want to stay in flow: Tab completions, multi-file inline edits you review visually, and quick model switching per request.
- Claude Code wins when you want delegation: "fix these 14 failing tests," Plan Mode (Shift+Tab) before big changes, headless runs in CI (
claude -p), subagents, and CLAUDE.md memory that persists per project.
- Both together is a common setup: Cursor as the editor, Claude Code in its terminal panel doing the agentic heavy lifting. One subscription doesn't cover the other, so this costs two plans — typically $40/month combined at the entry tiers.
If you only pay for one: developers who live in the terminal or run agents unattended should take Claude Code; developers who primarily type code themselves should take Cursor.
Claude Code vs GitHub Copilot: what's the difference?
GitHub Copilot is primarily an in-editor assistant — unlimited autocomplete plus chat and an agent mode metered by AI Credits — starting at $10/month. Claude Code is a full autonomous agent that plans, edits multiple files, runs commands, and verifies its work. Copilot is the cheaper complement while you type; Claude Code replaces larger chunks of the work itself.
| Claude Code | GitHub Copilot |
| Type | Full autonomous agent (plans, edits, runs, verifies) | In-editor assistant (autocomplete + chat + agent mode) |
| Pricing | Pro $20, Max 5x $100, Max 20x $200, or API | Pro $10, Pro+ $39, Business $19/user, Enterprise $39/user, Max $100 |
| Billing model | Session + weekly usage on subscription, or per-token API | Usage-based AI Credits since Jun 1 2026; code completions stay unmetered |
| Harness depth | CLAUDE.md, hooks, subagents, Skills, plugins, MCP | Thinner: no hooks/Skills/subagents/CLAUDE.md equivalent |
| Best for | Tasks you'd hand a junior engineer | Unmetered autocomplete while you type |
Copilot moved to usage-based billing on June 1, 2026: every plan (Pro $10, Pro+ $39, Business $19/user, Enterprise $39/user, plus a $100 Max tier) now includes monthly AI Credits consumed by chat, agent mode, code review, the Copilot cloud agent, and Copilot CLI. Code completions and next-edit suggestions stay unmetered — that's still Copilot's core value. Some heavy agentic users reported burning through a month's credits in days after the switch, which is worth knowing if you planned to use Copilot as your primary agent.
Copilot CLI brings agentic tasks to the terminal, but its harness is thinner than Claude Code's — no equivalent of hooks, Skills, subagents, or a CLAUDE.md-style project memory with the same depth. In practice the tools coexist well: Copilot for autocomplete inside VS Code, Claude Code for the tasks you'd otherwise hand a junior engineer. If your team already pays for Copilot Business, adding Claude Code per-developer (Pro at $20/month or API billing) is a common 2026 stack rather than an either/or decision.
Claude Code vs Gemini CLI: how do they compare?
Gemini CLI is Google's open-source (Apache-2.0) terminal agent with a generous free tier — but Google is winding it down for consumers: as of June 18, 2026, free-tier, AI Pro, and AI Ultra users are migrated to Antigravity CLI. Claude Code is closed source and never free, but it is a more mature, actively consolidated harness with hooks, subagents, Skills, and MCP.
| Claude Code | Gemini CLI |
| Type | Mature, consolidated closed-source terminal harness | Open-source (Apache-2.0) terminal agent |
| Open source | No | Yes (Apache-2.0) |
| Pricing | Pro $20 / Max $100 / Max $200 — no free tier | Had a free tier; consumer tiers migrated to Antigravity CLI Jun 18 2026; still runs on a paid Gemini API key |
| Context | Large context on the latest Claude models | 1M-token context on cheap Flash models |
| Best for | Model quality on hard agentic coding; stable, un-reorganized ecosystem | Free/cheap large-context work (being wound down for consumers) |
Gemini CLI's pitch was compelling: install with npm install -g @google/gemini-cli, sign in with a Google account, and get free daily requests against Gemini models with a 1M-token context window. It also supports MCP and is fully open source, so the community could extend and audit it.
The 2026 reality changed the calculus. Google unified its coding tools under the Antigravity platform, and Gemini CLI stopped serving requests for individual/consumer tiers on June 18, 2026 — those users are directed to Antigravity CLI instead. Enterprise access via Gemini Code Assist licenses continues, and the old CLI still runs against a paid Gemini API key, but if you're an individual developer evaluating "Claude Code vs Gemini CLI" today, the honest comparison is really Claude Code vs Antigravity (next question).
Where Gemini-based tooling still wins: price (free tiers exist; Claude Code has none) and huge context on cheap Flash models. Where Claude Code wins: model quality on hard agentic coding, a stable product identity, and an ecosystem — CLAUDE.md, plugins, the Agent SDK, GitHub Actions integration — that hasn't been reorganized out from under its users.
Claude Code vs Google Antigravity: what's the difference?
Google Antigravity is an agent-first development platform — a desktop app, IDE, CLI, and SDK — that succeeded Gemini CLI and Gemini Code Assist for consumers in 2026. It runs Gemini models and, notably, Claude models too. Claude Code is a single focused agent with a deeper customization layer. Antigravity offers a free tier; Claude Code does not.
| Claude Code | Google Antigravity |
| Type | Single focused agent with a deep customization layer | Agent-first platform (desktop app, IDE, CLI, SDK) |
| Models | Latest Claude models, first-party | Gemini 3.5 Flash default; also Claude Opus/Sonnet selectable |
| Pricing | Pro $20 / Max $100 / Max $200 — no free tier | Free tier; AI Pro $20, AI Ultra $100, top tier $200 |
| Harness depth | Hooks, Skills, subagents, MCP, Agent SDK, Plan Mode | Multi-agent manager UI; quota metering in opaque AI credits |
| Best for | Predictable limits, strongest Claude models, deep harness | Free on-ramp, Workspace alignment, managing parallel agents |
Antigravity launched in late 2025 as Google's Cursor-style agentic IDE and became a full platform with Antigravity 2.0 at I/O 2026 (May 19, 2026): a standalone app for macOS/Linux/Windows, the original IDE, an Antigravity CLI, and an SDK. It's powered by Gemini 3.5 Flash by default and also offers Claude Opus and Sonnet as selectable models — a rare case of Google shipping a competitor's models inside its own tool.
Pricing rides Google's consumer AI plans: a rate-limited free tier, Google AI Pro at $20/month, a new $100 AI Ultra tier added at I/O 2026 (roughly 5x Pro quotas), and a $200 top tier — cut from $249.99 — at roughly 20x, a ladder that now mirrors Claude's Pro/Max pricing. The recurring complaint through mid-2026 is quota opacity: overage is metered in AI credits whose token-conversion rates aren't publicly documented, and users have reported multi-day lockouts when quotas run out.
Pick Antigravity if you want a free on-ramp, Google Workspace alignment, or an agent-manager UI over multiple parallel agents. Pick Claude Code if you want predictable session-based limits, first-party access to the strongest Claude models, and a harness (hooks, Skills, subagents, MCP, Agent SDK) you can build a long-term workflow on.
Claude Code vs OpenCode: which terminal agent is better?
OpenCode is the leading open-source alternative to Claude Code: an MIT-licensed terminal agent that connects to 75+ model providers, including local models via Ollama. The tool is free; you pay only for the model. Claude Code is closed source and subscription-based but ships a deeper harness and first-party tuning for Claude models. Choose OpenCode for model freedom, Claude Code for the most capable integrated package.
| Claude Code | OpenCode |
| Type | Closed-source, subscription terminal agent | MIT open-source terminal agent (by Anomaly/SST) |
| Open source | No | Yes (MIT) |
| Models | First-party Claude models, deeply tuned | 75+ providers, incl. local via Ollama; Claude only via API since Mar 2026 |
| Pricing | Pro $20 / Max $100 / Max $200 | Free software; pay per-token for the model you pick |
| Best for | Most capable integrated package, first-party Claude tuning | Model freedom, local models, auditable tooling, no lock-in |
OpenCode (maintained by Anomaly, the team behind SST) matches a surprising amount of Claude Code's surface: a polished TUI, build/plan agents toggled with Tab (mirroring Plan Mode), subagents, and MCP support via opencode mcp add. Its optional Zen gateway sells curated coding models at cost, pay-as-you-go. Install and point it at any provider:
npm i -g opencode-ai
Two honest caveats. First, Anthropic began blocking Claude Pro/Max OAuth tokens in third-party tools on January 9, 2026, formalized the ban in its terms that February, and OpenCode removed its built-in Anthropic integration in March — so running Claude models in OpenCode means per-token API billing (directly or via a gateway), which for heavy use usually costs more than a Max subscription inside Claude Code. Second, Claude Code's ecosystem — Skills, plugins and marketplaces, the Agent SDK, checkpoints/rewind, GitHub Actions — is broader and moves with each Claude model release.
OpenCode is the right call if you refuse vendor lock-in, want to mix frontier and local models, or need to audit your tooling. If you've already decided Claude models are your daily driver, Claude Code extracts more from them.
Claude Code vs Claude Cowork: what's the difference?
Same agentic engine, different audience. Claude Code is Anthropic's coding agent for developers, run from the terminal, IDE, or web. Claude Cowork, launched January 2026, wraps that architecture in the Claude desktop app for non-coding knowledge work — documents, files, research, spreadsheets — with no terminal required. Both are included in paid Claude plans (Pro, Max, Team premium seats, Enterprise).
| Claude Code | Claude Cowork |
| Audience | Developers | Non-coding knowledge workers (launched Jan 2026) |
| Interface | Terminal, IDE, or web | Claude desktop app — no terminal required |
| Works on | Git repos, tests, CI, MCP servers, hooks | Local files & folders; projects + scheduled tasks |
| Pricing | Included in paid Claude plans | Included in paid Claude plans (shares the usage pool) |
| Best for | Writing and shipping code | Documents, data, research, spreadsheets |
Anthropic built Cowork after noticing its own marketing and data teams were bypassing chat to use Claude Code for multi-step work. Cowork gives them the same delegation model — describe an outcome, step away, come back to finished work — operating on local files and folders instead of a git repo. It adds projects (persistent workspaces with their own files, instructions, and memory) and scheduled tasks for recurring work. It launched for Max subscribers on January 12, 2026, opened to Pro within the week and to Team/Enterprise on January 23, reached Windows on February 10, 2026, and gained a Linux beta in June 2026.
How to choose:
- You write code → Claude Code. Repos, tests, CI, terminals, MCP servers, hooks.
- You work in documents, data, and files → Cowork. Formatting reports, organizing folders, synthesizing research, building spreadsheets.
- You do both → they share your plan's usage pool, so one subscription covers both. Note that Cowork tasks burn usage faster than standard chat.
They are complements, not competitors — the search comparison exists mostly because the names are similar.
What are the best open-source alternatives to Claude Code?
The strongest open-source alternatives as of mid-2026 are OpenCode (MIT terminal agent, 75+ providers), Aider (git-native pair programmer), Roo Code and Cline (VS Code agent extensions), and OpenAI's Codex CLI (Apache-2.0). All are bring-your-own-key: the software is free, and you pay whichever model provider you choose, including free local models via Ollama.
- OpenCode — the closest drop-in replacement: terminal TUI, plan/build agents, subagents, MCP support, any model. The default recommendation.
- Aider — the veteran Python CLI pair programmer; maps your repo, makes surgical edits, and auto-commits each change with clean messages. Best for git-disciplined workflows.
- Roo Code — a VS Code extension agent (forked from Cline) with configurable modes (code, architect, debug) and BYO key. Best if you want an agent inside the editor, not a terminal.
- Cline — the widely used VS Code agent Roo forked from; plan/act workflow, MCP support, transparent token spend.
- Codex CLI — OpenAI's Rust CLI is open source even though the models aren't; auditable and scriptable.
- Gemini CLI — Apache-2.0 and capable, but Google migrated consumer tiers to the closed Antigravity CLI in June 2026, so its future is enterprise-shaped.
- OpenClaw — the viral MIT personal-assistant agent (ex-Clawdbot/Moltbot). Adjacent rather than equivalent: it drives tasks from chat apps like WhatsApp and Telegram, and has documented prompt-injection and third-party-skill security risks — not a production coding agent.
Claude Code itself remains closed source; the npm package ships bundled, minified JavaScript, and the public GitHub repo carries only issues, docs, and the changelog.
Cursor vs Claude Code vs Codex: which should you pick?
Pick by working style: Cursor if you write most code yourself and want the best AI-native editor; Claude Code if you delegate whole tasks to an agent and live in the terminal; Codex if you want an agent with a free tier, cheaper entry plans, and an open-source CLI. All three cost $20/month at the standard tier and $200 at the top.
| Your situation | Best pick | Why |
| Hands-on editing, visual diff review, Tab completions | Cursor | The editor experience is the product; Composer model makes routine work cheap |
| Long autonomous tasks, refactors, CI automation, scripting agents | Claude Code | Deepest harness: CLAUDE.md, hooks, subagents, Skills, headless claude -p |
| Budget-first, or want to audit your tooling | Codex | Free tier + $8 Go plan; open-source CLI; strong cloud task execution |
| Team standardizing on one tool | Claude Code or Cursor | Claude Code for terminal-centric teams; Cursor Teams ($40/user, ~$32 annual) for editor-centric ones |
| Maximum capability, cost secondary | Claude Code Max + Cursor | The common 2026 power stack: Cursor as editor, Claude Code in its terminal |
Two practical notes. First, these categories are converging — Cursor ships a CLI, Codex ships an IDE extension, Claude Code ships a desktop app and web version — so evaluate the core loop you'll actually use daily, not the feature checklist. Second, all three offer monthly plans; run your real workload on each for a week before committing a team. Model quality shifts every few months, but your workflow investment (rules files, hooks, memory) compounds in whichever tool you commit to.
What is the best IDE and terminal to pair with Claude Code?
VS Code with the official Claude Code extension is the most popular pairing — it shows diffs in the editor and shares your workspace context. JetBrains IDEs have an official extension too. For the terminal itself, iTerm2 or Ghostty on macOS, Windows Terminal on Windows, and WezTerm or Kitty cross-platform all render Claude Code's interface well; run /terminal-setup to configure Shift+Enter for multi-line input.
| Layer | Recommended | Notes |
| IDE | VS Code + Claude Code extension | Inline diff review, selection context; extension also works in VS Code forks like Cursor |
| IDE (JVM shops) | JetBrains (IntelliJ, PyCharm, WebStorm) + official plugin | Same agent, IDE-aware diffs |
| Terminal (macOS) | iTerm2 or Ghostty | Fast rendering of the Ink-based TUI; both handle Claude Code's key bindings cleanly |
| Terminal (Windows) | Windows Terminal | Claude Code runs natively on Windows; PowerShell or Git Bash inside it |
| Terminal (cross-platform) | WezTerm, Kitty, Alacritty, Warp | All work; pick on personal preference |
| Multiplexer | tmux or zellij | Keeps long agent sessions alive over SSH and lets you run parallel sessions |
Setup details that matter in practice: Claude Code's UI is built with React via Ink, so any modern GPU-accelerated terminal with true color is fine — the differences are keyboard handling and rendering speed under fast output. Inside the CLI, run:
/terminal-setup
to bind Shift+Enter for newlines in supported terminals (iTerm2 and VS Code's integrated terminal, among others). If you prefer one window, the VS Code extension effectively gives you both layers at once: the agent in a panel, diffs in the editor. Terminal purists running multiple parallel Claude Code sessions tend to land on Ghostty or WezTerm plus tmux.
07Capabilities, limits & troubleshooting
Here is what Claude Code actually can and cannot do — files, web, images, local models — plus how Anthropic handles your data and the fixes for the errors every daily user eventually hits.
Can Claude Code read PDFs?
Yes. Claude Code reads PDFs natively through its built-in Read tool — just reference the file path or drag the PDF into the terminal, and it processes the pages including text, tables, and charts. For long documents it reads in page ranges. Text-only extraction via a shell tool like pdftotext is cheaper in tokens.
In practice you have two options, and the right one depends on whether the visual layout matters:
- Native Read tool. Ask something like "summarize the pricing table in ./contracts/msa.pdf". Claude Code interprets each page visually, so it can read charts, scanned tables, and diagrams. The tradeoff: pages are processed as images, which consumes context quickly on 100-page documents. Claude Code paginates long PDFs and can be told to read specific pages.
- Shell extraction. Because Claude Code can run any CLI, it can extract plain text itself:
pdftotext report.pdf - | head -200
This is dramatically cheaper for text-heavy documents where you do not need figure analysis. Claude Code will often choose this route on its own if the utility is installed. For form-filling, signing, or annotating PDFs, Anthropic's pdf plugin/skill adds an interactive viewer on top of basic reading.
Can Claude Code search the web?
Yes. Claude Code has two built-in web tools: WebSearch, which runs live web searches and returns titles, URLs, and snippets, and WebFetch, which downloads a specific URL, converts the page to markdown, and analyzes it. Both respect your permission settings, and you can disable them entirely for locked-down environments.
You do not need to invoke these tools by name. Prompts like "check the latest React 19 migration guide and update our hooks accordingly" cause Claude Code to search, fetch the relevant docs, and apply what it found to your code. A few practical notes from daily use:
- WebFetch works well on public, static pages. It fails on login-walled or heavily JavaScript-rendered sites — for those, connect a browser through MCP (Model Context Protocol), such as Anthropic's Chrome extension or an automation server like Playwright.
- Permissions apply. Web access appears in the permission prompt flow; you can allowlist or deny it in
/permissions or in settings.json, which matters for teams with data-exfiltration concerns.
- Search grounding beats training data. For anything time-sensitive — library versions, API changes, pricing — explicitly asking Claude Code to verify with a web search produces fewer hallucinated answers than trusting the model's knowledge cutoff.
Can Claude Code generate or see images?
Claude Code can see images but cannot generate them. It reads screenshots, PNGs, and JPEGs — paste one with Ctrl+V, drag it into the terminal, or give a file path — and uses them for UI debugging and design-to-code work. Claude models have no image-generation capability, though Claude Code can wire up image-generation APIs for you.
The vision side is one of Claude Code's most useful workflows: paste a screenshot of a broken layout and say "make the app match this", or drop in a Figma export and ask for the component. It also takes its own screenshots when driving a browser through an MCP server, which enables visual verification loops — build, screenshot, compare, fix, repeat.
On generation, be precise about what "generate an image" means:
- Raster images (photos, illustrations): not possible directly. Anthropic does not ship an image-generation model. Claude Code can, however, write and run a script that calls an external API (OpenAI's image API, Stability, Gemini) and save the result to disk.
- SVGs, diagrams, and charts: effectively yes, because these are code. Claude Code writes SVG markup, Mermaid diagrams, and matplotlib/D3 charts fluently, and can render and screenshot them to check its own work.
Does Claude Code run locally? Can you use it with a local LLM?
The Claude Code CLI runs locally — it executes commands, reads and edits files on your machine, and nothing about your repo is uploaded wholesale. But the model inference happens in Anthropic's cloud (or AWS Bedrock / Google Vertex AI for enterprise), so it does not work offline. Local-LLM setups exist via community proxies but are unsupported.
The architecture matters for both privacy and expectations. Claude Code sends the relevant context — your prompt, the files it chooses to read, command output — to the Claude API, gets a response, and acts locally. Your code never leaves your machine except as context for those API calls.
For routing to non-Anthropic or local models, the common community pattern points the CLI at an Anthropic-API-compatible proxy:
export ANTHROPIC_BASE_URL=http://localhost:4000 # e.g. LiteLLM or claude-code-router
claude
Projects like LiteLLM and claude-code-router translate Claude Code's API calls to Ollama, vLLM, or other backends. Three honest caveats: it is not supported by Anthropic and can break on any release; open-weight models handle Claude Code's agentic tool-calling far worse than Claude does, so quality drops sharply; and it may not comply with the consumer Terms of Service, so treat it as an experiment, not a production setup. Enterprises wanting cloud control should use the supported Bedrock/Vertex routes instead.
Does Claude Code train on your data?
Only if you allow it. Since Anthropic's August 2025 consumer-terms update (effective September 28, 2025), Free, Pro, and Max accounts — including Claude Code sessions on those plans — have a training toggle in Settings, and it was preset to on in the acceptance dialog. API, Team, and Enterprise usage is not trained on by default. Opting out takes one click.
The details worth knowing as of mid-2026:
- Consumer plans (Free/Pro/Max): the "Help improve Claude" toggle at claude.ai under Settings → Privacy controls whether your chats and Claude Code sessions can train future models. Allowing it extends data retention to five years; opting out keeps the standard ~30-day retention. You can flip it any time, and it applies going forward — data already used in completed training runs is not pulled back.
- API / Console (pay-per-token): not used for training by default, with short log-retention windows — the strictest option short of an enterprise contract.
- Team, Enterprise, Bedrock, Vertex: not used for training by default under commercial terms.
Separate from training, Claude Code emits operational telemetry, which you can reduce with environment variables:
export DISABLE_TELEMETRY=1
export DISABLE_ERROR_REPORTING=1
If you set up Claude Code before the 2025 policy change and never revisited settings, check the toggle now — that is the single highest-leverage privacy action. Current policy details live at Anthropic's privacy center and help center.
Is Claude Code open source? Was its source code leaked?
No, Claude Code is proprietary — the npm package ships bundled, minified JavaScript, and the GitHub repo anthropics/claude-code hosts only issues, docs, and the changelog. But yes, the source leaked: in March 2026, version 2.1.88 accidentally shipped a full source map exposing roughly 500,000 lines of TypeScript, which Anthropic hit with DMCA takedowns.
The leak story, factually: on March 31, 2026, a roughly 60 MB cli.js.map source map — generated automatically by the Bun build and never added to .npmignore — went out inside the published npm package. Source maps contain the original, readable source, so anyone who downloaded that version could reconstruct roughly 1,900 TypeScript files. A security researcher spotted it and posted the find, which went viral; mirror repos on GitHub accumulated tens of thousands of forks before Anthropic's DMCA notices took the main ones down. Boris Cherny, Claude Code's creator, publicly called it a plain developer error, and Anthropic stated no customer data or credentials were exposed.
It was not even the first incident: in 2025, de-minified and reconstructed versions of the CLI circulated on GitHub and drew earlier takedown notices. Two clarifications people conflate:
- The leak does not make Claude Code open source. The code remains copyrighted; using leaked source in your own projects is a legal risk, not a license.
- What Anthropic does open-source is adjacent tooling — notably the Claude Agent SDK for building your own agents — plus public docs at code.claude.com.
What is the Claude Code 5-hour limit?
Claude Code usage on Pro and Max plans is metered in rolling 5-hour session windows: your first message starts a window, you get a plan-dependent amount of usage inside it, and the window resets five hours after it began. A separate weekly cap sits on top. Hitting either pauses Claude Code until the relevant reset — run /usage to see both.
How the two-layer system works in practice:
| Limit | How it works | Resets |
| 5-hour session | Starts at your first message; usage is weighted by model, conversation length, and tool calls | 5 hours after the window started |
| Weekly (all models) | Overall cap across claude.ai chat and Claude Code combined | Every 7 days, at the time shown in /usage |
| Weekly (Opus) | Max and Team Premium plans carry an extra weekly bar for Opus-class models | Every 7 days |
Key facts users get wrong: /clear starts a fresh conversation but does not reset usage — limits are account-level. Chat on claude.ai and Claude Code draw from the same pool. Anthropic publishes multipliers (Pro 1x, Max 5x at $100/month, Max 20x at $200/month) rather than exact token quotas, and it has adjusted the ceilings repeatedly — in May 2026 it doubled the 5-hour caps for Pro, Max, and Team plans, and since June 2026 non-interactive usage (headless claude -p, the Agent SDK, GitHub Actions) draws from a separate monthly credit. If you hit walls constantly, the escape hatches are upgrading tiers, enabling usage credits, or switching to pay-per-token API billing, which has no session windows.
Why does Claude Code say my limit resets in days, not 5 hours?
Claude Code enforces two overlapping limits: a rolling 5-hour session window (the reset most people expect) and a separate weekly cap added for heavier users. When the app shows a multi-day reset — say six days — you have almost always hit the weekly limit, not the 5-hour one. During peak hours tokens also count faster, so a window that should last five hours can tap out in about three. Run /usage to see which limit you hit, and check status.claude.com for incidents; if a genuine 5-hour reset ever displays as multi-day, that is a known glitch worth a support ticket.
What is auto-compact in Claude Code?
Auto-compact is Claude Code's automatic context management: when a session approaches the model's context-window limit, it summarizes the conversation history into a compact briefing and continues with that summary plus recent messages. You'll see "Context left until auto-compact: X%" as you approach it. You can trigger it manually and earlier with /compact.
Why it exists: every file read, command output, and message accumulates in the model's context window. Long sessions would otherwise die with a hard "prompt is too long" error. Auto-compact trades detail for continuity — the summary preserves goals, decisions, and file state, but fine-grained details from early in the session can get lost.
Daily-driver tips:
- Compact on your terms, not the model's. Run
/compact at a natural task boundary — after tests go green — rather than letting auto-compact fire mid-refactor. You can steer the summary: /compact focus on the API changes.
- Prefer
/clear between unrelated tasks. A summary of an irrelevant task is pure noise; a fresh session is cleaner and cheaper.
- Watch the meter with
/context, which breaks down exactly what is eating the window (system prompt, MCP tools, CLAUDE.md, messages).
- It's configurable. Auto-compact can be toggled in
/config; some workflows (long autonomous runs) rely on it, while others disable it to keep full fidelity and clear manually.
How do you fix "prompt is too long" in Claude Code?
"Prompt is too long" means the request exceeds the model's context window — too much accumulated conversation, oversized CLAUDE.md files, heavy MCP tool definitions, or a huge file read. Fix it immediately with /compact (summarize history) or /clear (fresh session). Prevent it by trimming CLAUDE.md, disabling unused MCP servers, and reading large files in chunks.
Triage in this order:
- Run
/context. It shows exactly what fills the window: messages, system prompt, CLAUDE.md and other memory files, and MCP tool schemas. You cannot fix what you have not measured.
/compact or /clear. Compact preserves a summary of the session; clear wipes it. If the error fires on your very first message, history is not the problem — configuration is.
- Shrink standing context. Every session pays for your CLAUDE.md (project and global), imported files, and every connected MCP server's tool definitions. A bloated setup can consume tens of thousands of tokens before you type anything. Move detailed rules into skills or referenced docs, and disable idle servers with
/mcp.
- Stop reading monsters whole. A 20,000-line generated file or a giant JSON fixture read in one shot can blow the window alone. Ask Claude Code to grep for the relevant section or read specific line ranges instead.
If you routinely work in massive contexts, check whether your plan and model tier offers an extended context window via /model — but hygiene beats headroom.
How do you fix "process exited with code 1" in Claude Code?
"Process exited with code 1" is a generic startup or install failure, and the usual culprits are an old Node.js version (npm installs need Node 18+), broken npm global permissions, PATH conflicts between multiple installs, or a missing Git Bash on Windows. Run claude doctor first — it diagnoses most of these — then reinstall with the native installer.
Work through the causes in order of frequency:
- Node version. Check
node --version. If it is below 18 (common with system Node on older Linux distros), upgrade Node or skip npm entirely and use the native installer, which bundles its own runtime.
- npm permissions. If you ever ran
sudo npm install -g, global modules may be root-owned and half-broken. Do not fight it — uninstall and switch:
npm uninstall -g @anthropic-ai/claude-code
curl -fsSL https://claude.ai/install.sh | bash # macOS/Linux
irm https://claude.ai/install.ps1 | iex # Windows PowerShell
- Duplicate installs. An npm install and a native install coexisting means
which claude may resolve to a stale binary. Run which claude (or where claude on Windows), remove the loser, and restart your shell.
- Windows specifics. Native Windows Claude Code uses Git Bash for shell commands; install Git for Windows, or point
CLAUDE_CODE_GIT_BASH_PATH at a custom bash.exe.
- Still stuck?
claude doctor prints installation health, and running with claude --debug surfaces the real underlying error behind the generic exit code.
Did Claude Code get worse or dumber?
Sometimes, temporarily — and Anthropic has owned it. A September 2025 postmortem confirmed three overlapping infrastructure bugs (misrouted requests, a misconfigured inference server, and a compiler bug) that degraded output for about a month; later hiccups included a late-January 2026 harness regression (introduced Jan 26, rolled back Jan 28) and a spring-2026 system-prompt change that briefly capped responses between tool calls. Anthropic says it never intentionally degrades models. Much of what feels like “dumber” is really rate-limit throttling, peak-hour token burn, or context rot late in a long session — start fresh with /clear and check status.claude.com.
Is Claude Code down? How do you check?
Check status.claude.com — Anthropic's official status page covers claude.ai, the Claude API, and Claude Code as separate components, and shows active incidents like elevated error rates. If the page is green but Claude Code is failing for you, the problem is local: run claude doctor, check your network and auth, and try a minimal claude -p "hi" test.
A fast triage sequence when requests hang or error:
| Step | Command / action | What it tells you |
| 1. Platform status | Open status.claude.com (status.anthropic.com also resolves) | Whether Anthropic has an active incident (API errors, degraded models) |
| 2. Minimal request | claude -p "say hi" | Whether the API works outside your current session's context |
| 3. Install health | claude doctor | Version, install type, auth, and config problems |
| 4. Usage limits | /usage | Whether you hit a 5-hour or weekly cap — this mimics an outage but is not one |
| 5. Auth | /login | Expired or wrong-account credentials; also check any ANTHROPIC_API_KEY overriding your subscription |
Two lookalikes cause most false "it's down" reports: exhausted rate limits (step 4) and corporate proxies or VPNs blocking api.anthropic.com. During real incidents, "overloaded" (529) errors typically resolve on their own; Anthropic posts updates on the status page as they happen. To report a genuine bug rather than an outage, run /bug inside Claude Code — it files a report with diagnostic context to the anthropics/claude-code GitHub repo.
Does Claude Code work on Windows?
Yes, Claude Code runs natively on Windows 10 and 11 — no WSL required. Install it in PowerShell with irm https://claude.ai/install.ps1 | iex, and install Git for Windows since Claude Code uses Git Bash for shell commands. The earliest 2025 versions required WSL or Git Bash workarounds; native support has been standard since mid-2025.
irm https://claude.ai/install.ps1 | iex
Windows users get the full feature set: the CLI in PowerShell or Windows Terminal, the VS Code and JetBrains extensions, and the Claude desktop app. WSL remains a fully supported alternative — some developers prefer it because their toolchain already lives in Linux, and OS-level sandboxing currently works on WSL but not native Windows — but it is a choice now, not a requirement. If shell commands fail after install, the fix is almost always Git Bash: install Git for Windows from git-scm.com, or set CLAUDE_CODE_GIT_BASH_PATH if bash.exe lives in a non-standard location. Full step-by-step instructions for all platforms, including npm and Homebrew methods, are in the install section of this guide.
08Claude Code for work: best practices & business use
How power users, Anthropic's own teams, and its creator actually run Claude Code day to day — and what the tool realistically offers if you don't write code for a living.
What are Claude Code best practices?
The core Claude Code best practices are: maintain a CLAUDE.md file with project conventions, start non-trivial work in Plan Mode (Shift+Tab), keep diffs small and verify each one, give Claude tests as success criteria, run /clear between unrelated tasks, offload research to subagents, and manage permissions with /permissions allowlists instead of --dangerously-skip-permissions.
These practices come from Anthropic's own engineering guidance and hold up in daily use:
- CLAUDE.md as project memory. Put build commands, code style, and gotchas in a
CLAUDE.md at the repo root. Claude reads it every session, so it stops repeating mistakes you have already corrected.
- Plan before code. Press Shift+Tab twice to cycle into Plan Mode. Claude proposes an approach in read-only mode; you approve before any file changes. A good plan is the highest-leverage step in the whole workflow.
- Small, verified diffs. Land one reviewable change at a time. Big multi-file dumps are where agentic coding goes wrong.
- Tests as the definition of done. "Make the failing test pass" is a goal Claude can loop on independently; "make it work" is not.
- Context hygiene. Use
/clear between unrelated tasks and /compact at natural breakpoints so stale context doesn't pollute new work.
- Subagents for bulk work. Dispatch research, log analysis, and mass refactors to subagents so raw output stays out of your main context window.
- Permission hygiene. Pre-approve safe commands with
/permissions and commit the allowlist to .claude/settings.json for your team, rather than running with permissions disabled.
# the two commands that anchor the loop
claude # start a session, Shift+Tab for Plan Mode
/clear # reset context between unrelated tasks
How does Anthropic use Claude Code internally?
Anthropic documented its internal usage in the July 2025 report "How Anthropic teams use Claude Code." Product engineers treat it as the first stop for programming tasks, security engineers feed it stack traces during incidents — cutting problem diagnosis from 10–15 minutes of manual code scanning to about five — and non-engineering teams like legal, marketing, and data science build working tools without traditional coding skills.
The report, based on interviews with Anthropic's internal power users, is the best primary source on how the tool performs at scale inside a real company. Notable patterns:
- Product engineering treats Claude Code as the default entry point for programming tasks — navigating unfamiliar parts of the monorepo, debugging, and writing features.
- Security engineering pastes stack traces and incident context into Claude Code, which traces the failure through the codebase far faster than manual scanning.
- Legal staff built internal tools (including a phone-tree prototype) despite not being developers.
- Growth marketing generated hundreds of ad copy variations programmatically.
- Data science built interactive dashboards and visualization apps despite describing themselves as not knowing TypeScript.
The report's headline takeaway: the most successful teams treat Claude Code as a thought partner embedded in an existing human workflow, not a vending machine for code. They review plans, keep changes small, and verify output — the same best practices Anthropic publishes externally.
What is Boris Cherny's Claude Code setup and workflow?
Boris Cherny, the creator of Claude Code, describes his setup as "surprisingly vanilla": mostly stock Claude Code running the strongest Opus model with thinking enabled. He runs several sessions in parallel (numbered terminal tabs plus more on claude.ai/code), starts almost every task in Plan Mode, automates repeated workflows as custom slash commands, and pre-approves safe commands with /permissions rather than disabling permission checks.
Cherny shared his workflow publicly in January 2026. The load-bearing pieces:
- Parallelism. Around five Claude sessions in numbered terminal tabs, with system notifications when one needs input, plus another five to ten sessions on the web version — and sessions kicked off from the iOS app during the day.
- Model choice. The top Opus tier with thinking for everything: slower per token, but it needs less steering, so it is usually faster end to end.
- Plan Mode first. Shift+Tab twice, iterate on the plan until it is right, then switch to auto-accept edits — a strong plan lets Claude one-shot the implementation.
- Custom slash commands for every inner-loop workflow, checked into
.claude/commands/ and shared via git — e.g. a /commit-push-pr command he runs dozens of times a day.
- Subagents and hooks. A code-simplifier subagent that cleans up after implementation, a verify-app subagent with end-to-end test instructions, and a PostToolUse hook that auto-formats Claude's code before CI sees it.
- Tools via MCP and CLIs. Slack through MCP (shared in
.mcp.json), BigQuery through the bq CLI, error logs from Sentry.
His explicit point: there is no one correct way to use Claude Code — every member of the team that builds it uses it differently.
What is spec-driven development with Claude Code?
Spec-driven development means writing and approving a detailed specification before Claude Code writes any code. You iterate with Claude on a spec or plan document (requirements, interfaces, edge cases, acceptance tests), review it like you would review code, and only then let Claude implement against it. The spec becomes the contract; passing its acceptance criteria defines done.
In practice the loop looks like this:
- Describe the feature and ask Claude (in Plan Mode) to draft a spec: goals, non-goals, data model, API surface, edge cases, test plan.
- Review the document in your editor. Annotate it, push back, cut scope. Repeat until the spec says exactly what you want.
- Have Claude write the acceptance tests from the spec first, then implement until they pass.
- Keep the spec in the repo (e.g.
specs/feature-x.md) so future sessions — and future humans — have the context.
Why it works: the spec moves your review effort to the cheapest point in the process. Catching a wrong assumption in a one-page document costs minutes; catching it in a 40-file diff costs hours. It is the disciplined opposite of vibe coding, and it is how experienced users get Claude Code to one-shot large features. Plan Mode is the built-in on-ramp — a plan is just a lightweight spec — and teams formalize it further with custom slash commands like /spec that enforce a template.
What are common Claude Code workflows?
The four canonical Claude Code workflows are: explore-plan-code-commit (have Claude read the code, plan, implement, then commit), test-driven development (write failing tests, then loop until green), parallel git worktrees (multiple Claude sessions on separate branches at once), and headless automation (claude -p in scripts, cron jobs, and CI pipelines like GitHub Actions).
| Workflow | How it runs | Best for |
| Explore → plan → code → commit | Claude reads relevant files first, proposes a plan in Plan Mode, implements after approval, then writes the commit | Most feature work and bug fixes |
| TDD loop | Claude writes failing tests from your requirements, confirms they fail, then iterates on the implementation until they pass | Well-specified logic, refactors, regressions |
| Parallel worktrees | git worktree add per task, one Claude session per worktree, no file conflicts between agents | Independent tasks you want to ship simultaneously |
| Headless / CI | claude -p "prompt" runs non-interactively; the GitHub Actions integration reviews PRs and fixes issues from @claude mentions | Automation, triage, scheduled jobs, pipelines |
# parallel worktrees
git worktree add ../myapp-auth feature/auth
cd ../myapp-auth && claude
# headless mode in a script or CI step
claude -p "Triage the failing tests and summarize root causes" \
--output-format json
Most daily use is the first workflow; the other three are what separate casual users from teams getting compounding leverage. All four combine — e.g. a TDD loop running headlessly inside CI.
Can non-coders use Claude Code?
Yes — non-coders use Claude Code for real work: automating file and spreadsheet tasks, building internal tools and prototypes, scraping and reshaping data, and drafting documents from repo contents. Anthropic's own legal, marketing, and data teams do this daily. The honest ceiling: you cannot reliably judge whether generated code is production-safe, so keep it away from live systems without a developer's review.
Claude Code is a terminal app, which sounds intimidating, but you interact with it in plain English. The guardrails that make it safe for non-developers:
- Work in a folder that only contains your project. Claude's default permission prompts mean nothing happens to files without your approval.
- Use Plan Mode (Shift+Tab) so Claude explains what it will do before doing it.
- Ask Claude to set up git for you and commit after every working state — checkpoints let you rewind mistakes with
/rewind.
- Ask "explain what you just did in plain English" after each change. If the explanation doesn't make sense, stop.
Where the ceiling sits: deploying to production, handling payments or user data, security-sensitive code, and anything where a subtle bug costs real money. For those, a non-coder can build the prototype but should hand off before launch. Also note Anthropic ships Claude Cowork, an agentic tool in the Claude desktop app aimed at non-coding knowledge work — for document, spreadsheet, and research tasks that never touch a codebase, it is the more natural fit as of mid-2026.
How do product managers use Claude Code?
Product managers use Claude Code to build working prototypes instead of writing mockup annotations, pull and analyze their own data (SQL queries, CSV crunching, quick dashboards) without waiting on an analyst, validate specs against the actual codebase before sprint planning, and answer "how does this feature actually work today?" by having Claude read the source directly.
The highest-leverage PM use cases:
- Prototypes over specs. A clickable prototype built in an afternoon settles debates that a ten-page PRD cannot. Claude Code can scaffold a working web app from a description, then iterate live in a design review.
- Self-serve data pulls. Point Claude at a warehouse CLI (like
bq for BigQuery) or an exported CSV and ask questions in English. Claude writes the SQL, runs it, and charts the result.
- Spec validation. Before committing a spec, ask Claude to check it against the codebase: "Does the current data model support this? What would have to change?" This catches infeasible requirements before engineering does.
- Codebase archaeology. "Read the checkout flow and explain, step by step, what happens when a coupon is applied" — an accurate answer in minutes, without pulling an engineer off task.
- Competitive and support analysis. Feed in support ticket exports or app-store reviews and have Claude cluster themes into a prioritized findings doc.
PM access usually comes through Claude Team or Enterprise plans, with permission allowlists set by engineering so PMs get read-heavy access without deploy rights.
What is vibe coding with Claude?
Vibe coding — a term coined by Andrej Karpathy in February 2025 — means describing what you want in natural language and accepting the AI's code without reading it, judging results only by whether the thing works. With Claude Code that means loose prompts, auto-accepted edits, and iterating on outcomes. It is legitimate for prototypes and personal tools, and reckless for production systems.
Vibe coding is on a spectrum with the disciplined workflows above:
| Vibe coding | Spec-driven / best practice |
| Prompting | "Make a habit tracker, dark mode, make it fun" | Written spec, edge cases, acceptance tests |
| Review | None — run it and look | Plan approved first, every diff read |
| Verification | "Seems to work" | Tests, typecheck, CI must pass |
| Right for | Prototypes, weekend projects, internal one-offs | Anything users, money, or data depend on |
Claude Code is arguably the strongest vibe-coding tool available because the models are good enough that unreviewed code often just works — which is exactly the trap. Unreviewed code accumulates security holes, dead ends, and architecture you cannot explain. A practical rule: vibe code anything you could throw away without pain; the moment something acquires users or data, switch to plans, tests, and reviewed diffs. Even Karpathy's framing was that vibe coding is for "throwaway weekend projects."
Is there a Claude Code certification or course?
Yes. Anthropic Academy offers "Claude Code in Action," a free official course at anthropic.skilljar.com covering how Claude Code works, context management, custom slash commands, hooks, and MCP integrations. Completing the course earns an official Anthropic completion certificate with a verification link. It is a completion certificate, not a proctored professional certification — no exam-based Claude Code certification exists as of mid-2026.
Details worth knowing before you enroll:
- Where: Anthropic's Skilljar learning portal (Anthropic Academy). The same course also appears on Coursera; the Skilljar version issues the certificate free, so going direct is the simpler path.
- What it covers: how Claude Code reads files, executes commands, and modifies code through its tool system; managing context; custom slash commands; extending Claude Code with hooks; and connecting external services via MCP (Model Context Protocol).
- Prerequisites: basic command-line familiarity plus access to Claude Code (a paid Claude plan or an API key) for the hands-on portions.
- Certificate: issued on completion, includes a verification link, and can be added to LinkedIn.
- The broader catalog: Anthropic Academy hosts a dozen-plus free courses (Claude API, MCP, Agent Skills), so the Claude Code course slots into a fuller learning path.
Realistic value: the certificate signals familiarity, not mastery. The course itself is genuinely good onboarding; the credential is a nice-to-have. Hiring managers weigh a repo of shipped Claude Code work more heavily than the certificate.
Can Claude Code build iOS apps?
Yes. Claude Code writes Swift and SwiftUI well and can build a complete iOS app — but you need a Mac with Xcode installed, because Apple's toolchain is required to compile, run on the Simulator, sign, and submit. Claude Code drives that toolchain from the command line (xcodebuild, xcrun simctl), so the full write-build-test loop runs inside one session.
The working setup:
- Requirements: a Mac, Xcode (free from the App Store), and Claude Code. An Apple Developer account ($99/year) only becomes necessary for TestFlight and App Store distribution.
- The loop: Claude writes SwiftUI code, compiles it, boots a Simulator, and reads build errors back to fix its own mistakes:
xcodebuild -scheme MyApp \
-destination 'platform=iOS Simulator,name=iPhone 16' build
xcrun simctl launch booted com.example.myapp
- What it handles well: SwiftUI interfaces, SwiftData/Core Data models, networking, unit and UI tests via
xcodebuild test, and fixing the compiler-error churn that dominates iOS iteration.
- Where humans stay in the loop: signing certificates and provisioning profiles, App Store Connect metadata and screenshots, and Apple's review process — Claude can script parts of this with
fastlane, but account-level steps remain manual.
- Cross-platform angle: Claude Code is equally capable with React Native and Flutter if you want Android from the same codebase; the Mac + Xcode requirement still applies for the iOS build.
Non-coders have shipped App Store apps this way, but expect the last mile — signing, review, edge-case polish — to demand the most patience.