Claude CLI Dojo

Small commands that make Claude Code faster every day.

Developer Dojo Max Riechelmann
Start Here

Four Keys at the Start of a Line

The first character you type tells Claude what kind of input this is.

/
Run a command. /help, /resume, /init, /cost.
!
Run a shell command. Claude sees the output too. ! git status, ! npm test, ! ls -la.
@
Attach a file or folder. Tab completes the path. @src/auth.py, @README.md, @tests/.
#
Save a note to memory. Claude remembers next time. # we use pnpm, not npm, # tests live in __tests__/.
Example ! 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.

Tip · Resume

Don't Start Over. Resume.

Every session is saved. You almost never need a fresh start.

From the terminal

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

Inside Claude

  • /resume opens the same picker.
  • /export saves the chat to a file.
  • /cost shows what this session has cost so far.
Habit First command of the day, every day: claude -c.
Tip · /rename

Give Your Session a Name

The picker is full of "untitled" sessions. Three seconds to name one saves you ten minutes later.

With a name
> /rename auth-bugfix

Sets the name. Shown in the prompt box,
the picker, and your terminal title.
Without a name
> /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".

Tip · /color

Color Your Sessions

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.

With a color
> /color cyan
> /color #FF6699

Sets the color of the prompt box.
Takes color names or hex codes.
Without a color
> /color

Picks a color for you. Run it again
if you don't like the one you got.
Habit Start a session, then /rename and /color. Two seconds, saves you all day.
Cost vs Power

Pick the Right Model and Effort

Defaults are fine. Knowing when to switch saves money and time.

/model

Pick the model

Switch any time: /model haiku for simple stuff, /model opus for hard bugs and design.

/effort

Think harder

Five levels: low, medium, high, xhigh, max. Higher means slower and pricier, but smarter.

/fast

Faster Opus

Toggle on. Same Opus, less waiting. No quality loss.

Rule of Thumb Start with Sonnet, medium effort. Stuck? /model opus + /effort high. Easy task? /model haiku.
Long Sessions

/clear vs /compact

When a session gets long and slow, you have two options.

/clear

Throw it away.

  • Deletes the chat. Keeps the session name and color.
  • Use when you switch to a new topic.
/compact

Summarize and keep going.

  • Replaces the chat with a short summary. Same task, less context.
  • Use when the same task has gone on too long.
Careful There is no undo. If you want a backup, /export first.
Memory & Rules

Teach It Once

Drop the right file, Claude loads it on every session. Stop explaining the same thing every day.

AGENTS.md
Repo · committed · shared with the team. Project rules. Cross-tool standard — works in Claude, Cursor, Mistral, Aider.
.claude/
Repo · committed · shared with the team. Project-scoped settings, custom slash commands, agents, hooks. Lives next to the code.
subfolder/AGENTS.md
Repo · scoped. Loaded only when Claude opens files inside that folder.
CLAUDE.local.md
Repo · gitignored. Your local notes for this repo. "Don't ask me to install pre-commit again."
~/.claude/
Global · your machine only · loaded everywhere. Personal rules, memory notes, settings, your own slash commands. Open with /memory.
Three habits # 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.
AGENTS.md

One File, Every AI Tool

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.

What goes in

  • Naming. File names, function names, branch names.
  • Libraries to use, libraries to avoid.
  • How to run tests, how to start the dev server.
  • Tools the team uses: linter, formatter, build script.
  • House rules: no em dashes, no comments without a "why", etc.
  • Pointers to longer docs in the repo.

What stays out

  • Secrets. Tokens. API keys. Ever.
  • Personal preferences (use ~/.claude/CLAUDE.md).
  • Long architecture docs. Link to the file, do not paste it.
  • Anything that changes weekly. Rules should be stable.
AGENTS.md · a short, useful one
# 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.
Habit Edit AGENTS.md when Claude makes the same mistake twice. The third time it should already know.
Shift+Tab

Stop Clicking "Yes" 50 Times a Day

By default Claude asks before every change. Press Shift+Tab to cycle modes.

Default
Asks Each Time

Safe. Slow. Good for unfamiliar repos.

acceptEdits
Auto Edits

Edits go through. Shell still asks. Good for normal coding.

auto
Auto Mode

Only stops for risky things. Good default for most days.

plan
Read Only

No writes. Good for exploring and design talks.

Check the Prompt The current mode is shown as a label next to the prompt box. Shift+Tab cycles forward — keep pressing it until you see the one you want.
Sandbox

What It Does, and Why It Is Not Real Security

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.

What the sandbox does

  • Restricts file writes to the project folder.
  • Restricts network calls to an allowlist.
  • Blocks access to your home folder, SSH keys, browser data.
  • Catches honest mistakes: rm -rf in the wrong folder, a script that touches ~/.aws.
  • Configured in settings.json under sandbox. On by default in auto mode.

