Skip to main content
Every CLI flag and keyboard shortcut organized by workflow.

Startup Flags

claude                       # New session
claude --continue            # Continue last session
claude --resume              # Pick from recent sessions
claude --from-pr 123         # Start from a PR's context
claude --session-id <id>     # Resume specific session
claude --fork-session <id>   # Fork an existing session
claude --system-prompt "You are a Go expert"
claude --system-prompt-file ./prompts/go.md
claude --append-system-prompt "Also run tests after changes"
claude --agent researcher        # Run with specific agent
claude --agents '{"name":"researcher","tools":["Read","Grep"]}'
claude --teammate-mode           # Launch as a teammate in agent teams
claude --permission-mode plan    # Force plan mode
claude --allowedTools Read,Grep  # Whitelist specific tools
claude --disallowedTools Bash    # Blacklist tools
claude --print "explain this code"      # One-shot, no interactive
claude --output-format json             # JSON output for scripting
claude --json-schema '{"type":"object"}'  # Structured output
claude --verbose                        # Debug output
claude --max-budget-usd 5.00    # Cap spending
claude --max-turns 50           # Limit conversation turns
claude --worktree        # or -w: auto-create git worktree
claude --add-dir ../lib  # Add extra directory to context
claude --mcp-config ./mcp.json     # Load MCP config
claude --strict-mcp-config         # Fail if MCP server errors
claude --plugin-dir ./my-plugin    # Load a plugin directory
claude --chrome           # Enable Chrome integration
claude --no-chrome        # Disable Chrome integration
claude --ide vscode       # Set IDE context

Keyboard Shortcuts

KeyAction
EnterSubmit prompt
Shift+TabCycle modes (Normal > Auto > Plan)
Ctrl+CCancel current generation
Ctrl+LClear screen
Ctrl+BSend current task to background
Ctrl+FKill all background agents (two-press)
Up/DownNavigate prompt history
Esc EscRewind to last checkpoint
Use Shift+Tab to quickly cycle between Normal, Auto, and Plan modes during a session.

Slash Commands

CommandPurpose
/clearReset conversation
/compactCompress context (do at task boundaries)
/contextShow context window usage
/resumeResume a previous session
/renameRename current session
/costShow session cost (API key users)
/usageCheck plan limits
/extra-usagePay-as-you-go overflow billing

Scripting Patterns

One-Shot Execution

echo "explain this error" | claude --print

Capture Session ID

SESSION_ID=$(claude --output-format json --print "fix the bug" | jq -r '.session_id')
claude --session-id "$SESSION_ID" --print "now add tests"

Budget-Controlled CI

claude --max-budget-usd 2.00 --max-turns 20 --print "review this PR"
Use --output-format json to chain commands and pass session IDs between scripts.

Pro Tips

ultrathink

Add ultrathink in your prompt to trigger maximum reasoning effort

/doctor

Diagnoses config issues — run when things feel off

Manual /compact at 50%

Prevents the “agent dumb zone” near capacity

/rename Sessions

Easier to find with /resume later

claude -w

Faster than manually creating worktrees

Voice Mode

/voice — hold spacebar, speak, release to transcribe

Build docs developers (and LLMs) love