Claude Code Cheat Sheet

Claude Code Cheat Sheet for Beginners and Developers

August 11th, 2026
8192
05:00 Minutes

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.

What is Claude Code?

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.

claude code interface

Mental Model

  • AI pair-programmer in your terminal
  • Works on local files + full repo context
  • Best used from the project root

Install & Authenticate

CommandDescription
npm install -g @anthropics/claude-codeInstall Claude Code globally
claude auth loginAuthenticate with Anthropic
claude auth statusCheck login status

install claude code using npm

Start / Resume / One-Shot

CommandUse
claudeStart interactive session
claude --resumeResume last session
claude "prompt"Run a one-shot task

Most Useful Claude Code Keyboard Shortcuts

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
EscInterrupt Claude's current response or operation
Esc + EscOpen rewind/checkpoint options
Shift + TabCycle through permission modes
Ctrl + OShow the detailed transcript view
@ + pathReference a file or directory in a prompt
/Open the command menu
?Show available keyboard shortcuts

Session & Slash Commands

CommandDescription
/helpShow available commands
/clearClear current context
/exitExit session
/versionShow version info
/statusShow account, model, working directory and version information
/doctorDiagnose Claude Code installation and environment issues
/agentsList, create or edit subagents
/skillsList available Skills
/hooksView configured hooks
/resumeResume a previous session

File & Code Operations

CommandPurpose
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

Quick Tasks (One-Liners)

TaskCommand
Explain codeclaude "explain this file"
Summarize projectclaude "summarize project"
Fix lint issuesclaude "fix lint errors"
Optimize functionclaude "optimize this function"

Understand a Codebase

CommandUse 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

Debugging & Fixes

ScenarioCommand
Runtime errorclaude "debug this error"
Stack traceclaude "fix stack trace"
Failing logicclaude "why is this failing?"
Hidden bugclaude "find logical bug"

Refactoring & Optimization

GoalCommand
Simplify codeclaude "simplify logic"
Improve readabilityclaude "improve readability"
Remove duplicationclaude "remove duplication"
Performanceclaude "optimize performance"

Testing & Quality

TaskCommand
Write testsclaude "write tests"
Fix testsclaude "fix failing tests"
Add edge casesclaude "add edge cases"
Coverage reviewclaude "analyze test coverage"

Git & Pull Requests

TaskCommand
Review changesclaude "review git diff"
Commit messageclaude "suggest commit message"
Fix conflictsclaude "fix merge conflicts"
PR summaryclaude "prepare PR summary"

Documentation

TaskCommand
Create READMEclaude "create README"
Document functionclaude "document this function"
Inline commentsclaude "add inline comments"
API docsclaude "generate API docs"

Memory & Context

CommandPurpose
claude --memoryEnable memory
claude "show memory"View stored context
claude "clear memory"Reset memory

CLAUDE.md: Project Memory File

TaskCommand / Action
Generate initial fileclaude /init
Define coding conventionsAdd rules directly in CLAUDE.md
Set folder structure notesDescribe layout and purpose
Log past mistakesWrite them in so Claude avoids repeating them

MCP (Model Context Protocol): External Integrations

TaskCommand
Add MCP serverclaude mcp add
List connected serversclaude mcp list
Remove a serverclaude mcp remove <name>
Use MCP tool in sessionClaude invokes automatically when relevant

Hooks: Automated Triggers

Hook EventWhen It Fires
SessionStartOn every new or resumed session
PreToolUseBefore Claude runs any tool
PostToolUseAfter a tool completes
UserPromptSubmitEvery time you submit a message
StopWhen the session ends

Subagents — Parallel Execution

TaskCommand
Spawn a subagentclaude "run this task in a subagent"
Background shell sessionclaude agents ! <command>
Isolate heavy analysisDefine agent in .claude/agents/<name>.md

Slash Commands (Advanced)

CommandDescription
/initGenerate a CLAUDE.md for your project
/costShow token usage and cost breakdown
/modelSwitch or save your active model
/compactCompress context to save tokens
/code-reviewRun a code review on current changes
/code-review --fixReview and auto-apply fixes
/simplifyCleanup-only refactor review

