A developer's Claude Code CLI reference (2026 guide)

Rama Adi Nugraha
Written by

Rama Adi Nugraha

Katelin Teen
Reviewed by

Katelin Teen

Last edited June 5, 2026

Expert Verified
Claude Code CLI reference 2026 guide - hero banner with Anthropic branding

What the Claude Code CLI actually is

Claude Code is Anthropic's agentic coding tool - not a chat interface that generates code, but an agent that plans work, reads your codebase, edits files across multiple directories, runs tests, and creates pull requests. It launched as GA on May 22, 2025, crossed $2.5 billion in annualized revenue by February 2026, and now has 130,000+ GitHub stars.

The CLI is the most capable surface - it gets new features fastest, supports the full flag set, and runs natively in any terminal environment. The VS Code extension, JetBrains plugin, desktop app, and web interface all share the same underlying engine, so CLAUDE.md files, settings, and MCP servers you configure in the CLI work across all surfaces.

Claude Code running in a terminal showing an interactive session with multi-file edits
Claude Code running in a terminal showing an interactive session with multi-file edits

Santiago Valdarrama (@svpino), an AI educator with 600K+ followers, framed the positioning cleanly: "Mode 1: AI writes the code, and the human copilots. Mode 2: The human writes the code, and AI copilots. These two are very different. One doesn't replace the other. Professional developers use both." Claude Code is Mode 1. That distinction matters when you're deciding which flag, workflow, or plan applies to your situation.

This post covers the full Claude Code CLI reference: installation, session commands, the CLAUDE.md system, hooks, MCP servers, skills, multi-agent orchestration, piping, scheduling, and pricing. For an executive-level read first, see our Claude Code overview.


Installation

As of v2.1.162 (released June 3, 2026), the recommended install methods are:

macOS, Linux, and WSL:

curl -fsSL https://claude.ai/install.sh | bash

Windows PowerShell:

irm https://claude.ai/install.ps1 | iex

Windows CMD:

curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd

Homebrew (macOS, stable):

brew install --cask claude-code

Two Homebrew casks exist: claude-code (stable, about a week behind) and claude-code@latest (latest releases). Neither auto-updates - run brew upgrade claude-code manually after installing via Homebrew.

WinGet (Windows):

winget install Anthropic.ClaudeCode

WinGet also does not auto-update. Linux package managers (apt, dnf, apk) work on Debian, Fedora, RHEL, and Alpine.

Native curl/PowerShell installs auto-update in the background and are the recommended path for most developers. The npm package (@anthropic-ai/claude-code) was deprecated in v2.1.113 when the CLI moved to a platform-native binary — don't use it for new installs. See our full install guide and npm install reference — plus cloud provider setup for Amazon Bedrock, Vertex AI, and Microsoft Foundry.

Claude Code CLI layered architecture: from install and authentication through CLAUDE.md, hooks, MCP servers, and multi-agent orchestration
Claude Code CLI layered architecture: from install and authentication through CLAUDE.md, hooks, MCP servers, and multi-agent orchestration

First session and essential commands

cd /your/project claude

The first run opens a browser to authenticate your Claude account. Credentials are stored after login - no re-authentication needed in future sessions. Supported accounts: Pro, Max, Team, Enterprise, Anthropic Console (API credits), or a supported cloud provider.

Core CLI flags

FlagWhat it does
claudeStart interactive mode
claude "task description"Run a one-time task and return to shell
claude -p "query"Non-interactive: run query and exit (for pipes/scripts)
claude -c or --continueResume most recent conversation in this directory
claude -r or --resumeOpen conversation picker to resume a previous session
claude --permission-mode planPlan mode: Claude reads and proposes, no edits until approval
claude --worktree <branch-name>Start session in a new git worktree on its own branch
claude --bg "task"Launch a background agent session
claude agentsView all running, blocked, and completed sessions
claude -p "query" --output-format jsonJSON output for scripting
claude mcp listList all configured MCP servers
claude mcp add --transport http <name> <url>Add a remote MCP server
claude project purgeDelete all Claude Code state for a project

Inside a running session

