Shipmunks

Claude Code Cheat Sheet: Commands, Flags and Settings

Slash commands, CLI flags, settings keys, and file locations. Tables from 2.1.319. Signed-in checks on 2.1.321.

On this page
  1. The short answer
  2. Slash commands
  3. CLI flags
  4. Settings and config files
  5. CLAUDE.md and memory files
  6. Subagents, hooks and output styles
  7. Headless mode
  8. What we tested
  9. Download the sheet
  10. FAQ
  11. Sources
  12. Related

The short answer

The commands on this Claude Code cheat sheet include /help, /init, /memory, /config, /model, /compact, /clear, /agents, /hooks, and /output-style. The flags beside them include -p (--print), --model, --effort, --permission-mode, --output-format, --allowedTools, and --settings. User settings are ~/.claude/settings.json, shared project settings are .claude/settings.json, and standing instructions are CLAUDE.md.

Where Claude Code keeps your files. Your settings, the shared project file, a private project file, CLAUDE.md, and a memory folder per project. Hooks live in settings. Company policy wins. Checked November 9, 2026.

On November 9, 2026 I installed @anthropic-ai/claude-code 2.1.319 with npm install -g --prefix /tmp/cc-cli @anthropic-ai/claude-code. The binary was /tmp/cc-cli/bin/claude. claude --version printed 2.1.319 (Claude Code). claude --help exited 0. The Options section has 66 flags. The Commands section has 18 subcommands. The signed-in checks are in What we tested.

The other agent posts are on AI agents and tools.

Slash commands

Slash commands are names you type at the start of a message. The commands page, saved that day as commands.md (57,504 bytes), says type / to see what this session can run, and type letters after the slash to filter. A command is recognized only at the start. Text after the name is the arguments.

The All commands table has 121 rows. 20 are marked Skill. One row, /deep-research, is marked Workflow. Three say Removed: /pr-comments, /ultraplan, and /vim. The other 97 rows are unmarked. The 20 rows below are from those 97. The one-line purpose is shortened from the page. This is not a third-party list.

The skills page names six bundled skills in one sentence: /doctor, /code-review, /batch, /debug, /loop, and /claude-api. Those are prompts handed to Claude. They are not in the table below. /doctor is the in-session checkup. The shell command claude doctor is a different line, in the flags section.

20 built-in slash commands from the commands page, checked November 9, 2026. 121 rows in the full table.
CommandWhat it does
/helpShow help and available commands.
/initInitialize the project with a CLAUDE.md guide.
/memoryEdit CLAUDE.md files, and turn auto memory on or off.
/skillsList available skills.
/reload-skillsRe-scan skill and command directories without restarting.
/configOpen Settings. Alias /settings. key=value sets a key.
/statusStatus tab: version, model, account, and connectivity.
/modelSwitch the model. With no argument, opens a picker.
/effortSet the effort level: low to xhigh, max, or auto.
/contextVisualize current context usage.
/compactSummarize the conversation so far.
/clearStart a new conversation. Aliases /reset and /new.
/diffReview the working tree, including edits Claude has made.
/permissionsManage allow, ask, and deny rules.
/agentsReminder to edit .claude/agents/ or ~/.claude/agents/.
/hooksView hook configurations.
/output-styleList styles or switch. Requires v2.1.269 or later.
/statuslineConfigure the status line.
/resumeResume a conversation, or open the session picker.
/rewindRewind the conversation, the code, or both.

/permissions manages allow, ask, and deny rules. /sandbox is a different control: it turns on an OS boundary around Bash. How the Claude Code sandbox works shows the panel, the warning when socat is missing, and a write and a domain it blocked.

/mcp manages MCP server connections. The page says that running it with no argument opens the interactive list. In claude -p on November 10, 2026, /mcp exited 0 and printed 29 MCP server(s): 13 connected, 14 not connected, 2 not configured, 0 disabled. Registering a server is Add an MCP server to Claude Code. If Claude Code feels slow to start, timing 3 and 10 connected servers found servers were the biggest measured cost on one machine.

