Cheatsheets

Quick-reference cards extracted from each lesson.

Core Usage

Prompt Modes & Input Prefixes

← lesson

Prompt modes

ModeHow to activateWhat Claude can doWhen to use
DefaultLaunch Claude Code (always on by default)Read files, edit files, run commandsMost everyday work
PlanShift+Tab twice, or /planRead and reason only — no edits, no commandsBefore large or risky changes
Accept editsShift+Tab onceAuto-apply file edits without per-change confirmationTrusted batch edits after reviewing a plan

Input prefixes

PrefixNamePurposeExample
@File referenceInclude a specific file or directory in context@src/model.py
!Shell commandRun a command inline and pass its output to Claude! pytest tests/ -v
&Background taskRun a command in the background; Claude keeps responding& python src/train.py

Tokens

Tokens, Context & Pricing

← lesson

Term definitions

TermDefinition
TokenThe basic unit of text processed by the model. Roughly 3–4 characters or ¾ of an English word.
Context windowThe total space available for the current session: CLAUDE.md + conversation + files + tool outputs.
Input tokensAll tokens sent to the model in a request. Includes everything in the context window at that moment.
Output tokensTokens in Claude’s response. Billed at a higher rate than input tokens.
/costClaude Code command that reports token usage and estimated cost for the current session.

Model cost tiers (relative)

ModelSpeedCostBest for
HaikuFastestCheapestQuick lookups, simple edits, high-volume tasks
SonnetBalancedMid-rangeDefault for most Claude Code work
OpusSlowestMost expensiveComplex reasoning, architecture decisions

Exact per-token pricing changes. Check anthropic.com/pricing for current rates.

Token Reduction Strategies

← lesson

Techniques at a glance

TechniqueWhen to useToken impact
@fileTarget a specific fileHigh — avoids broad exploration
cd into subdirectoryWorking on one componentMedium — narrows file discovery scope
/clearStarting a new, unrelated taskHigh — resets full history
/compactMid-task, context growing largeMedium — compresses history to summary
Trim CLAUDE.mdAlways — keep under 500 wordsMedium — saves tokens on every session
Move instructions to skillsWhen instructions are task-specificMedium — loads only when invoked
MCP retrieval toolLarge codebase, semantic search neededHigh — loads relevant chunks, not whole files

Commands

CLI Commands

← lesson

All commands

CommandPurposeExample
claudeOpen interactive session$ claude
claude "..."Session with initial prompt$ claude "explain src/pipeline.py"
claude --model <id>Open session with specific model$ claude --model opus
claude --helpShow CLI flags$ claude --help
/helpList all slash commands/help
/clearWipe conversation history/clear
/compactCompress history, keep recent context/compact
/costShow token usage and cost/cost
/modelSwitch model mid-session/model
/planToggle Plan mode (no file edits)/plan
/initGenerate CLAUDE.md for current project/init
! <cmd>Run shell command inline! git status
& <cmd>Run command in background& python src/train.py
@<file>Add file to context (input prefix, not a command)@src/train.py

Custom Commands

← lesson

Where commands live

.claude/
└── skills/
    ├── review-notebook/
    │   └── SKILL.md          # → /review-notebook
    ├── summarize-pr/
    │   └── SKILL.md          # → /summarize-pr
    └── check-leakage/
        └── SKILL.md          # → /check-leakage

Naming convention

  • Directory name becomes the command name
  • Use kebab-case: review-pr, not reviewPR or review_pr
  • Keep names short and action-oriented: /doc, /review, /test

SKILL.md structure

---
name: review-notebook
description: Review a Jupyter notebook for reproducibility and data leakage
---
Review the notebook at $ARGUMENTS for...

$ARGUMENTS syntax

You type$ARGUMENTS value
/review src/model.pysrc/model.py
/compare models/v1.pkl models/v2.pklmodels/v1.pkl models/v2.pkl
/review (no argument)(empty string)

How to invoke

Skills in .claude/skills/ are loaded automatically — no activation step needed.

$ claude
> /review-notebook notebooks/churn_model.ipynb
> /summarize-pr #87
> /check-leakage src/features/