CommandWhat it does
/helpShow all available commands
/clearClear conversation history
/compactCompress context to free up tokens mid-session
/resumeOpen session picker
/modelChange model for current session
/effortSet effort level: low, medium, high, xhigh, max
/mcpCheck MCP server status and authenticate
/skillsBrowse and manage available skills
/usageShow token and cost usage for this session
/loginSwitch accounts or re-authenticate
/loopRepeat a prompt on a recurring interval
/recapSummarize current context for returning to a session
Shift+TabToggle plan mode or cycle permission modes
Ctrl+D or exitExit Claude Code
TabAutocomplete commands
Command history

For a hands-on walkthrough, see the Claude Code quickstart guide. For understanding interactive mode vs one-shot usage — which matters in CI/CD contexts — that guide covers the distinction in detail. Context window size determines how far a session stretches before you need /compact; usage analytics tracks token spend across sessions. Understanding Claude Code permissions — how plan mode interacts with default permission grants — is essential before automating anything through hooks.


CLAUDE.md: the brain of your setup

CLAUDE.md is a markdown file you place in your project root (or ~/.claude/CLAUDE.md for global defaults). Claude reads it at the start of every session - before your first prompt - loading your project's context, rules, and constraints automatically.

Things that belong in CLAUDE.md:

  • Coding standards: "Use async/await, not callbacks. No console.log in production code."
  • Architecture decisions: "Auth is in src/auth/. Don't modify without a security review."
  • No-touch zones: "Never modify migrations/ or config/production.js."
  • Preferred libraries: "Use zod for schema validation, not joi."
  • Quality gates: "Always run npm test after edits. If tests fail, fix them before committing."
  • Build commands: "Run npm run build to compile, npm run dev for local dev server."

The setup investment is real. u/Ok-Painter2695 on r/ClaudeAI shared what a production-grade Claude Code setup looks like after three months: "Setup time: Took 2–3 weeks to dial in. Not beginner-friendly at all." But that upfront investment pays off fast: "The CLAUDE.md rules prevent it from going off the rails. Without this, the agent would 'helpfully' refactor my auth code while fixing an unrelated bug. Ask me how I know."

CLAUDE.md also supports a .claude/rules/ directory for modular rule files and fires an InstructionsLoaded hook event when a rules file is loaded, which you can use for policy enforcement. Full Claude Code configuration options including settings.json fields are covered in our settings.json complete config guide. Claude Code environment variables covers the full list of env vars that control behavior at runtime.


The hooks system

Hooks are the policy and automation layer sitting between your intentions and Claude's actions. They run at specific lifecycle events and can intercept, block, modify, or react to what Claude does - without modifying the model itself.

There are 28+ hook events organized across three cadences:

Claude Code hooks architecture: per-session, per-turn, and per-tool-call event categories with the five handler types below
Claude Code hooks architecture: per-session, per-turn, and per-tool-call event categories with the five handler types below

Per session: SessionStart, Setup, SessionEnd

Per turn: UserPromptSubmit, UserPromptExpansion, Stop, StopFailure

Per tool call: PreToolUse, PostToolUse, PostToolUseFailure, PostToolBatch, PermissionRequest, PermissionDenied

Plus specialized events: SubagentStart, SubagentStop, FileChanged, ConfigChange, CwdChanged, WorktreeCreate, WorktreeRemove, PreCompact, PostCompact, Elicitation, ElicitationResult, InstructionsLoaded, Notification, MessageDisplay, TaskCreated, TaskCompleted, TeammateIdle.

Five handler types

TypeHow it works
commandRuns a shell script. Event JSON arrives on stdin; block/allow decision on stdout.
httpPOSTs event JSON to a URL. Useful for webhooks and external policy servers.
mcp_toolCalls a tool on an already-connected MCP server directly.
promptSends a yes/no question to a Claude model for single-turn policy evaluation.
agentSpawns a subagent with Read/Grep/Glob access for condition checking. (Experimental)

The most common pattern is PostToolUse with matcher Edit|Write to run a linter automatically after every file edit:

{ "hooks": { "PostToolUse": [{ "matcher": "Edit|Write", "hooks": [{ "type": "command", "command": "/path/to/lint.sh" }] }] } }

