# Claude Code CLI cheat sheet > Every Claude Code command, permission mode, and config file from Todd Greco’s meetup talk, on one page and kept current. Source: https://mrballistic.com/claude-code-cli-cheatsheet/ · Author: Todd Greco (https://mrballistic.com) · Updated 2026-10-27 ## Install and launch - `curl -fsSL https://claude.ai/install.sh | bash`: macOS, Linux, WSL - `brew install --cask claude-code`: Homebrew - `irm https://claude.ai/install.ps1 | iex`: Windows PowerShell - `claude`: Start an interactive session - `claude "fix the failing test"`: Start with a first prompt - `claude -c`: Continue the most recent conversation - `claude -r auth-refactor`: Resume a session by name or ID - `claude -p "explain this repo"`: Print one answer and exit (scripts, CI) - `cat error.log | claude -p "what broke?"`: Pipe input into a one-shot query - `claude --version`: Check the installed version ## Slash commands - `/init`: Write a starter CLAUDE.md from your codebase - `/help`: List every command - `/model`: Switch models - `/effort`: Set how hard the model thinks - `/context`: See what’s filling the context window - `/compact`: Summarize the conversation to free up context - `/clear`: Start fresh in the same session - `/resume`: Pick up an earlier session - `/rewind`: Roll back the conversation and file edits to an earlier point - `/btw`: Ask a side question without adding it to the context - `/code-review`: Review pending changes (alias /review); add --fix to apply - `/usage`: Session cost, plan limits, activity (alias /cost) - `/memory`: Edit the CLAUDE.md files in play - `/powerup`: Interactive lessons on features you haven’t tried - `/doctor`: Diagnose your install and settings ## Keyboard shortcuts - Shift+Tab: Cycle permission modes - Esc: Interrupt Claude or close a dialog - Esc Esc: Clear the draft, or open rewind when it’s empty - Ctrl+R: Search prompt history - Ctrl+B: Send a running task to the background - Ctrl+O: Open the full transcript - Ctrl+G: Edit the prompt in your $EDITOR - Option+P: Switch model (Alt+P on Windows/Linux) - Option+T: Toggle extended thinking (Alt+T) - Option+O: Toggle fast mode (Alt+O) ## Permission modes - Manual (`--permission-mode default`): Asks before edits and commands. Use when: Learning a codebase, or anything risky. - Edit automatically (`--permission-mode acceptEdits`): Edits files and runs basic file commands (mkdir, mv, cp) without asking; asks for everything else. Use when: You trust the edits but want to see commands. - Plan (`--permission-mode plan`): Reads and plans; no edits until you approve the plan. Use when: Before a big change, or to understand code. - Auto (`--permission-mode auto`): A classifier reviews each action and blocks risky ones; no prompts for the rest. Use when: Well-scoped work with a good CLAUDE.md. - Don’t ask (`--permission-mode dontAsk`): Runs only pre-approved tools; denies anything that would prompt. Use when: Scripts and CI with an allowlist. - Bypass permissions (`--dangerously-skip-permissions`): No prompts, no checks. Deny rules still apply.. Use when: Throwaway containers and VMs only. - `claude --permission-mode auto`: Interactive - `claude -p "run the tests and fix failures" --permission-mode auto`: Headless ## CLAUDE.md A markdown file Claude reads at the start of every session: what the project is, how to build it, and what not to touch. Run /init to draft one. - `./CLAUDE.md`: Project, committed with the repo (or ./.claude/CLAUDE.md) - `./CLAUDE.local.md`: Project, just for you (gitignored) - `~/.claude/CLAUDE.md`: You, across every project - `.claude/rules/*.md`: Topic rules, optionally scoped to paths ## Skills A folder with a SKILL.md: instructions, and optionally scripts and reference files. Claude loads one when its description matches the task, or you run it as /skill-name. - `.claude/skills//SKILL.md`: This project - `~/.claude/skills//SKILL.md`: Every project ## Plugins - Superpowers (https://github.com/obra/superpowers): Makes Claude brainstorm, plan, and test before it writes code, then review before it ships. Install: `/plugin install superpowers@claude-plugins-official` - Impeccable (https://impeccable.style): Gives Claude a design vocabulary: critique a page, audit it for accessibility, then polish, simplify, or push it bolder. Install: `/plugin marketplace add pbakaus/impeccable`, then `/plugin install impeccable@impeccable` ## MCP servers - `claude mcp add --transport http my-server https://api.example.com/mcp`: Remote (HTTP) - `claude mcp add --transport stdio my-server -- npx -y my-mcp-server`: Local process (stdio) - `claude mcp add-json my-server '{"type":"stdio","command":"npx","args":["-y","my-mcp-server"]}'`: From JSON - Local scope ((default)): stored in `~/.claude.json`; You, in this project only - Project scope (--scope project): stored in `.mcp.json`; Everyone on the repo (commit it) - User scope (--scope user): stored in `~/.claude.json`; You, in every project - GitHub: `claude mcp add --transport http github https://api.githubcopilot.com/mcp/ --header "Authorization: Bearer YOUR_GITHUB_PAT"` - Playwright: `claude mcp add playwright -- npx @playwright/mcp@latest` - Context7: `claude mcp add --transport stdio context7 -- npx -y @upstash/context7-mcp` - Brave Search: `claude mcp add --transport stdio --env BRAVE_API_KEY=YOUR_KEY brave -- npx -y @brave/brave-search-mcp-server` - Filesystem: `claude mcp add --transport stdio filesystem -- npx -y @modelcontextprotocol/server-filesystem ~/notes` - Sequential Thinking: `claude mcp add --transport stdio thinking -- npx -y @modelcontextprotocol/server-sequential-thinking` ## Hooks Commands that run on Claude Code events, every time, whatever the model decides. Configure them in .claude/settings.json or with /hooks. - SessionStart: When a session starts or resumes - UserPromptSubmit: Before Claude sees your prompt - PreToolUse: Before a tool runs (can block it) - PermissionRequest: When a permission prompt would appear - PostToolUse: After a tool succeeds - Notification: When Claude needs your attention - Stop: When Claude finishes responding - PreCompact: Before the context is compacted ## Subagents Claude can hand work to subagents. Each gets its own context window, tools, and instructions, and returns only a summary, so your main context stays clean. - Explore: Fast, read-only search across the codebase - Plan: Research for plan mode - general-purpose: Multi-step tasks that need every tool ## Links - [Claude Code docs](https://code.claude.com/docs): Commands, settings, and guides - [Permission modes](https://code.claude.com/docs/en/permission-modes): Every mode and how auto mode decides - [Superpowers](https://github.com/obra/superpowers): Jesse Vincent’s methodology plugin - [Impeccable](https://impeccable.style): Paul Bakaus’s design skill - [awesome-claude-code](https://github.com/hesreallyhim/awesome-claude-code): Community skills, hooks, and plugins - [anthropics/skills](https://github.com/anthropics/skills): Official skills from Anthropic - [Model Context Protocol](https://modelcontextprotocol.io): The spec and SDKs - [MCP servers](https://github.com/modelcontextprotocol/servers): Reference servers and a directory of others