Claude Code is a terminal-based AI coding assistant by Anthropic. To get started right now: install it with npm install -g @anthropics/claude-code, then run claude from your project root to start an interactive session.
This Claude Code cheat sheet is a fast reference for beginners and developers using this AI assistant in real projects. It is designed for quick lookup, revision, and daily use, covering the most common commands, workflows, and prompt patterns without long explanations.
Claude Code is a terminal-based AI coding assistant by Anthropic that works directly with your local files and repositories. It understands project context, helps write, debug, refactor, and document code, and acts like an AI pair programmer inside your development workflow.

Build practical Claude AI skills through advanced prompting, AI-powered workflows, and hands-on applications.
| Command | Description |
|---|---|
npm install -g @anthropics/claude-code | Install Claude Code globally |
claude auth login | Authenticate with Anthropic |
claude auth status | Check login status |

| Command | Use |
|---|---|
claude | Start interactive session |
claude --resume | Resume last session |
claude "prompt" | Run a one-shot task |
| Shortcut | Action |
|---|---|
Ctrl + C |
Interrupt current operation |
Ctrl + L |
Clear terminal screen |
Arrow Up |
Recall the previous command |
Arrow Down |
Navigate command history |
Tab |
Autocomplete commands or paths |
Ctrl + D |
Exit current session |
Ctrl + R |
Search command history |
Esc | Interrupt Claude's current response or operation |
Esc + Esc | Open rewind/checkpoint options |
Shift + Tab | Cycle through permission modes |
Ctrl + O | Show the detailed transcript view |
@ + path | Reference a file or directory in a prompt |
/ | Open the command menu |
? | Show available keyboard shortcuts |
| Command | Description |
|---|---|
/help | Show available commands |
/clear | Clear current context |
/exit | Exit session |
/version | Show version info |
/status | Show account, model, working directory and version information |
/doctor | Diagnose Claude Code installation and environment issues |
/agents | List, create or edit subagents |
/skills | List available Skills |
/hooks | View configured hooks |
/resume | Resume a previous session |
| Command | Purpose |
|---|---|
claude "read file.py" | Read and explain a file |
claude "edit index.js" | Edit existing file |
claude "create utils.py" | Create a new file |
claude "refactor this file" | Refactor code |
| Task | Command |
|---|---|
| Explain code | claude "explain this file" |
| Summarize project | claude "summarize project" |
| Fix lint issues | claude "fix lint errors" |
| Optimize function | claude "optimize this function" |
| Command | Use Case |
|---|---|
claude "analyze repo" | High-level analysis |
claude "explain folder structure" | Understand layout |
claude "find unused code" | Detect dead code |
claude "suggest improvements" | Codebase cleanup ideas |
| Scenario | Command |
|---|---|
| Runtime error | claude "debug this error" |
| Stack trace | claude "fix stack trace" |
| Failing logic | claude "why is this failing?" |
| Hidden bug | claude "find logical bug" |
| Goal | Command |
|---|---|
| Simplify code | claude "simplify logic" |
| Improve readability | claude "improve readability" |
| Remove duplication | claude "remove duplication" |
| Performance | claude "optimize performance" |
| Task | Command |
|---|---|
| Write tests | claude "write tests" |
| Fix tests | claude "fix failing tests" |
| Add edge cases | claude "add edge cases" |
| Coverage review | claude "analyze test coverage" |
| Task | Command |
|---|---|
| Review changes | claude "review git diff" |
| Commit message | claude "suggest commit message" |
| Fix conflicts | claude "fix merge conflicts" |
| PR summary | claude "prepare PR summary" |
| Task | Command |
|---|---|
| Create README | claude "create README" |
| Document function | claude "document this function" |
| Inline comments | claude "add inline comments" |
| API docs | claude "generate API docs" |
| Command | Use |
|---|---|
claude --think | Deep reasoning mode |
claude "deeply analyze architecture" | Design & performance review |
| Avoid | Use Instead |
|---|---|
Fix this | Fix this Python KeyError and explain why |
Write code | Create a Node.js API with validation |
1. "Create a Python script to validate emails from CSV"
2. "Find and fix the error in this file"
3. "Optimize this function for performance"Treat Claude Code like a pair programmer, not an autopilot.
Also Explore: Best Claude Alternatives
Explore Google Gemini capabilities, master AI prompting, and apply intelligent tools to real-world tasks and workflows.
Claude Code is most effective when used as a daily development companion rather than a one-time code generator. This Claude Code cheat sheet is designed to help you quickly recall commands, patterns, and workflows, allowing you to stay productive without disrupting your coding flow.
Yes. Basic commands are easy to use, and you can gradually move to advanced workflows.
No. It runs locally but requires an internet connection to access Claude models.
Yes, but always review changes before committing, especially in critical systems.
No. It assists developers but does not replace human judgment or experience.