Slash Commands and Settings

The Cheat Sheet

slash commandsCLI flagssettings.jsoncustom commandsIDE plugins

Why this chapter exists#

Every user re-googles the same five things: how to resume a session, how to switch models mid-flight, where the settings file lives, how to write a custom slash command, and what /compact actually does. This chapter is the ten-minute version of that search history — a reference you scan, not a chapter you read. Bookmark it. You’ll come back.

Note on sources: command names and flags below are verified against the official Claude Code docs at docs.claude.com/en/docs/claude-code. Anything inferred from my own daily usage (rather than docs) is flagged as such inline.


1. CLI flags — what you actually launch with#

These are the invocations you’ll type a hundred times. Memorize the top five.

claude                              # interactive in current dir
claude --print "your prompt"        # headless / scriptable, prints answer and exits
claude --model opus                 # pin a model for this session (sonnet | opus | haiku)
claude --resume                     # pick from a list of past sessions and resume one
claude --continue                   # resume the most-recent conversation, no prompt
claude --no-update                  # skip the auto-update check on launch
claude --version                    # which CC am I running?
claude --help                       # the official menu (incomplete — not every flag is listed)

A few field notes:


2. Built-in slash commands — the daily set#

Inside an interactive session, type / and you get a fuzzy-search picker. These are the ones you’ll actually use.

/help — Lists everything available right now, including custom commands and plugin-provided ones. When you forget a command name, this is your first stop.

/init — Walks the current repo and generates a starter . Run this the first time you bring CC into a codebase. Then edit the result by hand — the auto-generated version is a draft, not a finished memory file.

/clear — Resets the context window without ending the session. Use this between unrelated tasks. Saves tokens and stops the model from “remembering” something it shouldn’t be reasoning over.

/compact — Summarizes the running history into a compact form, frees context space, and keeps continuity. Use this when you want to keep going on the same thread but you’re hitting context limits. /clear is amnesia; /compact is shorthand notes.

/cost — Running spend in this session. Token count and dollar estimate. Glance at it before you fire off a 30-tool-call swarm.

/model — Switch models mid-session. Sonnet is the workhorse. Flip to Opus for hard reasoning, refactors, architectural calls. Haiku for cheap bulk passes. The session keeps its context across the switch.

/agents — Manage definitions. Create a new one, edit an existing one, see which agents this repo and your home dir expose.

/mcp — List configured servers, their connection status, and basic management. When a connector is misbehaving, this is where you go first.

/hooks — See and edit configured (pre/post tool, session-start, etc.). Hooks are how you make CC do something every time a particular tool fires — log, lint, block, notify.

/plugins — Browse the plugin marketplace, install , see what’s currently loaded. Plugins bundle commands, agents, skills, and MCP servers into a single install.

/install-ide — Wire CC into your editor. VS Code, JetBrains family, Neovim. We expand on this in Section 7.

/login and /logout — Auth controls. Use /logout when you’re handing your laptop to someone else or switching between work and personal Anthropic accounts.

/exit or Ctrl-D — Leave the session. The session is auto-saved and resumable via claude --resume.


3. Custom slash commands — write your own in 60 seconds#

This is the highest-leverage feature in CC and almost nobody uses it. Drop a markdown file in ~/.claude/commands/<name>.md (personal, all repos) or <repo>/.claude/commands/<name>.md (repo-scoped, shared with your team via git). The filename is the command name.

---
name: morning-brief
description: Pull last 24h of Slack + HubSpot motion + post a canvas
---

Read the Slack MCP for #sales-pipeline and #ops messages overnight.
Pull HubSpot deal stage changes since yesterday 5pm.
Write a single Slack canvas to #morning-brief titled "Morning Brief — {{date}}".

Save that file. Restart CC (or it’ll pick it up live, depending on version). Now /morning-brief is available in any session — Claude reads the body of the file as the prompt.

What’s worth knowing:


