Claude Code (CLI)
The terminal version of Claude Code — install, CLAUDE.md context files, plans, slash commands, and power-user tips.
What it is
Claude Code is Anthropic’s agentic coding tool. The CLI is the terminal version: you cd into a repo, run claude, and Claude reads files, edits them, runs tests, and commits — on demand and with your approval. It’s the same engine that powers Claude Code Desktop and the web app at claude.ai/code; the CLI is where the team ships first and where every knob is exposed.
Where to find it
Install with one of the following, then run claude:
| Your setup | Command |
|---|---|
| macOS / Linux / WSL | curl -fsSL https://claude.ai/install.sh | bash |
| Windows (PowerShell) | irm https://claude.ai/install.ps1 | iex |
| Homebrew | brew install --cask claude-code |
| npm (Node 18+) | npm install -g @anthropic-ai/claude-code |
Don’t use sudo with the npm install — it causes permission issues later. Verify with claude --version.
How to use it
First-day flow
cd path/to/your/projectand runclaude.- On first launch,
/loginauthenticates via browser (Enterprise/SSO) or useANTHROPIC_API_KEY/ Bedrock / Vertex env vars. - Ask a question. Claude reads files on demand — nothing to upload.
- When Claude proposes an edit you’ll see a diff. Choose Yes, Yes, don’t ask again, or No.
- Run
/initonce per project to generate a starterCLAUDE.mdcapturing conventions and commands.
Permission modes
Press Shift+Tab to cycle: default → acceptEdits → plan (and auto if you launched with --enable-auto-mode). Plan mode is read-only; use it to let Claude outline big changes before touching files.
CLAUDE.md — project memory
Drop a CLAUDE.md at your repo root. Claude reads it automatically at the start of every session. Keep it under ~200 lines. Include build/test/lint commands, naming conventions, hard constraints, and gotchas. Leave out full API docs, changelogs, and aspirational rules. Prompt caching keeps the cost low.
Slash commands worth knowing
/clear— wipe conversation, keep project memory. Start fresh between unrelated tasks./compact— summarize conversation to free context mid-task./model— switch between Sonnet (default), Opus (deeper reasoning), Haiku (fastest/cheapest). Use/model opusplanto plan with Opus and execute with Sonnet./cost— token and dollar usage for this session (API billing)./usage— Enterprise plan limits and rate-limit status./permissions— pre-approve safe commands per project./agents,/hooks,/skills— customize subagents, lifecycle hooks, and packaged workflows./doctor— diagnostic report for support tickets.
Full keybindings: ? inside a session.
Good to know
- Models: Sonnet for most coding, Opus when stuck or for wide changes, Haiku for quick mechanical edits.
/modelis always the source of truth for what’s available to your account. - Usage meter depends on auth. Enterprise seats get a pool that resets on a rolling window. API-key auth (Console, Bedrock, Vertex, Foundry) is pay-per-token with no hard stop.
- 1M context is available in Claude Code for Max, Team, and Enterprise users on Opus 4.6 or 4.7.
- Worktrees:
claude --worktreelaunches an isolated git worktree session. Run 3–5 in parallel./batchdistributes large migrations across many worktree agents. - Chrome extension & Desktop app close the verification loop for web code — Claude can read console logs, errors, and DOM state. Power-user tip #1 is to give Claude a way to verify its own work.
- Teleport and remote control (Pro/Max/Team/Enterprise, CLI v2.1.51+) move sessions between terminal, desktop, web, and mobile.
- Troubleshooting quick hits:
command not found→ reopen terminal.EACCESon npm install → use the native installer or fix npm prefix./loginhangs → paste the URL manually. 403 on every request →/modelto a model your seat has access to. Last resort:claude doctor.
What’s changed recently
- 2026-04-18 — Page created from official help-center articles.
Related
Related
Sources
- Your first day in Claude Code · fetched 2026-04-18
- Models, usage, and limits in Claude Code · fetched 2026-04-18
- Claude Code cheatsheet · fetched 2026-04-18
- Give Claude context: CLAUDE.md and better prompts · fetched 2026-04-18
- Troubleshoot Claude Code installation and authentication · fetched 2026-04-18
- Claude Code FAQ · fetched 2026-04-18
- Claude Code power user tips · fetched 2026-04-18