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
DISABLE_AUTOUPDATER=1 claude        # 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 — Opens the Agent View dashboard for live background sessions (the old /agents creation wizard was removed in v2.1.198; subagent definitions are markdown files in .claude/agents/ or ~/.claude/agents/).

/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.

/ide — Wire CC into your editor. VS Code and the JetBrains family are supported. We expand on this in Section 6.

/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.


2b. May 2026 surface — what shipped since Edition 1#

The command surface moved roughly ten entries in 90 days. The ones below are the additions and material updates between February and May 2026 — verified against the official changelog where noted, flagged otherwise.

The command surface moved 10 entries in 90 days. Check your version (claude --version) before relying on any specific one — the names sometimes outlive the implementations and vice versa.


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.

A real `~/.claude/settings.json` with a few preferences set
A real `~/.claude/settings.json` with a few preferences set Model default, theme, telemetry.

5. Settings — common keys you’ll set#

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

{
  "model": "sonnet",
  "theme": "dark",
  "autoUpdatesChannel": "stable",
  "env": {
    "DISABLE_TELEMETRY": "1"
  },
  "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 — /ide#

Run /ide from inside a session. It detects your editor and connects the integration. Currently supported: VS Code (and forks like Cursor/Windsurf) and JetBrains (IntelliJ, PyCharm, WebStorm, the whole family).

What changes inside the editor once it’s wired:

JetBrains and VS Code are first-class via /ide.


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)
ANTHROPIC_MODEL=opus                # per-shell default, overrides settings.json

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. ANTHROPIC_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). For MCP server secrets, .mcp.json expands ${VAR} and ${VAR:-default} directly inside command, args, env, url, and headers — that’s how you pass secrets into HubSpot, Stripe, or whatever connector without putting raw keys 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

The next edition lands when this list says it does.

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