You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use /mcp to connect servers and inspect the commands they expose. Reconnect picks up .mcp.json edits without restarting Claude Code.
CLI Commands and Flags
Core CLI Commands
Command
Purpose
claude
Start interactive Claude Code
claude agents
Open agent view: running, blocked, and completed Claude Code sessions
claude agents --json
List active Claude Code sessions as JSON, including blocked and just-dispatched sessions, with id and state fields
claude agents --json --all
Include completed sessions in the JSON agent list
claude agents then ! <command>
Start a shell command as a background session you can attach to or detach from
claude "prompt"
Start with an initial prompt
claude -p "prompt"
Run a non-interactive single prompt
claude --bg --exec '<command>'
Run a shell command as a background Claude session
claude -c
Continue the last conversation
claude -r "name"
Resume a named session
claude update
Update Claude Code
claude mcp list
List MCP servers
claude mcp serve
Run Claude Code as an MCP server
claude plugin init <name>
Scaffold a new plugin in .claude/skills
claude plugin details <name>
Show plugin components and projected per-session token cost
claude plugin tag
Create release git tags for plugins with version validation
claude plugin marketplace remove <name> --scope user|project|local
Remove a marketplace from a selected configuration scope
Important Flags
Flag
Purpose
--add-dir
Add an extra directory to scope
--agent
Select an agent
--allowedTools
Pre-approve tools
--bare
Minimal headless mode
--channels
Enable channel/MCP push relay
--chrome
Enable Chrome integration mode
--console
Use Anthropic Console auth
--dangerously-skip-permissions
Skip permission prompts
--effort
Set reasoning effort
--exclude-dynamic-system-prompt-sections
Improve print-mode cross-user prompt caching
--fallback-model
Continue the session with a configured fallback when the primary model is unavailable
--json-schema
Request structured output
--max-budget-usd
Cap spend
--max-turns
Limit turns
--mcp-config
Use a specific MCP config for dispatched background sessions
--model
Set the model
-n, --name
Name the session
--output-format
Set machine-readable output
--permission-mode
Set permission behavior
--plugin-dir
Use a plugin directory for dispatched background sessions
--plugin-url <url>
Fetch a plugin .zip archive from a URL for the current session
-r
Resume a session
--remote
Start a remote/web-backed session
--remote-control-session-name-prefix
Prefix Remote Control session names
--safe-mode
Start Claude Code with customizations disabled for troubleshooting
--settings
Load settings for dispatched background sessions
--tools
Explicitly allow tools; Grep and Glob now map to the dedicated native search tools on builds that include embedded search
--transport http|stdio|sse
Select MCP transport
--verbose
Enable verbose output
-w, --worktree
Use a git worktree
Environment Variables
Variable
What it does
CLAUDE_CODE_CERT_STORE=bundled
Uses bundled CAs only instead of the OS certificate store
CLAUDE_CODE_DISABLE_BUNDLED_SKILLS
Hides bundled skills, workflows, and built-in slash commands from the model
CLAUDE_CODE_ENABLE_AUTO_MODE=1
Enables Auto mode on Bedrock, Vertex, and Foundry for supported Opus 4.7 and Opus 4.8 setups
CLAUDE_CODE_ENABLE_FEEDBACK_SURVEY_FOR_OTEL
Re-enables the session quality survey for enterprises capturing responses through OpenTelemetry
CLAUDE_CODE_PERFORCE_MODE=1
Makes Edit/Write/NotebookEdit fail on read-only Perforce files with a p4 edit hint
CLAUDE_CODE_SAFE_MODE
Starts Claude Code with customizations disabled for troubleshooting
CLAUDE_CODE_SCRIPT_CAPS
Limits per-session script invocations
CLAUDE_CODE_USE_MANTLE=1
Enables Amazon Bedrock powered by Mantle
DISABLE_UPDATES
Completely blocks all update paths, including manual claude update; stricter than DISABLE_AUTOUPDATER
CLAUDE_CODE_SESSION_ID
Session ID
CLAUDE_CODE_USE_POWERSHELL_TOOL
Opts into or out of the PowerShell tool rollout; on Linux and macOS, set it to 1 when pwsh is available
CLAUDE_CODE_FORCE_SYNC_OUTPUT=1
Forces synchronized output on terminals where auto-detection misses it, such as Emacs eat
CLAUDE_CODE_DISABLE_ALTERNATE_SCREEN=1
Opts out of the fullscreen alternate-screen renderer and keeps the conversation in the terminal's native scrollback
CLAUDE_CODE_PACKAGE_MANAGER_AUTO_UPDATE
Lets Homebrew or WinGet installations run package-manager upgrades in the background, then prompt for restart
CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY=1
Enables gateway /v1/models discovery for the /model picker
OTEL_LOG_TOOL_DETAILS=1
Adds tool parameters such as Bash commands and MCP or skill names to tool decision telemetry events
OTEL_RESOURCE_ATTRIBUTES
Adds custom labels to OpenTelemetry metric datapoints, such as team or repository labels
Remote Control, /schedule, Claude.ai MCP connectors, and notification preferences are disabled when ANTHROPIC_API_KEY, apiKeyHelper, or ANTHROPIC_AUTH_TOKEN is set.
Real Workflows
Start a New Repository
/init
/status
/model
Onboard a New Teammate
/team-onboarding
/init
/memory
Understand an Unfamiliar Codebase
/status
/context
/plan map the project structure and main entry points
Work Toward a Clear Goal
/goal fix the failing checkout test and stop after tests pass
/context
/review
Review a Pull Request
/review
/security-review
/pr-comments
/diff
Prepare a Safe Refactor
/review
/plan refactor the auth flow without changing behavior
/diff
claude plugin details plugin-name
/plugin
/context
Run a Headless One-Off Task
claude -p "review this diff and list risks"
Run a Deep Cloud Review
/review
/ultrareview
/pr-comments
Reduce Repetitive Permission Prompts
/less-permission-prompts
/permissions
/hooks
Internal, Experimental, Removed, and Community Commands
These commands are preserved for completeness. Do not treat this section as a guarantee that a command works in every public build.
Command
Category
Typical role
/advisor
Leak-based
Architecture or design advice
/ant-trace
Internal
Internal tracing
/autofix-pr
Internal / leak-based
Auto-fix PR issues
/backfill-sessions
Internal / leak-based
Backfill session data
/brief
Leak-based
Brief output mode
/bridge
Leak-based
IDE or bridge session manager
/bridge-kick
Leak-based
Force-restart bridge connection
/bughunter
Leak-based
Bug-finding workflow
/buddy
Limited / non-essential
Temporary April 1st command
/commit
Community
Generate a commit message and commit changes
/commit-push-pr
Leak-based / community
Commit, push, and create a PR
/ctx_viz
Internal / leak-based
Debug context visualization
/debug-tool-call
Internal / leak-based
Debug a tool call
/env
Leak-based
Environment inspection
/files
Leak-based
List files in current context
/fix-pipeline
Community
Repair failing CI pipelines
/good-claude
Leak-based
Easter egg command
/heapdump
Internal / leak-based
Dump heap for memory analysis
/init-verifiers
Leak-based
Set up verifier hooks
/install
Internal / leak-based
Install or update flow
/issue
Leak-based
File a GitHub issue
/lint
Community
Run linting commands
/merge-to-main
Community
Merge-to-main workflow
/mobile
Leak-based
Mobile integration or handoff
/mock-limits
Internal / leak-based
Mock rate limits
/oauth-refresh
Leak-based
Refresh OAuth tokens
/onboarding
Leak-based
First-run onboarding
/passes
Leak-based
Multi-pass workflow
/perf-issue
Internal / leak-based
Report performance issue
/pr
Community
Create a pull request
/pr_comments
Internal
Internal form of /pr-comments
/privacy-settings
Leak-based
Privacy settings
/push
Community
Push current branch
/rate-limit-options
Leak-based
Rate-limit options
/remote-setup
Leak-based
Remote setup flow
/reset-limits
Internal / leak-based
Reset rate limits
/sandbox-toggle
Internal
Internal sandbox toggle
/session
Leak-based
Session management UI
/share
Leak-based
Share a session
/statusline
Leak-based
Customize status line
/summary
Leak-based
Generate a session summary
/tag
Removed
Legacy tag command
/tasks
Leak-based
Manage background tasks
/terminalSetup
Internal
Internal form of /terminal-setup
/thinkback
Internal / leak-based
Replay or analyze thinking
/thinkback-play
Internal / leak-based
Animated thinking replay
/ultraplan
Leak-based
Detailed planning workflow
/upgrade
Leak-based
Upgrade flow
/version
Leak-based
Show version
/vim
Removed
Old Vim-mode slash command
/vitest
Community
Run Vitest-based test workflows
/x402
Internal / leak-based
x402 integration
Notes
/vim was removed in v2.1.92. Use /config for editor mode settings.
/tag was removed in v2.1.92.
As of v2.1.118, /cost and /stats are merged into /usage; both still work as shortcuts.
/simplify now runs a cleanup-only review and applies simplification, reuse, efficiency, and structure fixes. Use /code-review --fix when you want bug-hunting fixes.
/extra-usage was renamed /usage-credits; the old command remains an alias.
The old CLAUDE_CODE_OPUS_4_6_FAST_MODE_OVERRIDE path is now a no-op.
If you customized the old modelPicker:setAsDefault keybinding, rename it to modelPicker:thisSessionOnly; the d action was replaced by s.
The dynamic workflow trigger keyword was renamed from workflow to ultracode; use /workflows to view larger background runs.
Managed settings can now set requiredMinimumVersion and requiredMaximumVersion so Claude Code refuses to start outside an approved version range.
disableBundledSkills and CLAUDE_CODE_DISABLE_BUNDLED_SKILLS can hide bundled skills, workflows, and built-in slash commands from the model.
Sources
Claude Code changelogs through v2.1.169
Local command reference notes and leak-based command lists
Related Resources
awesome-claude-code: curated tools, workflows, integrations, and resources for Claude Code users