Permissions & Safety

CommandPurpose
claude --allowedTools "Bash,Edit"Restrict which tools Claude can use
claude --disallowedTools "Bash"Block specific tools
claude --no-permission-checkSkip confirmation prompts (use carefully)
Review changes before commitAlways diff before git commit on production

.claude/ Folder Structure (Power User)

Most engineers using Claude Code leave roughly 80% of the product on the floor by not using the .claude/ directory.

.claude/
├── CLAUDE.md          ← Project memory & conventions
├── agents/            ← Specialized subagent definitions
├── skills/            ← Reusable slash command workflows
├── rules/             ← Path-scoped behavior rules
└── settings.json      ← Hooks, permissions, model config

Headless Mode & Automation

Command / OptionUse
claude -p "prompt"Run Claude Code non-interactively with a prompt
claude -p "run tests and explain failures"Run an automated development task
claude -p "review this code"Use Claude Code in scripts or CI workflows

Headless mode allows Claude Code to run without an interactive terminal session. It is useful for automation, CI/CD pipelines, scheduled code reviews, testing workflows, documentation generation, and other repeatable development tasks.

Checkpoints & Rewind

ActionPurpose
EscInterrupt Claude's current operation
Esc + EscOpen the rewind/checkpoint menu
/rewindReturn to an earlier checkpoint when available

Claude Code provides checkpoints that make it easier to recover from unwanted changes during an interactive session. Before accepting a large refactor or experimental change, you can use the rewind functionality to return to an earlier state instead of manually undoing every modification.

Claude Code Skills

Skills are reusable workflows that extend Claude Code with specialized instructions, procedures, templates, and supporting files. Unlike CLAUDE.md, which provides project instructions that are loaded into the session context, Skills can be loaded when they are relevant to a task. You can also invoke a Skill directly using its slash command.

FeaturePurpose
SKILL.mdDefines the Skill's instructions and behavior
.claude/skills/Stores project-level Skills
~/.claude/skills/Stores personal Skills available across projects
/skill-nameExplicitly invoke a Skill

CLAUDE.md vs Skills vs Subagents vs Hooks

FeatureBest Used For
CLAUDE.mdProject-wide instructions, conventions, architecture and commands
SkillsReusable workflows and specialized procedures
SubagentsDelegating isolated or specialized tasks
HooksAutomatically running actions when specific events occur
MCPConnecting Claude Code to external tools and services

The easiest way to remember the difference is: use CLAUDE.md for persistent project knowledge, Skills for reusable workflows, subagents for delegated work, Hooks for automatic event-driven actions, and MCP for external integrations.

Extended Thinking (Advanced)

CommandUse
claude --thinkDeep reasoning mode
claude "deeply analyze architecture"Design & performance review

Prompt Upgrade (Revision)

AvoidUse Instead
Fix thisFix this Python KeyError and explain why
Write codeCreate a Node.js API with validation

Real-World Go-To Prompts

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"

One-Line Reminder

Treat Claude Code like a pair programmer, not an autopilot.

Wrapping Up Claude Code Cheet Sheet

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.

FAQs on Claude Code Cheet Sheet

Q1. Is Claude Code beginner-friendly?

Yes. Basic commands are easy to use, and you can gradually move to advanced workflows.

Q2. Does Claude Code work offline?

No. It runs locally but requires an internet connection to access Claude models.

Q3. Is it safe to use on production code?

Yes, but always review changes before committing, especially in critical systems.

Q4. Can Claude Code replace developers?

No. It assists developers but does not replace human judgment or experience.

Course Schedule

Course NameBatch TypeDetails
Claude AI Pro Training
Every WeekdayView Details
Claude AI Pro Training
Every WeekendView Details
About the Author
Nehal Somani
About the Author

Nehal Somani has worked on applied AI projects, from NLP tools to recommendation systems, giving her a practical sense of where AI models succeed and fall short. She reads current research and experiments with new architectures rather than following headlines. Her writing demystifies AI concepts while helping practitioners understand the reasoning behind AI systems.

Drop Us a Query
Fields marked * are mandatory
×

Your Shopping Cart


Your shopping cart is empty.