Quick Reference
Reference
beginner
Claude Code — Quick Reference Card
Start & Stop
claude # Interactive mode
claude "prompt" # One-shot mode
claude --resume # Resume last session
Ctrl+D or /quit # Exit
Essential Commands
/help — Show commands
/clear — Reset conversation
/compact — Summarise to save space
/cost — Token usage
/model — Switch model
Keyboard Shortcuts
Enter — Send
Shift+Enter — New line
Ctrl+C — Cancel generation
Esc — Cancel input
Up Arrow — Previous message
File Operations
"Create [path] with [content]"
"Edit [path] — change [X] to [Y]"
"Delete [path]"
"Find all files matching [pattern]"
"Search for [text] in [scope]"
Permission Responses
y — Approve
n — Reject
a — Always allow this type
[text] — Modify and retry
Project Setup (Essential Files)
CLAUDE.md — Project instructions for Claude
.claude/settings.json — Team permissions (committed)
.claude/settings.local.json — Personal settings (gitignored)
.claude/commands/*.md — Custom slash commands
CLAUDE.md Template
# My Project
## Tech Stack
- [framework] [version]
## Commands
- `npm run dev` — dev server
- `npm test` — tests
## Conventions
- [pattern 1]
- [pattern 2]
## Do NOT
- [anti-pattern 1]
- [anti-pattern 2]
Common Workflows
New feature:
Think about [feature], plan the approach, then implement step by step.
Debug:
Error: [paste error]. Happens when [trigger]. Expected [X], got [Y].
Refactor:
Refactor [target] to [improvement]. Keep same interface. Run tests.
Review:
Review changes on this branch vs main for bugs and security issues.
Commit:
Stage all changes and commit with a conventional commit message.
Models
| Model | Best For | Speed |
|---|---|---|
| Opus | Complex reasoning, architecture | Slower |
| Sonnet | Daily coding, edits, debugging | Fast |
| Haiku | Simple questions, quick tasks | Fastest |
Context Management
| Situation | Do This |
|---|---|
| Quality dropping | /compact |
| New unrelated task | New session |
| Long multi-part task | Break into sessions |
| Need prior context | --resume |
| Repeated instructions | Put in CLAUDE.md |
Cost Awareness
| Task | ~Tokens |
|---|---|
| Simple question | 1-5K |
| File creation | 5-15K |
| Multi-file feature | 50-200K |
| Long debug session | 100-500K |
MCP Configuration
{
"mcpServers": {
"server-name": {
"command": "npx",
"args": ["-y", "package-name"],
"env": { "KEY": "value" }
}
}
}
Golden Rules
- Run from project root — context comes from working directory
- Be specific — detailed prompts get first-try results
- Commit before big changes — git is your undo button
- Read diffs before approving — don't blindly accept
- CLAUDE.md is your leverage — invest 5 minutes, save hours
- One task per session — focused sessions > marathon sessions