How a custom /name is a skill now, and where the file goes, is the Claude Code slash commands guide.

Claude Code slash commands Built-in commands, the skills merge, and three files checked with claude plugin validate. Guide

CLI flags

The program starts an interactive session by default. -p or --print is the non-interactive form. That is the first paragraph of claude --help on 2.1.319. The CLI reference is the docs page for the same flags. It says claude --help does not list every flag, so a missing help line is not proof the flag is gone. Every flag in this table is one the help text printed.

Help listed six choices for --permission-mode: acceptEdits, auto, bypassPermissions, manual, dontAsk, and plan. The CLI reference also accepts default, and says manual is an alias for default. Help on this install prints manual and does not print default.

Help lists --effort as low, medium, high, xhigh, or max. The CLI reference also lists ultracode. I am quoting the help line in the table.

12 flags from claude --help on Claude Code 2.1.319, November 9, 2026. Help printed 66 options.
FlagWhat the help says
-p, --printPrint response and exit.
-c, --continueContinue the most recent conversation in the current directory.
-r, --resumeResume a conversation by session ID or name, or open a picker.
--modelModel for this session. An alias such as fable, opus, or sonnet, or a full name.
--effortEffort level: low, medium, high, xhigh, or max.
--permission-modeacceptEdits, auto, bypassPermissions, manual, dontAsk, or plan.
--output-formatWith --print: text, json, or stream-json.
--allowedToolsTool names to allow. The long form --allowed-tools is the same flag.
--settingsA settings JSON file, or a JSON string, loaded in addition.
--add-dirExtra directories to allow tool access to.
-h, --helpDisplay help for command.
-v, --versionOutput the version number.

claude doctor is a subcommand, not a flag. Help says it checks the health of the installation and reads settings files in the current directory without a trust prompt. For a checkup that can also fix issues, help says to run /doctor in a session. In claude -p, /doctor exited 0 and reported that the audit was mostly blocked outside the project folder.

The Commands section lists 18 subcommands: agents, attach, auth, auto-mode, doctor, gateway, import, install, logs, mcp, plugin, purge, respawn, rm, setup-token, stop, ultrareview, and update. plugins is an alias of plugin. kill is an alias of stop. upgrade is an alias of update.

Settings and config files

Claude Code reads settings from JSON files. The settings page, checked November 9, 2026, names four of them, plus managed delivery from the claude.ai console.

Where Claude Code keeps your files. Your settings, the shared project file, a private project file, CLAUDE.md, and a memory folder per project. Hooks live in settings. Company policy wins. Checked November 9, 2026.
File locations from the settings, memory, subagents, output styles, and hooks docs. Checked November 9, 2026.
Settings files and who they affect, from the settings page, November 9, 2026.
ScopeFileWho it affects
User~/.claude/settings.jsonYou, in every project on this machine.
Shared project.claude/settings.jsonEveryone in that folder. Commit it so teammates get it.
Project local.claude/settings.local.jsonYou, in this one project. Add it to .gitignore if you create it by hand.
Managedmanaged-settings.jsonEveryone your organization deploys it to. Other managed sources exist too.

On Windows, ~/.claude means %USERPROFILE%\.claude. To put the home-directory files somewhere else, set CLAUDE_CONFIG_DIR. Claude Code then stores settings, session history, and plugins there.

Precedence, highest first, from that page: managed settings, command line, project local, shared project, user. Command line means JSON you pass with --settings for that session. A flag such as --model is not a level in that stack. The page says a key at a higher level overrides the same key lower down. Environment variables are not a level. Which one wins, for a key that also has a shell variable, is decided per pair.

~/.claude.json is a fifth file. The page says Claude Code writes it, and you do not need to edit it. It holds account details, per-project state such as trust decisions, and the global config keys that /config writes.

The settings reference index lists 248 keys. I counted the rows. These seven are the ones a printed sheet needs. Each description is shortened from that index. Each of these seven says scope Any file, which means user, project, local, and managed.