What it does not do

  • It is not a security boundary. Treat it as a guardrail, not a wall.
  • Bubblewrap and sandbox-exec have known escapes. New ones get found every year.
  • Files you let Claude read can still leak: secrets in .env, tokens in ~/.netrc if you added it to allowed paths.
  • Network allowlists are easy to bypass via DNS tunnels, sub-processes, or whatever the model decides to try.
  • If Claude pipes curl | sh, the sandbox still runs curl | sh. Just inside the sandbox.
Mental Model The sandbox protects you from accidents. It does not protect you from a model that has been prompt-injected, or from a malicious MCP server. Code review and a clean dev environment still matter.
Slash Commands

The Ones You Will Use Every Week

Type / to see all of them. These are the keepers.

/init
Generate a starter CLAUDE.md. First command in any new clone.
/review
Review a PR. Pass a PR number or use --from-pr.
/code-review
Review your current changes. --comment posts inline comments.
/security-review
Same diff, security focus.
/verify
Actually run the app to confirm a change works.
/loop
Run something on a timer. /loop 5m /verify while you work elsewhere.
/doctor
Check your install, auth, and plugins. Run this before filing a bug.
/fewer-permission-prompts
Adds safe commands to your allowlist so Claude stops asking.
/update-config
Edit settings.json by talking to Claude.
Parallel Work · claude -w

Run Two Claudes Without a Mess

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.

Start a worktree session
# 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

What separates · what stays shared

  • Separate: files on disk, node_modules, .venv, dev server port, running processes.
  • Shared: .git/, all commits, all branches. A commit in the worktree shows up in the main checkout.
  • You cannot have the same branch checked out in two worktrees at once.
  • Auto-cleans on exit if nothing changed. Keeps it if you committed.
Pattern Main task in one window. 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.
VS Code · Devcontainers

Mount .claude Into the Container

A devcontainer is wiped on every rebuild. Without a mount, your sessions, memory, and login die with it. One line in devcontainer.json keeps them.

.devcontainer/devcontainer.json
{
  "mounts": [
    "source=${localEnv:HOME}/.claude,target=/home/vscode/.claude,type=bind"
  ]
}

What stays alive

  • Sessions. claude -c works after a rebuild.
  • Memory. Your # notes survive.
  • Login. No re-auth on every rebuild.
  • Personal ~/.claude/CLAUDE.md rules.
  • Settings, hooks, custom statusline.
Heads Up Match the target to the container user. /root/.claude for root, /home/vscode/.claude for the standard vscode user.
Scripting

Claude in Pipes and Scripts

claude -p runs without the chat UI. Use it like jq or curl.

Examples
# 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'
Useful flags
--output-format json
--max-budget-usd 0.50
--model haiku
--allowedTools "Read,Grep"
Good For Pre-commit hooks. CI checks. Cron jobs. Shell aliases that explain an error you just hit.
Custom Status Line

Warn Me Before I Run Out of Context

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.

~/.claude/statusline.py · runs once per render
#!/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="")
~/.claude/settings.json
{
  "statusLine": {
    "type": "command",
    "command": "~/.claude/statusline.py"
  }
}

Install

  • Save script, chmod +x it.
  • Add statusLine to settings.json.
  • Start a new session — look below the prompt.
Skills

Expert Sub-Modes for Specific Tasks

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.

How to invoke

  • Type the slash command — /code-review, /verify, /deep-research.
  • Or just describe the task — Claude picks the right skill if it fits.
  • Type / in the prompt to see them all.

Where they live

  • Built-in — ship with Claude Code.
  • Plugin — installed via /plugins.
  • Repo.claude/skills/<name>/SKILL.md. Shared with the team.
  • Personal~/.claude/skills/. Yours, everywhere.
/code-review
Reviews the current diff. --comment posts inline PR comments.
/verify
Runs the app and checks the change actually works.
/deep-research
Multi-source research with adversarial fact-checking.
Build Your Own Drop .claude/skills/my-skill/SKILL.md with frontmatter (name, description, when-to-use) plus the instructions. Claude picks it up next session.
Extensions · MCP & Plugins

Give Claude More Hands

Two ways to teach Claude tricks beyond what ships in the box.

MCP servers

  • External processes that speak Model Context Protocol to Claude.
  • Give Claude new tools: browsers, databases, GitHub, your internal APIs.
  • Config in .mcp.json (repo, shared) or globally.

Plugins

  • Bundles of skills, slash commands, agents, hooks, and MCP configs.
  • One install, the whole bundle is yours.
  • /plugins to browse, install, enable, disable.
Manage MCP servers
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
Playwright MCP · drive a real browser
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
Pairs with /verify — Claude can actually see if a UI change works in the browser, not just guess from the diff.
xkcd 1205 · Is It Worth The Time?
xkcd 1205: Is It Worth The Time? — a table showing how long you can spend automating a task before you spend more time on the automation than the task itself.

Randall Munroe · xkcd.com/1205 · CC BY-NC 2.5