A PreToolUse hook with a command type can block destructive operations before they execute. If the hook script exits with JSON containing permissionDecision: "deny", Claude Code refuses the tool call and shows Claude the reason.

Hooks are configurable at four scopes: user-level (~/.claude/settings.json), project-level (.claude/settings.json, committable to the repo), project-local (.claude/settings.local.json, gitignored), and managed policy (organization-wide, admin-controlled). Enterprise admins can enforce allowManagedHooksOnly to prevent user and project overrides — the admin controls guide documents the full policy management surface.

Matcher patterns support exact strings, pipe-separated lists (Edit|Write), and JavaScript regexes (mcp__memory__.*). For MCP tool names, the format is mcp__<server>__<tool> - use mcp__memory__.* to match all tools from a server.

For the complete event reference, exec-form vs shell-form distinction, HTTP hook configuration, and real examples see our hooks in Claude Code guide and hooks reference for Claude Code.


MCP servers: connecting Claude to your real tools

The Model Context Protocol is an open standard for connecting Claude Code to external systems. Once a server is connected, Claude can read from it and act on it mid-session - no more copying Jira tickets or Sentry errors into chat.

Adding a server

# Remote HTTP server (recommended) claude mcp add --transport http notion https://mcp.notion.com/mcp # Remote HTTP with bearer token claude mcp add --transport http github https://api.githubcopilot.com/mcp/ \ --header "Authorization: Bearer YOUR_PAT" # Local stdio server claude mcp add --transport stdio --env AIRTABLE_API_KEY=YOUR_KEY airtable \ -- npx -y airtable-mcp-server # View all configured servers claude mcp list # Check server status and authenticate inside a session /mcp

Installation scopes

ScopeStored inShared with team
Local (default)~/.claude.jsonNo
Project (--scope project).mcp.json in project rootYes, via git
User (--scope user)~/.claude.jsonNo

Use --scope project to commit a shared server config to your repository. Project-scoped servers show as ⏸ Pending approval in claude mcp list until a team member approves. The Anthropic Directory lists reviewed, ready-to-connect servers.

Once connected, natural language drives the full toolchain:

  • "Add the feature described in JIRA issue ENG-4521 and create a PR on GitHub."
  • "Check Sentry for the most common errors in the last 24 hours."
  • "Find emails of 10 users who triggered that error, from our PostgreSQL database."
  • "Update our email template based on the Figma designs posted in Slack."

Type @ in any session to autocomplete MCP resources. Use @server:protocol://resource/path for explicit references (@github:issue://123, @postgres:schema://users). MCP servers can also expose slash commands via /mcp__servername__promptname.

Tool search is enabled by default: MCP tools load lazily rather than all at once, so adding more servers has minimal impact on context window usage. Use alwaysLoad: true in a server's config to exempt it from deferral.

Full configuration including OAuth setup, WebSocket transport, dynamic headers for Kerberos/SSO, and managed enterprise configs is in our Claude Code MCP tools guide, MCP integration guide, and MCP server integration overview.


Skills and slash commands

Skills package repeatable workflows as SKILL.md files that Claude auto-activates when relevant, or that you invoke directly as /skill-name.

mkdir -p ~/.claude/skills/summarize-changes

~/.claude/skills/summarize-changes/SKILL.md:

--- description: Summarizes uncommitted changes and flags anything risky. Use when the user asks what changed, wants a commit message, or asks to review their diff. --- ## Current changes !`git diff HEAD` ## Instructions Summarize the changes in 2-3 bullet points. List risks like missing error handling, hardcoded values, or tests that need updating. If the diff is empty, say so.

The !`git diff HEAD` syntax is dynamic context injection - Claude Code runs the command and substitutes the live output before Claude sees the skill content. Skills therefore receive current data without any manual pasting.

Built-in skills that ship with every install

SkillPurpose
/code-reviewReview code for bugs and improvements
/debugDebug issues systematically
/loopRun a prompt on a recurring interval
/batchBatch process multiple items
/claude-apiBuild and optimize Claude API apps
/runLaunch and drive your app to verify a change works
/verifyBuild and run your app to confirm a code change

