We Love Claude

Claude Code (CLI)

The terminal version of Claude Code — install, CLAUDE.md context files, slash commands, and power-user tips.

Available on
Desktop

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 commands, and commits — on demand and with your approval. It’s the same engine behind Claude Code Desktop and the web app, and the CLI is where every knob is exposed.

Where to find it

Install with one of the following, then run claude:

Your setupCommand
macOS / Linux / WSLcurl -fsSL https://claude.ai/install.sh | bash
Windows (PowerShell)irm https://claude.ai/install.ps1 | iex
Homebrewbrew install --cask claude-code
npm (Node 18+)npm install -g @anthropic-ai/claude-code

Anthropic also publishes a Windows CMD installer, a WinGet package (winget install Anthropic.ClaudeCode), and apt / dnf / apk packages for Debian, Fedora, RHEL, and Alpine.

Don’t use sudo with the npm install — it causes permission problems later. Verify with claude --version.

Native installs update themselves in the background. Homebrew and WinGet installs don’t: run brew upgrade claude-code or winget upgrade Anthropic.ClaudeCode yourself. Homebrew offers two casks — claude-code tracks the stable channel, roughly a week behind, and claude-code@latest ships new versions as soon as they land.

How to use it

First-day flow

  1. cd path/to/your/project and run claude.
  2. On first launch, /login authenticates through the browser (SSO included). Alternatively export ANTHROPIC_API_KEY, or set CLAUDE_CODE_USE_BEDROCK=1 or CLAUDE_CODE_USE_VERTEX=1 with the matching cloud credentials.
  3. Ask a question. Claude reads files on demand — there’s nothing to upload.
  4. When Claude proposes an edit you’ll see a diff. Choose Yes, Yes, and don’t ask again for edits, or No.
  5. Run /init once per project to generate a starter CLAUDE.md.

Permission modes

Press Shift+Tab at any time to cycle the permission mode: auto → manual → acceptEdits → plan. Plan mode is read-only — use it to let Claude outline a big change before it touches anything. /plan drops you straight into it, optionally with a task description.

CLAUDE.md — project memory

Claude reads CLAUDE.md files automatically at the start of every session, from broad to specific: ~/.claude/CLAUDE.md for every project, <repo-root>/CLAUDE.md for the current one, and <subdir>/CLAUDE.md for a specific directory. Subdirectory files load on demand.

Keep it under roughly 200 lines. Include build, test, lint, and run commands, naming conventions and “we use X, not Y” decisions, a three-sentence architecture summary, hard constraints, and the pitfalls that catch new joiners. Leave out full API docs, changelogs, anything obvious from the directory tree, and rules the team doesn’t actually follow.

The file is loaded as a user message, not baked into the system prompt. Nothing is summarised or truncated, and it isn’t re-read from disk on every turn — so restart the session after you edit it.

Slash commands worth knowing

  • /clear — wipe the conversation and start fresh; project memory stays.
  • /compact — summarise the conversation so far to free up context.
  • /btw — ask a quick side question without adding it to the main conversation.
  • /rewind — roll the conversation and/or your code back to an earlier checkpoint (or press Esc, Esc).
  • /model — view or switch the active model. /context visualises what’s loaded; /memory opens the CLAUDE.md files in scope.
  • /cost — token usage and spend for this session. /usage — your plan’s limits and current rate-limit status.
  • /diff — an interactive viewer for uncommitted changes and per-turn diffs.
  • /simplify — review files for reuse, quality, and efficiency issues, then apply the fixes.
  • /permissions, /add-dir — control which tools need approval and which directories Claude can reach.
  • /agents, /hooks, /skills, /mcp — subagents, lifecycle hooks, packaged workflows, and MCP servers.
  • /doctor — diagnose install and environment issues. /status shows account, model, working directory, and version.

Press ? inside a session for the shortcuts your terminal or IDE supports.

Good to know

  • Models. Sonnet is the default and the right choice for most coding work. Opus offers deeper reasoning for large cross-cutting refactors, hard debugging, and architectural decisions. Haiku is fastest and cheapest for quick lookups, simple edits, and high-volume scripted runs. /model is always the source of truth for what your account can reach.
  • The usage meter depends on how you signed in. An Enterprise seat draws on a pool included in your organisation’s plan that resets on a rolling window. API-key auth is pay-as-you-go, billed per token, with no hard stop.
  • Verification is the number-one tip. Give Claude a way to check its own work: the Chrome extension for front-end changes, the Desktop app’s built-in browser for a running web server.
  • Worktrees and parallel sessions. claude --worktree launches an isolated git worktree session; Anthropic suggests running three to five in parallel. /batch spreads a large migration across many isolated agents.
  • Scheduling. /loop repeats a prompt inside a CLI session for quick polling; /schedule creates a cloud routine that keeps running when your machine is off.
  • Moving between surfaces. claude --cloud starts a web session from the terminal and claude --teleport pulls one back down; /desktop continues the current session in the Desktop app. Remote control — steering a local session from your phone or a browser — is available on Pro, Max, Team, and Enterprise plans on CLI v2.1.51 or later.
  • Troubleshooting quick hits: command not found → open a new terminal or source ~/.zshrc. EACCES on npm install → use the native installer or fix npm’s prefix; never sudo. Installer hangs on a corporate network → set HTTPS_PROXY. TLS or SELF_SIGNED_CERT_IN_CHAIN errors → point Node at your CA bundle with NODE_EXTRA_CA_CERTS. /login callback blocked → copy the URL, sign in elsewhere, and paste the code back. 403 on a model → your seat or region doesn’t have access to it. Last resort: claude doctor.

What’s changed recently

  • 2026-09-13 — Re-read against the seven current Claude Code articles. The permission-mode cycle is now four modes — Shift+Tab moves through auto → manual → acceptEdits → plan, so auto mode no longer needs a launch flag. New commands documented: /btw, /rewind, /diff, /simplify, /plan, /context, /memory, /add-dir, /status. CLAUDE.md file locations, loading behaviour and length guidance are spelled out for the first time. Install picks up WinGet, a Windows CMD installer, Linux package managers, and two Homebrew casks, with auto-update only on native installs. We’ve removed the “1M context on Opus 4.6 or 4.7” line and /model opusplan, neither of which any current article supports, and --remote has been replaced by --cloud.

Related

Sources