Seven settings keys from the settings reference index, November 9, 2026. The index lists 248 keys.
KeyWhat the index says
modelThe model new sessions start with.
effortLevelDefault effort for models without a saved level of their own.
languageHave Claude respond in a language other than English.
outputStyleRole, tone, and output format.
permissionsAllow, ask, and deny rules, and the default permission mode.
statusLineYour own command for a status line below the prompt.
hooksYour own commands at points in the lifecycle.

statusLine is the object the status line post saves. The default on the index is unset, so there is no custom line until you set one.

The script, the sample JSON, and the Windows notes are in the statusline post.

/config opens Settings. /status opens the same dialog on the Status tab, which lists the settings sources the session loaded. The settings page says that line shows which files were read. It does not show which file supplied each key.

CLAUDE.md and memory files

CLAUDE.md is the markdown file of standing instructions. The memory page, checked November 9, 2026, lists the launch files from the broadest scope to the most specific. They are concatenated. A later file does not erase an earlier one.

CLAUDE.md locations from the memory page, November 9, 2026.
ScopePath
Managed, macOS/Library/Application Support/ClaudeCode/CLAUDE.md
Managed, Linux and WSL/etc/claude-code/CLAUDE.md
Managed, WindowsC:\Program Files\ClaudeCode\CLAUDE.md
User~/.claude/CLAUDE.md
Project./CLAUDE.md or ./.claude/CLAUDE.md
Local./CLAUDE.local.md

The page says to add CLAUDE.local.md to .gitignore. Ancestor copies, in folders above the working directory, load at launch. A CLAUDE.md in a subfolder loads when Claude reads a file there. /init can draft a starting file.

A project CLAUDE.md that said to end every reply with DONE was applied by claude -p on November 10, 2026. The reply to “What is 2+2?” was 4, then DONE on its own line. With the file moved aside, the same prompt replied 4 and stopped. Asked to quote the rule, the model quoted it and then wrote DONE.

Auto memory is a different folder. The page says it is on by default in local sessions, and names cases where a session starts with it off. Each project gets a memory folder under ~/.claude/projects/, named from the git repository. The folder holds MEMORY.md, an index, and one topic file per memory. autoMemoryDirectory in a settings file stores that folder somewhere else. /memory lists the CLAUDE.md files and can toggle auto memory. In claude -p, /memory exited 0 and printed /memory isn't available in this environment. In the interactive session it opened a menu of user instructions and project instructions.

What to put in the project file, from 100 public copies, is how to write a claude.md file.

claude.md file: how to write one Where CLAUDE.md loads, what 100 public root files contain, and a blank template. Guide

Subagents, hooks and output styles

A subagent is a markdown file in .claude/agents/ or ~/.claude/agents/. Claude Code subagents is the file format, and when a rule belongs in CLAUDE.md instead.

A hook is a command, prompt, HTTP call, or other handler on the hooks key of a settings file. User, project, and local settings can each hold hooks. /hooks views that configuration. The event list is the hooks reference.

An output style is a built-in name, or a markdown file in .claude/output-styles/ or ~/.claude/output-styles/. Claude Code output styles is the built-in list and a custom file. The output styles page saved on November 9, 2026 matched the copy from November 7. On Claude Code 2.1.321, /output-style listed five built-ins: default, Proactive, Concise, Explanatory, and Learning. /output-style Pirate printed Output style set to Pirate and wrote .claude/settings.local.json with "outputStyle": "Pirate".

Headless mode

Headless, in the docs URL, is a non-interactive run. Help on 2.1.319 does not use that word. It says the CLI starts an interactive session by default, and -p or --print prints a response and exits. --output-format json is one of the three formats help lists for that flag.

On November 10, 2026, claude -p "Reply with the word ok" printed ok and exited 0. --output-format json put ok in result, with num_turns 1. The object includes total_cost_usd. This page does not print that value. --max-turns 1 on a prompt that had to run a tool exited 1 with subtype error_max_turns and num_turns 2. Without stdin closed, the CLI waits 3 seconds and warns on stderr.

