Skip to content

Searchable reference for Claude Code commands, shortcuts, settings, hooks and MCP, plus Claude API essentials.

Loading tool

About Claude Cheat Sheet

A searchable reference for Claude Code and the Claude API. It covers installing and resuming sessions, CLI flags, headless print mode for scripts and CI, slash commands, keyboard shortcuts, CLAUDE.md memory, settings and permission rules, hooks, MCP servers, subagents, skills, plugins and environment variables. An API part lists current model IDs, Messages API headers, adaptive thinking and effort, prompt caching, tool use, structured outputs and SDK install commands. You can filter by topic, search by name or purpose, and copy any entry.

Common uses

  • Find the slash command or shortcut for compacting, rewinding or resuming a session
  • Copy a permission rule or hook config for settings.json
  • Add an MCP server with the right transport and scope
  • Run Claude Code non-interactively in CI with print mode
  • Look up a current Claude model ID or API header

FAQ

How do I resume a previous Claude Code session?
Run 'claude -c' to continue the most recent conversation in the current directory, or 'claude -r' to pick a session. Inside a session, /resume opens the same picker.
What is the difference between /clear and /compact?
/clear starts a fresh conversation with an empty context. /compact keeps the conversation but replaces its history with a summary, optionally focused on what you name, to free up context.
Where do Claude Code settings and CLAUDE.md files go?
User settings live in ~/.claude/settings.json, shared project settings in .claude/settings.json and personal project settings in .claude/settings.local.json. Project instructions go in CLAUDE.md at the repository root, and personal ones in ~/.claude/CLAUDE.md.
How do I use Claude Code in a script or CI pipeline?
Use print mode: 'claude -p "your prompt"' runs once and exits. Add --output-format json for machine-readable output and --allowedTools to pre-approve only the tools the job needs.