Skills can run in isolated subagent contexts with context: fork, pre-approve specific tools with allowed-tools, and accept positional arguments via $ARGUMENTS[N]. They live-reload when you edit a SKILL.md - no session restart needed. Skills under .claude/commands/ (the older system) keep working identically.

Control who can invoke a skill with the disable-model-invocation: true frontmatter flag (user-only invocation) or user-invocable: false (Claude can use it, but it won't appear in the / menu). This is how you separate "run by Claude when relevant" from "only I trigger this manually" workflows like deployments.

Skills live at four locations - user (~/.claude/skills/), project (.claude/skills/), plugin, and enterprise managed settings - with precedence in that order. Share project skills by committing .claude/skills/ to version control.

Full reference including frontmatter fields, supporting files, and permission scoping: Claude Code slash commands guide and Claude Skills. For systematic debugging workflows, see the debug with Claude Code guide.


VS Code and IDE integration

The VS Code extension and CLI complement each other rather than compete. The most common power-user setup is running the CLI inside the VS Code integrated terminal - you get the extension's cleaner diff review UI and the CLI's full feature set at the same time.

VS Code editor with the Claude Code extension panel open on the right side, showing a conversation with file diffs visible
VS Code editor with the Claude Code extension panel open on the right side, showing a conversation with file diffs visible

Install from the Extensions view (Cmd+Shift+X on Mac, Ctrl+Shift+X on Windows), then open via Command Palette > Claude Code > "Open in New Tab". The extension adds inline diff review, @-mention file references, conversation history, and a plan review pane.

The diff review experience shows exactly what Claude proposes before any edit lands on disk — the IDE diff viewer guide covers how to get the best diff experience across CLI and extension:

VS Code showing Claude's proposed changes as a diff with a permission prompt to approve or reject
VS Code showing Claude's proposed changes as a diff with a permission prompt to approve or reject
Reddit

"The VS Code Extension's UI feels much cleaner overall. It is easier to review diffs, copy and paste, and prompt without running into friction."

The community thread on CLI vs extension was split: VS Code extension fans praised the UX, CLI loyalists noted it gets features faster and handles multi-repo setups better. The hybrid — CLI in the VS Code terminal — captures both. Full setup in our VS Code extension guide and VS Code Claude Code integration guide. For JetBrains (IntelliJ, PyCharm, WebStorm), see the JetBrains Claude Code guide and JetBrains integration guide. The IDE integration overview and IDE plugins guide compare all supported surfaces.


Parallel sessions and worktrees

Work on two features simultaneously without git conflicts:

# Terminal 1 - fix a bug in isolation claude --worktree fix-login-bug # Terminal 2 - build a feature on its own branch claude --worktree feature-auth

--worktree creates a separate git checkout on its own branch. Both sessions run in complete isolation - Claude in each worktree only sees that branch's file state. Monitor both from a single screen:

claude agents

The claude agents view shows every running, blocked, and completed session in one list with status indicators. Press Ctrl+T to pin a session as a background task that stays alive when idle. Type ! to fire a shell command as a background session. Use claude agents --json for scripting live session lists (useful for tmux setups and status bar integrations).


Multi-agent orchestration

Dynamic workflows, launched in v2.1.154, let a lead agent coordinate tens to hundreds of background subagents working in parallel. The result is that large tasks - migrating API endpoints, refactoring a service layer, writing tests across a codebase - that would fill a single context window get distributed instead.

Claude Code multi-agent orchestration: lead agent dispatches parallel subagents for auth, tests, docs, and code review, then merges results into a PR
Claude Code multi-agent orchestration: lead agent dispatches parallel subagents for auth, tests, docs, and code review, then merges results into a PR

Kick off a background session:

claude --bg "migrate all API endpoints from v1 to v2 auth and open a PR when done"

Or instruct Claude naturally inside an interactive session:

use a subagent to investigate how our auth system handles token refresh

The subagent reads files in its own context window and reports findings back - your main session context stays clean. Subagents are especially useful when exploring a large codebase where you'd otherwise burn most of a session on read operations before any coding begins.

Anthropic's engineering team uses multi-agent orchestration internally: per reporting at the May 2026 "Code with Claude" developer conference, "most software at Anthropic is now written by Claude," with engineers averaging 5 merged PRs per day and PR throughput per engineer up 67% year over year since Claude Code adoption.

For building custom orchestration pipelines, the Claude Code SDK, TypeScript SDK guide, and Python SDK guide give full access to the tool and permission system. See also our Claude Code sub-agent guide and Claude Managed Agents guide.


Piping and non-interactive scripting

Claude Code follows Unix conventions - it composes cleanly with pipes and can run fully non-interactively for CI and automation:

# Analyze recent logs tail -200 app.log | claude -p "Slack me if you see any anomalies" # Review changed files for security issues git diff main --name-only | claude -p "review these changed files for security issues" # Summarize commits for a standup git log --oneline -20 | claude -p "summarize these recent commits in plain English" # Automate translations in CI claude -p "translate new strings into French and raise a PR for review"

Use --output-format json or --output-format stream-json for machine-parseable output — the output styles reference documents every format option and how to control response verbosity. The -p flag runs one query and exits — no interactive session started, no approval prompts.

For pre-commit hook patterns, automated PR review via GitHub Actions, and headless batch processing, see our git workflows guide, Claude Code GitHub integration guide, and common workflows docs guide.


Scheduling recurring tasks

Three options depending on where the task needs to run:

OptionRuns whereBest for
RoutinesAnthropic-managed infrastructureTasks that should run even when your machine is off
Desktop scheduled tasksYour machine, via desktop appTasks needing local files or uncommitted state
GitHub Actions / GitLab CIYour CI pipelineTasks tied to repo events or cron schedules
/loopCurrent CLI sessionQuick polling while the session is open

Create a Routine from the web app, desktop app, or by running /schedule inside the CLI. Routines can also trigger on API calls or GitHub events. Common uses: morning PR review digests, overnight CI failure analysis, weekly dependency audits, doc syncing after PRs merge.


Pricing: which plan to actually buy

PlanPriceClaude CodeUsage
Free$0/monthNot included-
Pro$17/month annual / $20/monthYesStandard
Max 5x$100/monthYes5x more than Pro
Max 20xHigher tierYes20x more than Pro
Team Standard$20/seat/month annualYesMore than Pro
Team Premium$100/seat/month annualYes5x more than Standard
Enterprise$20/seat + API token usageYesToken-based beyond seat

Current promotion (as of June 2026): $1,000 in Claude Code and Cowork credits for every seat that activates before July 2.

The honest verdict: the $20 Pro plan works for moderate use with good session hygiene - short sessions, /compact regularly, new session per feature. For full-time development with long refactor sessions, multi-agent work, or sustained loops, it caps fast.

Reddit

"I think the $100 plan makes more sense and it's worth it. For the $20 you gonna hit the limit very fast but all depends how much you're using it."

Session throttling is the loudest sustained complaint across G2, Capterra, and Reddit - Anthropic has struggled to scale capacity at the pace demand grew (VS Code daily installs jumped from 17.7M to 29M+ in the first few months of 2026). The throttling is particularly sharp on Pro during peak hours; Max smooths it out considerably.

For teams and enterprise buyers, see our enterprise Claude Code guide and full Claude pricing breakdown. The Claude Pro pricing page covers the individual tier-by-tier details. Model selection and model configuration cover how to tune which model and effort level you're burning — which has a significant impact on how far a given plan stretches. Claude Sonnet 4.6 is the most common choice for sustained development work — faster than Opus at a lower token rate. Track cross-session spend with usage analytics.


What developers actually say

G2 rates Claude at 4.4/5 in the Winter 2026 Grid. Capterra gives it 4.5/5 from 309 verified reviews. The consistent praise and consistent frustrations:

What works:

The codebase reasoning is the thing that converts the skeptics. u/netcommah on r/ClaudeCode put it simply: "Claude Code is acting like the senior engineer who already read your whole codebase twice." In head-to-head comparisons with Gemini CLI and GitHub Copilot, that repo-level understanding shows up as cleaner refactors, sharper edge-case spotting, and fewer back-and-forth rounds. G2's editorial summary called it "the closest thing yet to working with an actual junior engineer rather than glorified autocomplete."

The adoption curve at teams is also real. Gergely Orosz reported on X (2.4K+ likes, 433K+ views) a CTO at a 600-engineer company saying: "Earlier, all devs used GitHub Copilot. 9 months ago, we rolled out Cursor to all devs. 1.5 weeks ago, we rolled out Claude Code to everyone, and cancelled our Copilot subscription." The comparison vs GitHub Copilot in our Claude vs Copilot guide breaks down where each sits.

What gets in the way:

Most developers running vanilla Claude Code without CLAUDE.md, hooks, or MCP are experiencing a fraction of the product. @Suryanshti777's post on X (4.5K likes, 1.5M views) described the gap bluntly: "Most people are using Claude Code completely vanilla… which is why their experience feels messy. The real power comes from the ecosystem around it." Setup takes time. Our Claude Code best practices guide distills what a production-ready setup looks like without the 2-3 week trial-and-error period.

Rate limits remain the single loudest complaint. The r/ClaudeCode thread on Pro limits (237 comments) surfaced "the session limit throttling is the real issue here, not the pricing model itself." That's accurate: if you're doing full-time development work, Max is the right plan. Pro is for supplemental use.


Try eesel

If Claude Code handles your development workflows, eesel does the same for your customer operations. eesel deploys autonomous AI agents directly inside the tools your support and ops teams already use - Zendesk, Freshdesk, Slack, Shopify, Gmail, and 100+ others - resolving tickets, drafting replies, and handling entire workflows without requiring a new interface.

eesel AI helpdesk dashboard showing autonomous agent ticket resolution and activity
eesel AI helpdesk dashboard showing autonomous agent ticket resolution and activity

The same "describe the outcome, step away" model that makes Claude Code effective in the terminal applies to eesel's support agents. Brief an eesel agent like you'd onboard a new hire - plain-language instructions, no prompt engineering required. Try it free with a $50 credit, no card needed.

Frequently Asked Questions

The Claude Code CLI is Anthropic's terminal-based agentic coding tool that lets you describe tasks in plain language and have Claude plan, write code, run tests, create commits, and open pull requests - all from your terminal. It runs on macOS, Linux, and Windows, and shares the same underlying engine as the VS Code extension, desktop app, and web interface. Learn more in our Claude Code overview.
Claude Code is included in the Pro plan ($17/month annual or $20/month), Max 5x plan ($100/month), Max 20x plan (higher tier), Team Standard ($20/seat/month annual), and Team Premium ($100/seat/month annual). The Free plan does not include Claude Code. For heavy agentic use, most power users recommend the Max 5x plan. See the full breakdown in our Claude Pro pricing guide and enterprise Claude Code guide.
CLAUDE.md is a markdown file in your project root that Claude reads at the start of every session. It sets coding standards, no-touch zones, preferred libraries, quality gates, and architecture context so you don't have to re-explain your setup each time. It is the single biggest quality-of-life improvement for regular Claude Code users. For full details, see Claude Code best practices and the Claude Code configuration guide.
Hooks are shell commands, HTTP endpoints, MCP tool calls, or LLM prompts that fire automatically at specific lifecycle events - before a tool call executes, after a file is edited, when a session starts, and more. They let you enforce policies and automate workflows without touching Claude's model behavior. There are 28+ hook events across session, turn, and tool-call cadences. See our full Claude Code hooks guide and the complete hooks reference for Claude Code.
The Claude Free plan does not include Claude Code. You need at least Pro ($17/month annual) to use it. Alternatively, you can connect Claude Code to the Anthropic Console (API key with pay-as-you-go credits), Amazon Bedrock, Google Vertex AI, or Microsoft Foundry for enterprise deployments. Check our Claude pricing guide for the full plan comparison and our Claude Code quickstart guide for getting up and running.

Share this article

Rama Adi Nugraha

Article by

Rama Adi Nugraha

Rama is a developer at eesel AI based in Bali, Indonesia, working across PHP/Laravel and the modern JavaScript stack (TypeScript, React, Next.js). He studied Information Management & Technology at Universitas Ciputra and was an IISMA 2023 scholar at NTU.

Ready to hire your AI teammate?

Set up in minutes. No credit card required.

Get started free