Small commands that make Claude Code faster every day.
The first character you type tells Claude what kind of input this is.
/help, /resume, /init, /cost.! git status, ! npm test, ! ls -la.@src/auth.py, @README.md, @tests/.# we use pnpm, not npm, # tests live in __tests__/.! git log -5 then @src/handler.py then "why did these commits touch this file?"
Heads up on !: it runs non-interactively — no TTY, so sudo password prompts hang. Use passwordless sudo (NOPASSWD) for specific safe commands, or run privileged steps outside the Claude session.
Every session is saved. You almost never need a fresh start.
claude -c continues the last session in this folder.claude -r opens a picker. Type to filter.claude --from-pr 1234 opens the session linked to that PR./resume opens the same picker./export saves the chat to a file./cost shows what this session has cost so far.claude -c.
The picker is full of "untitled" sessions. Three seconds to name one saves you ten minutes later.
> /rename auth-bugfix
Sets the name. Shown in the prompt box,
the picker, and your terminal title.
> /rename
Claude reads the chat and suggests a name.
Confirm or edit. Good when you forgot to
name it at the start.
You can also pass -n <name> when you start: claude -n "caching spike".
When five Claudes run in five terminal windows, color is how you tell them apart at a glance. No more pasting code into the wrong repo.
> /color cyan
> /color #FF6699
Sets the color of the prompt box.
Takes color names or hex codes.
> /color
Picks a color for you. Run it again
if you don't like the one you got.
/rename and /color. Two seconds, saves you all day.
Defaults are fine. Knowing when to switch saves money and time.
Switch any time: /model haiku for simple stuff, /model opus for hard bugs and design.
Five levels: low, medium, high, xhigh, max. Higher means slower and pricier, but smarter.
Toggle on. Same Opus, less waiting. No quality loss.
/model opus + /effort high. Easy task? /model haiku.
When a session gets long and slow, you have two options.
Throw it away.
Summarize and keep going.
/export first.
Drop the right file, Claude loads it on every session. Stop explaining the same thing every day.
/memory.# your note to save fast — Claude asks repo or global. /init to bootstrap an AGENTS.md. @path/to/file.md inside any rules file to import another. Correcting Claude a third time? It belongs in the file.
If you only write one rules file, write AGENTS.md. It works in Claude, Cursor, Aider, and others. It lives in git and gets reviewed in PRs.
~/.claude/CLAUDE.md).# AGENTS.md
## Testing
- pytest, not unittest. Mock HTTP with respx.
- Integration tests hit a real DB, never a mock.
## Naming
- Files: snake_case.py. Classes: PascalCase.
- Internal CLI tool: `aihub-ci` (not `ci-helper`).
## Tone
- No em dashes. Use periods or middle dots.
- Spell out tool names: "Dependency Track", not "DT".
## Architecture
- See `docs/architecture.md` for the data flow.
AGENTS.md when Claude makes the same mistake twice. The third time it should already know.
By default Claude asks before every change. Press Shift+Tab to cycle modes.
Safe. Slow. Good for unfamiliar repos.
Edits go through. Shell still asks. Good for normal coding.
Only stops for risky things. Good default for most days.
No writes. Good for exploring and design talks.
Shift+Tab cycles forward — keep pressing it until you see the one you want.
Claude can run shell commands inside a sandbox so they cannot touch the rest of your system. On Linux it uses bubblewrap, on macOS sandbox-exec. It is useful, but read the right column before you trust it.
rm -rf in the wrong folder, a script that touches ~/.aws.settings.json under sandbox. On by default in auto mode..env, tokens in ~/.netrc if you added it to allowed paths.curl | sh, the sandbox still runs curl | sh. Just inside the sandbox.Type / to see all of them. These are the keepers.
CLAUDE.md. First command in any new clone.--from-pr.--comment posts inline comments./loop 5m /verify while you work elsewhere.settings.json by talking to Claude.A git worktree is the same repo checked out in a second folder on a different branch. claude -w creates one and opens a session inside it — isolated files, shared history.
# Make a new worktree and open Claude
# inside it.
claude -w spike
# Same, but drop it in its own tmux
# window so it has its own keystrokes.
claude -w spike --tmux
# Outside Claude: list and clean up.
git worktree list
git worktree remove spike
node_modules, .venv, dev server port, running processes..git/, all commits, all branches. A commit in the worktree shows up in the main checkout.claude -w spike for a risky experiment. claude -w review --tmux running /code-review in the background. Color each with /color so you don't confuse them.
.claude Into the ContainerA devcontainer is wiped on every rebuild. Without a mount, your sessions, memory, and login die with it. One line in devcontainer.json keeps them.
{
"mounts": [
"source=${localEnv:HOME}/.claude,target=/home/vscode/.claude,type=bind"
]
}
claude -c works after a rebuild.# notes survive.~/.claude/CLAUDE.md rules./root/.claude for root, /home/vscode/.claude for the standard vscode user.
claude -p runs without the chat UI. Use it like jq or curl.
# One-shot question.
claude -p "summarize the last 5 commits"
# Pipe stdin in.
git diff | claude -p "explain this diff"
# JSON output for scripts.
claude -p --output-format json \
"list TODOs in src/" | jq '.result'
--output-format json
--max-budget-usd 0.50
--model haiku
--allowedTools "Read,Grep"
Claude shows a status line below the prompt. Hook in a small script and it reports live token usage. Above 200k it tells you to run /compact.
#!/usr/bin/env python3
"""Status line: model · tokens. Warn near the limit."""
import json, os, sys
data = json.load(sys.stdin)
model = data.get("model", {}).get("display_name", "claude")
path = data.get("transcript_path", "")
tokens = 0
if path and os.path.exists(path):
for line in open(path):
u = (json.loads(line).get("message") or {}).get("usage") or {}
if u: tokens = sum(u.get(k, 0) for k in
("input_tokens", "cache_read_input_tokens", "cache_creation_input_tokens"))
if tokens >= 200_000: c, h = "\033[31m", " /compact"
elif tokens >= 150_000: c, h = "\033[33m", " !"
else: c, h = "\033[32m", ""
print(f"{model} · {c}{tokens // 1000}k{h}\033[0m", end="")
{
"statusLine": {
"type": "command",
"command": "~/.claude/statusline.py"
}
}
chmod +x it.statusLine to settings.json.A skill is a focused instruction set Claude switches into for one well-defined job. Same model, but loaded with the right context and tools for that task.
/code-review, /verify, /deep-research./ in the prompt to see them all./plugins..claude/skills/<name>/SKILL.md. Shared with the team.~/.claude/skills/. Yours, everywhere.--comment posts inline PR comments..claude/skills/my-skill/SKILL.md with frontmatter (name, description, when-to-use) plus the instructions. Claude picks it up next session.
Two ways to teach Claude tricks beyond what ships in the box.
.mcp.json (repo, shared) or globally./plugins to browse, install, enable, disable.claude mcp add <name> <command> [args...]
claude mcp add-from-claude-desktop # import all
claude mcp list / get / remove
claude mcp add-json <name> <json> # complex configs
claude mcp add playwright npx -y @playwright/mcp@latest
> open localhost:3000, log in as alice, screenshot
> click "Sign up", fill with junk, tell me what breaks
/verify — Claude can actually see if a UI change works in the browser, not just guess from the diff.
Max Riechelmann · Dojo