4. Settings — the four files that matter#

There are exactly four files you need to know about. Everything else is cosmetics.

screenshot
A real `~/.claude/settings.json` with a few preferences set
Model default, theme, telemetry.
id: 14-cheat-sheet-1 · drop 14-cheat-sheet-1.png into public/screens/

5. Settings — common keys you’ll set#

Open ~/.claude/settings.json. Most setups end up looking like this:

{
  "model": "sonnet",
  "theme": "dark",
  "telemetry": false,
  "autoUpdater": "weekly",
  "permissions": {
    "allow": ["Bash(npm test*)", "Edit(src/**/*)"],
    "deny":  ["Bash(rm -rf*)", "WebFetch"]
  }
}

What each one does:

The repo-level .claude/settings.json overrides any of these per project. That’s where I lock down permissions tightly for the Belkins customer-data repos and leave them looser on Folderly’s marketing site.


6. The IDE plugins — /install-ide#

Run /install-ide from inside a session. It detects your editor and walks the install. Currently supported: VS Code, JetBrains (IntelliJ, PyCharm, WebStorm, the whole family), and Neovim.

What changes inside the editor once it’s wired:

JetBrains and VS Code are first-class. Neovim works but expect a slightly more bring-your-own-keymap experience.


7. Keyboard shortcuts you should learn#

Five keys cover 95% of session navigation. Ctrl-C interrupts the current generation without ending the session — useful when CC starts going down the wrong path and you want to redirect mid-stream. Ctrl-D (or typing /exit) leaves the session entirely. The ↑ arrow recalls your last prompt for editing — same muscle memory as your shell. Esc Esc (double-tap) undoes the last input you just sent. Shift-Enter inserts a newline without sending — essential for multi-line prompts and pasted code blocks.

Bonus muscle memory: Tab autocompletes file paths, / opens the slash-command picker, @ opens the file-reference picker.


8. Environment variables you’ll touch#

ANTHROPIC_API_KEY=sk-ant-...        # required when scripting headless / CI
CLAUDE_CONFIG_DIR=/opt/claude       # relocate ~/.claude (sandboxes, CI runners)
CLAUDE_MODEL=sonnet                 # per-shell default, overrides settings.json
MCP_SERVER_<NAME>_<KEY>=value       # per-server env passthrough into MCP processes

ANTHROPIC_API_KEY is what CI uses when there’s no interactive login. CLAUDE_CONFIG_DIR is how you sandbox CC inside a Docker container or move config to an encrypted volume. CLAUDE_MODEL lets you alias claude in different shells to different defaults (one terminal pinned to Opus for thinking work, another on Sonnet for everything else). MCP_SERVER_* vars get forwarded into the corresponding MCP server process — that’s how you pass secrets into HubSpot, Stripe, or whatever connector without putting them in .mcp.json.


9. Files & folders glance#

~/.claude/
├── settings.json          # global prefs
├── commands/              # custom slash commands (markdown)
├── agents/                # custom subagent definitions
├── skills/                # personal skills
└── plugins/               # installed plugin bundles

<repo>/
├── CLAUDE.md              # project memory
├── .mcp.json              # MCP servers (commit to git)
└── .claude/
    ├── settings.json      # repo overrides
    ├── agents/            # repo-shared subagents
    └── skills/            # repo-shared skills

Two rules: personal stuff lives under ~/.claude/, shared stuff lives under <repo>/.claude/ and gets committed. If you find yourself copying a custom command between machines manually, you put it in the wrong place — move it to a repo and commit.

The mental model: ~/.claude/ is your dotfiles. <repo>/.claude/ is a project README for Claude.


Closing line#

Print this chapter. Tape it next to your monitor. Stop re-googling.

Spotted something wrong, missing, or sharper? Email Vlad with feedback on this chapter →
Stay close

Edition 3 lands when this list says it does.

No course. No paywall. Operator playbooks weekly. 10K+ subscribers.