The longer flag list, the JSON, and a workflow that was checked and not executed are in Claude Code headless mode.

A status line is a script in settings, and it does not run under claude -p. After the folder was trusted, an interactive session rendered [Fable 5.2] plus the directory name and the working directory. The settings section above links the script.

Claude Code headless mode claude -p, the flags that matter for a script, and a GitHub Actions workflow that was checked and not run. Guide

What we tested

Checked

Tested November 10, 2026 with Claude Code 2.1.321, model Fable 5.2, on Ubuntu 26.04, signed in with a claude.ai account. claude auth status reported loggedIn true and authMethod claude.ai. The default model id was claude-fable-5-2. The runs were not a clean lab: a user-level CLAUDE.md, about 29 MCP servers, skills, and plugins loaded. This page does not quote a dollar cost from those calls.

CheckResult
claude -p "Reply with the word ok"exit 0, stdout ok
--output-format jsontype result, subtype success, result ok, num_turns 1
--max-turns 1 on a tool promptexit 1, error_max_turns, num_turns 2
/hello worldARGS_RECEIVED=[world]
/help in -pexit 0, not available in that environment
/model in -pCurrent model: Fable 5.2 (default)
/cost on a claude.ai loginplan usage, not dollars
/output-styledefault, Proactive, Concise, Explanatory, Learning
status line under -pthe calls log was never created
status line after trust[Fable 5.2] plus the directory and the working directory
project CLAUDE.md in -preplies ended with DONE; the control without the file did not

Not tested: /init, /login, /logout, /review, --bare, stream-json without --verbose, and claude doctor the subcommand. The 121-row commands table was not re-counted on November 10. The flag table is still the November 9 help text from 2.1.319.

Download the sheet

The Claude Code cheat sheet (Markdown) is the same commands, flags, keys, and paths, in one file you can print or paste. The other downloads are on Templates.

The slash-command files from October 31, 2026, including the three starter skills, stay with the slash commands guide. They are a quick reference for custom /name files. They are not this sheet.

FAQ

Where is the settings file?

User settings are ~/.claude/settings.json. On Windows, ~/.claude means %USERPROFILE%\.claude. Shared project settings are .claude/settings.json. Personal overrides for one project are .claude/settings.local.json. The settings page, checked November 9, 2026, lists precedence highest first: managed settings, then command line, then project local, then shared project, then user. Command line here means JSON passed with --settings for that session. Claude Code also writes ~/.claude.json for itself.

How do I see all commands?

Type / at the start of a message. The commands page, checked November 9, 2026, says that lists what this session can run, and letters after the slash filter it. Not every command appears for every user. In an interactive session, /help opens a Help dialog. In claude -p, /help exits 0 and prints that it is not available in that environment. Outside a session, claude --help prints CLI flags and subcommands, not that menu. The All commands table on November 9 had 121 rows. This Claude Code cheat sheet prints 20 of the built-in rows.

Which version is this for?

The command and flag tables were taken from Claude Code 2.1.319 on November 9, 2026. claude --version that day printed 2.1.319 (Claude Code). The commands, CLI, settings, memory, hooks, subagents, output styles, headless, and skills docs were downloaded the same day. A signed-in session on November 10, 2026 used Claude Code 2.1.321 and model Fable 5.2. A later release can add a command this Claude Code cheat sheet does not list.

Sources

  1. Commands (Claude Code Docs) Checked
  2. CLI reference (Claude Code Docs) Checked
  3. Settings files and precedence (Claude Code Docs) Checked
  4. All settings (Claude Code Docs) Checked
  5. How Claude remembers your project (Claude Code Docs) Checked
  6. Hooks reference (Claude Code Docs) Checked
  7. Create custom subagents (Claude Code Docs) Checked
  8. Output styles (Claude Code Docs) Checked
  9. Run Claude Code programmatically (Claude Code Docs) Checked
  10. Extend Claude with skills (Claude Code Docs) Checked