Claude Code Command Cheat Sheet

This cheat sheet is for real Claude Code sessions. The point is not memorizing commands. The point is giving Claude narrow, testable work and keeping your review loop clean.

Quick picks

Session rules that prevent mess

Start with a clean git status. Keep work scoped. Ask for a plan before edits. Review the diff yourself. If the work is important, ask another model or another Claude session to review it.

A clean three-step loop

Use Claude Code in three passes: understand, change, verify. The first pass should be read-only. The second pass should be narrow. The third pass should explain the diff and run the checks that actually matter.

This rhythm makes the tool feel less mysterious. You are not hoping the agent got it right. You are giving it a smaller job, reviewing the evidence, and deciding what ships.

Command cheat sheet

claude

Start an interactive Claude Code session in the current project.

claude

Run this from the repo root after checking git status.

claude -p "explain this repo"

Print a one-off answer without entering the full interactive loop.

claude -p "explain this repo"

Useful for quick architecture summaries, scripts, and CI-style checks.

claude --continue

Continue the most recent session for the current directory.

claude --continue

Use this when you closed the terminal but want to keep the same thread of work.

claude --resume <session-id>

Resume a specific prior session by ID.

claude --resume <session-id>

Useful when you have several projects or want to return to a known conversation.

/init

Create or update a project guide file so Claude understands local conventions.

/init

Run this early in a repo and review the generated guidance before relying on it.

/permissions

View or change what Claude Code is allowed to read, edit, and run.

/permissions

Check this before broad refactors, dependency installs, or commands with side effects.

/compact focus on the current diff and test status

Compress a long conversation while preserving the part that matters.

/compact focus on the current diff and test status

Use it before the context window gets messy, not after you are already lost.

/review

Ask for a code-review pass over recent changes.

/review

Treat the result like a second reviewer, then inspect the diff yourself.

Copyable prompts

Understand a repo

Read the project structure and explain the architecture. Do not edit files yet. Tell me the main entry points, data flow, build commands, and likely risk areas.

Plan a feature

Plan the smallest safe implementation for [FEATURE]. List files likely to change, tests to run, and questions you need answered. Do not edit yet.

Implement narrowly

Implement [TASK]. Keep the change scoped. Follow existing patterns. Run the relevant tests or explain why they cannot run.

Review the diff

Review the current git diff as if you are doing a code review. Prioritize bugs, regressions, security issues, and missing tests. Give file-specific findings.

Handoff summary

Summarize what changed, why, how to test it, what risk remains, and any follow-up cleanup that should not block this change.

Related Power of AI pages

Sources and official references

Related Power of AI pages

Keep reading with AI Finder, Prompt Studio, ChatGPT vs Claude vs Gemini, the AI glossary, and Which AI Should You Use?.