Claude Code Cheat Sheet: Commands, Workflows & Prompts (2026)
March 23, 2026
Claude Code has a learning curve — not because it's complicated, but because the mental model is different from any AI tool you've used before. Once it clicks, it's hard to go back. This cheat sheet covers the commands, setup patterns, and prompt frameworks that make the difference between "interesting experiment" and "this is how I work now."
Setup: CLAUDE.md
The single highest-leverage thing you can do is create a CLAUDE.md file in your project root. Claude Code reads this at the start of every session. Without it, you're re-explaining your project from scratch every time.
A solid CLAUDE.md template:
# Project: [Your project name] ## Stack - Framework: Next.js 15 (App Router) - Database: Postgres via Drizzle ORM - Auth: next-auth v5 - Styling: Tailwind CSS ## Conventions - Use TypeScript strictly — no any types - Server components by default, client components only when needed - All DB queries go in /lib/db/queries/ - Error handling: always use Result types, never throw in API routes ## Do Not Touch - /lib/auth/ — auth config is stable, don't refactor - /db/schema.ts — only add columns, never remove ## Deployment - Vercel, auto-deploys from main - Run `pnpm build` to check before committing
Keep it under 200 lines. Claude Code reads the whole thing every session — make every line count.
Key Slash Commands
/help— lists all available commands. Run it once when you start./clear— resets conversation context. Use when starting a new unrelated task in the same session./compact— compresses conversation history to save context window. Useful in long sessions./memory— shows what Claude Code has stored about your project. Edit it to correct misconceptions./cost— shows token usage and estimated cost for the session./model— switch between Claude models mid-session (e.g., drop to Haiku for cheap tasks).
Task Prompt Patterns
These patterns consistently produce better results than vague requests:
Feature implementation:
Add [feature] to this project. Requirements: - [specific requirement 1] - [specific requirement 2] - [specific requirement 3] Follow existing patterns in [relevant file/folder]. Don't change [thing that shouldn't change].
Bug fix:
This is broken: [describe the behavior] Expected: [what should happen] Error: [paste the full error/stack trace] Find the root cause and fix it. Don't change unrelated code.
Refactor:
Refactor [specific thing] to [goal]. Keep the same behavior — this is structural only. Update all imports and references. Run tests after to verify nothing broke.
Code review:
Review [file or feature] for: - Security issues - Performance problems - Anything that would fail in production - Consistency with the rest of the codebase List issues ranked by severity. Don't fix anything yet — just report.
Workflow: The Two-Pass Approach
For non-trivial tasks, use two passes:
Pass 1 — Plan: Ask Claude Code to describe exactly what it will do before doing it. "Before making any changes, tell me your plan for implementing this." Read the plan. If something looks wrong, correct it now — it's free. If the plan looks right, proceed.
Pass 2 — Execute: "Go ahead and implement the plan." Claude Code will execute the plan you already reviewed, reducing the chance of surprises.
This adds 30 seconds upfront and saves minutes of debugging later.
Permissions & Safety Flags
- Default (interactive mode) — Claude Code asks approval before each file change. Safe, slower.
--dangerously-skip-permissions— runs autonomously without asking. Fast, requires you to review the git diff afterward. Use for trusted tasks in projects with git.--allowedTools— restrict which tools Claude Code can use. E.g.,--allowedTools "Read,Write"to prevent it running shell commands.- Always have git initialized —
git initbefore starting. Claude Code's changes are easy to review and revert with a clean git history.
Quick Wins: Things Claude Code Does Better Than You Expect
- Writing tests — give it a module and say "write comprehensive tests." It infers edge cases from the code.
- Documentation — "Document this codebase for a new engineer joining the team." Produces a real README.
- Database migrations — "Add a [field] column to the [table] table. Write and run the migration." It handles the schema, migration file, and type updates.
- Dependency updates — "Audit our dependencies for known vulnerabilities and update any with critical CVEs."
- Multi-file refactors — the thing every AI tool struggles with. Claude Code handles it because it sees the whole project.
The #1 Thing to Remember
Claude Code is an agent, not a generator. It makes decisions. Review the git diff before you commit — not because it makes bad decisions, but because understanding what it changed is how you stay in control of your own codebase. The developers getting the best results from it are the ones who review everything and course-correct early, not the ones who let it run unchecked for hours.
The Claude Switcher's Playbook
The complete system for getting 10x results from Claude — including Claude Code workflows, the CLAUDE.md framework, prompting patterns, and the mental model shift that changes how you build.
Get the Playbook — $17