AI agents

Cheat sheets

Claude Code Cheat Sheet

Start

claude                # start interactive session
claude -c             # continue most recent conversation in this directory
claude --resume       # resume a session by ID/name, or pick interactively
claude "fix the bug"  # start with an initial prompt

Session

/clear              # clear conversation history (fresh context)
/compact [focus]    # compact conversation, optional focus instructions
/resume [session]   # resume an earlier conversation
/rewind             # roll code and conversation back to a checkpoint
/exit               # exit

Context

/init               # generate a starter CLAUDE.md
/memory             # open memory files in your editor
/context            # visualize context window usage

CLAUDE.md in the project root is loaded into context at launch. Commit it to git; it is the project’s standing instructions for Claude.

Planning

  • Press Shift+Tab to cycle permission modes into plan mode (read-only exploration).
  • Or run:
/plan [description]   # switch into plan mode

Review

/review [PR]        # fast single-pass read-only review of a GitHub PR
/code-review        # multi-agent diff review (--fix, --comment options)
/diff               # show uncommitted changes
git diff | claude -p "review this diff"   # review local changes non-interactively

Permissions

Permission modes: default (asks on first use), acceptEdits (auto-accept file edits), plan (read-only), auto (auto-approves with safety checks), dontAsk (denies unless pre-approved), bypassPermissions (no prompts).

/permissions        # manage allow/ask/deny rules
claude --permission-mode plan          # start in a specific mode
claude --dangerously-skip-permissions  # skip ALL permission prompts

Warning: --dangerously-skip-permissions / bypassPermissions skips every safety prompt. Use only in isolated environments (containers, VMs).

Configuration

~/.claude/settings.json          # user settings
.claude/settings.json            # project settings (commit to git)
.claude/settings.local.json      # local project settings (auto-gitignored)
/config [key=value]    # settings interface inside a session

MCP

# remote HTTP server
claude mcp add --transport http notion https://mcp.notion.com/mcp

# local stdio server — everything after -- goes to the server command
claude mcp add --transport stdio airtable -- npx -y airtable-mcp-server

claude mcp list        # list servers and connection health
/mcp    # in-session MCP server management panel

Non-interactive

claude -p "summarize this repo"                          # run once, print, exit
claude -p "query" --output-format json                   # machine-readable output
claude -c -p "follow-up"                                 # continue non-interactively

Full documentation → docs/claude-code/


Last verified: 2026-09-07

AI coding tools evolve quickly. If you find outdated information, please open an issue or pull request.