shortcuts Use /cost to Track Token Spending Check how many tokens you've used and the estimated cost of the current session — so you know when to compact before hitting the context ceiling. bash Copy /cost beginner Mar 4, 2026
context Use /clear to Start Fresh Without Restarting Wipe the conversation history and reset context to zero without restarting Claude Code — use this when switching tasks or when Claude starts drifting. bash Copy /clear beginner Mar 4, 2026
shortcuts Press Escape to Interrupt Claude Mid-Response Stop Claude immediately when it's heading in the wrong direction — before it wastes tokens on a bad path that cascades into hundreds of useless lines. bash Copy Escape beginner Mar 4, 2026
config Use /init to bootstrap CLAUDE.md Let Claude Code scan your project and auto-generate a CLAUDE.md file instead of writing one from scratch — then customize to fit your workflow. bash Copy /init intermediate Mar 4, 2026
shortcuts Use claude -p for one-shot scripting Skip interactive mode and send a prompt directly from the command line with -p — pipe files in, chain tools, or embed Claude in shell scripts. bash Copy claude -p "explain this error" < error.log intermediate Mar 4, 2026
shortcuts Pipe output to Claude for analysis Send command output directly into Claude via stdin — pipe failed tests, build errors, or logs and get a focused diagnosis without copy-pasting anything. bash Copy npm test 2>&1 | claude -p "explain failures" intermediate Mar 4, 2026
workflow Use Plan Mode for complex tasks Ask Claude to plan before coding when a task spans multiple files — catch wrong assumptions early instead of rolling back half-done changes. bash Copy plan before you code intermediate Mar 4, 2026
config Use --model Flag to Pick Your Claude Model Choose your Claude model at startup — default to Sonnet for everyday coding, switch to Opus only for deep architecture problems to cut costs. bash Copy claude --model sonnet beginner Mar 4, 2026
config Structure CLAUDE.md with 6 Key Sections The six-section CLAUDE.md structure that gives Claude Code maximum project understanding — so it stops asking questions you've already answered. bash Copy # Project Overview # Tech Stack # Architecture # Conventions # Common Commands # Known Issues intermediate Feb 10, 2026
context Use /compact When Responses Get Slow Free up context window space by compressing history when Claude Code slows down — recovering 40–60% of your context budget without losing key info. bash Copy /compact beginner Feb 10, 2026
shortcuts Use ! to Run Shell Commands Directly Skip AI interpretation and execute shell commands instantly with ! — run tests, check git status, or any command where you don't need Claude's input. bash Copy ! npm test beginner Feb 10, 2026