~/claude

Claude Code Cheatsheet

v2.5 · Feb 2026
by Omri Tal · Botique AI Solutions

The Core Workflow

Master This
0. PRD
Define with Claude
1. EXPLORE
Understand the codebase
2. PLAN
Shift+Tab → strategy
3. CODE
Build with verification
4. COMMIT
Git commit + PR
5. VERIFY
Tests + Chrome + PRD
💡 #1 Tip — Verification Loops: Always give Claude a way to verify its own work = 2-3x better quality. "After you build, run tests. If they fail, fix and rerun until green."
⌨️

Keyboard Shortcuts

Official
KeyAction
Shift+TabCycle modes: Normal → Auto-Accept → Plan
Opt+TToggle extended thinking new
Ctrl+SStash current prompt new
Esc EscRewind — undo code + conversation
Ctrl+CCancel current generation
Ctrl+DExit Claude Code session
Ctrl+BPush running task to background
Ctrl+RReverse-search prompt history
Ctrl+TToggle task list view
Ctrl+LClear terminal screen
Ctrl+OToggle verbose output
Ctrl+VPaste image from clipboard
Shift+EnterNew line (native since v2.1)
VS Code: Cmd+Esc toggle focus · Cmd+Opt+K insert @file
Tip: Press ? to see shortcuts for your terminal
/

Built-in Slash Commands

SESSION & CONTEXT:
/clearReset context use between tasks!
/compactCompress history (at ~70%)
/contextVisualize context usage grid
/resumeResume a previous session
/rewindRewind conversation + code
/exportExport conversation to file
CONFIG & TOOLS:
/initGenerate CLAUDE.md for project
/modelSwitch model mid-session
/memoryEdit CLAUDE.md files directly
/permissionsManage tool permissions
/configOpen settings UI
/doctorHealth check installation
FEATURES:
/chromeConnect Chrome for visual tests
/sandboxSandboxed bash (safer YOLO)
/reviewRequest code review
/security-reviewSecurity audit of changes
/skillsList available skills
/mcpManage MCP server connections
/todosList current task items
/costShow token usage stats
/usagePlan limits & rate status
/hooksManage automation hooks
/pluginPlugin marketplace
/agentsManage custom subagents
/tasksList & manage background tasks new
$

Quick Prefixes & CLI

IN-SESSION PREFIXES:
!Run bash directly (no AI interpretation)
@File path autocomplete & reference
/Slash command

CLI FLAGS:
claude                 # Interactive REPL
claude "query"        # Start with prompt
claude --continue     # Continue last session
claude --resume       # Pick a session to resume
claude -p "query"     # Headless (CI/scripts)
claude --chrome       # With Chrome browser
claude --model opus   # Specify model
claude --add-dir ../lib # Add extra dirs
claude --debug        # Debug mode
claude --dangerously-skip-permissions
⚠️ Prefer /permissions or /sandbox over --dangerously-skip-permissions

INSTALL:
# Mac/Linux:
curl -sL https://install.anthropic.com | sh
# Windows:
irm https://console.anthropic.com/install.ps1 | iex
# Or via npm:
npm install -g @anthropic-ai/claude-code
# Update:
claude update
📋

Plan Mode & Thinking

Key Skill

Start almost every non-trivial task in Plan Mode.

Shift+Tab cycles: NormalAuto-AcceptPlan Mode → Normal

# The flow:
1. Enter Plan Mode (Shift+Tab ×2)
2. Describe the task
3. Read & refine Claude's plan
4. Approve → switch to Auto-Accept
5. Claude builds autonomously
6. Verify results

A good plan includes: what to build, files affected, risks, and how to verify.

💡 Optional: Copy-paste the plan to your Claude project (claude.ai) and let Claude verify it before approving.

EXTENDED THINKING:

Auto-enabled by default. Toggle with Opt+T. Turn off for simple tasks to save tokens. Best for: architecture decisions, complex bugs, choosing between approaches.

Verification Loops

Most Important

Don't trust — measure. Always give Claude a way to check its own work.

MethodHow
Testspytest -v / npm test
Typestsc --noEmit
Linteslint . / ruff check
Buildnpm run build
ChromeVisual check with extension
PRD"Where are we vs the PRD?"
# Template prompt with verification:
"Build the feature. After you finish:
 1. Run the tests
 2. Open in Chrome and verify UI
 3. If anything fails → fix and rerun
 4. Repeat until all green"
🧠

Context Management

Claude has 200K token context. Manage it or quality drops.

<50%All good, keep working
50-70%Consider /compact
>70%/compact now or /clear
Rule: Finished a task? /clear. Starting something new? /clear. Claude hallucinating? Check /context first.

@-MENTIONS:

@path/to/file.ts — include specific file
@docs/api-ref.md — include documentation
⚠️ Don't @-mention files inside CLAUDE.md — it bloats context permanently. Tell Claude to read them on demand instead.

🚀 Project Kickoff & Development Loop
🗺️

Project Kickoff Workflow

Follow This
1 Create project folder + Claude project — create a folder and a Claude project on claude.ai with relevant docs.
2 Build PRD with Claude — describe your project in conversation. Claude asks questions, you answer. Save as PRD.md in your project folder.
3 Create a dedicated GitHub repogit init + create remote repo. Add .gitignore and .env.example.
4 Prepare initial Claude Code prompt — in the same Claude chat that created the PRD, ask: "Write me a detailed first prompt for Claude Code." Claude already has full context.
5 Open VS Code → File → Open Folder — open your project folder in VS Code.
6 Open terminal → run claude — launch terminal, type claude (or --dangerously-skip-permissions).
7 Enter Plan Mode → paste promptShift+Tab ×2 to enter Plan Mode. Paste the initial prompt you crafted in step 4.
8 Review plan carefully — 💡 Copy plan to your Claude project for a second opinion. Iterate until solid.
9 After implementation → /init — generate CLAUDE.md to capture project context for future sessions.
⚠️ PRD first, always. Jumping straight to Claude Code without a PRD = Claude builds something, but probably not what you wanted.
🔄

During Development (Repeating Loop)

Core Loop
1 Plan — Plan Mode (Shift+Tab) for every significant step
2 Consult — discuss with Claude (desktop/web) in parallel
3 Verify/verify-yourself
4 Commit — commit and push
5 Update memory/update-claude-md
6 Security check/security-review

CONTEXT MANAGEMENT:

/clear between tasks · /compact mid-task · /clear on direction change


WHEN YOU'RE STUCK:

Use a research sub-agent: "Start an agent to research…" · Explore agent for codebase understanding


SPECIALIZED TASKS:

frontend-design skill for UI · Put API docs in docs/ folder for integrations

💡

Prompting Rules

1. Be specific
File, function, expected vs actual.

2. Give context
Use @file refs, show patterns.

3. Break it down
One task at a time. Big = bad.


BAD:
"Fix the bug"
"Build me an e-commerce site"
GOOD:
"In @auth.py, login() returns
 None instead of raising on
 bad password"


"Add logging matching the style
 in @src/services/user_service.py"

In CLAUDE.md: use "IMPORTANT", "YOU MUST", "NEVER" — emphasis words get more attention.

Claude Code Cheatsheet — Page 2: Configuration, Tools & Advanced

📄

CLAUDE.md — Project Memory

GLOBAL — ~/.claude/CLAUDE.md

Create once manually. Applies to ALL projects.

# Personal preferences
## Communication
- Respond in Hebrew
- Be direct, no fluff

## Workflow
- IMPORTANT: Plan Mode for complex tasks
- YOU MUST verify before done

## Never Do
- Never commit .env files
- Never force push without asking
PROJECT — ./CLAUDE.md

Create with /init. Commit to git & share with team!

# Auto-generated + your additions
## Overview
FastAPI backend, React frontend

## Commands
- Run: `uvicorn main:app --reload`
- Test: `pytest -v`

## Common Mistakes
- Don't use raw SQL, use ORM
- All dates in UTC
- API responses need request_id
Key habit: Every time Claude makes a mistake → add it to Common Mistakes. This compounds into a smarter AI partner over time.

Load order: Global → Project (project overrides) · Edit: /memory mid-conversation · Emphasis: "IMPORTANT", "YOU MUST", "NEVER"

🤖

Models & Accounts

ModelBest for
Opus 4.5 Complex, architecture Strongest
Sonnet 4.5 Daily work, balanced Default
Haiku 4.5 Search, simple tasks Fast

Switch: /model or claude --model opus


PlanPriceAccess
Pro$20/moAll models
Max 5x$100/moMore usage
Max 20x$200/moHeavy usage

Check limits: /cost (tokens) · /usage (rate limits)

🔀

Subagents & Tasks

BUILT-IN AGENTS:
ExploreSearch & read only (Haiku)
PlanPlanning mode (Sonnet)
TaskGeneral-purpose sub-agent
# Research in background
"Start an agent to research the
 auth patterns in our codebase"

Ctrl+B to push to background
→ Continue working with main agent
→ Agent notifies when done
/tasks to see running tasks

TASK LIST (NEW):

Claude auto-creates task lists for complex work. Ctrl+T to toggle. Tasks persist across /compact. Share across sessions with CLAUDE_CODE_TASK_LIST_ID=name claude


CUSTOM AGENTS:

Create in .claude/agents/name.md with YAML frontmatter (name, description, model, tools). ⚠️ No nesting — subagents can't spawn subagents.

🪝

Hooks — Automation

Code that runs automatically before/after Claude's actions. Configure in .claude/settings.json

PreToolUse Before · PostToolUse After · Notification Alerts

// Auto-format after every write:
{
  "hooks": {
    "PostToolUse": [{
      "matcher": "Write|Edit",
      "hooks": [{
        "type": "command",
        "command": "bun run format || true"
      }]
    }]
  }
}

Ideas: auto-format · auto-lint · run tests on write · notify on complete
Debug: claude --debug to see hook execution

🧩

Skills & Plugins

Skills = instruction folders loaded on-demand (Claude decides when). Plugins = packaged bundles. Since v2.1.3, commands & skills are unified.

# Plugin marketplace
/plugin → discover → install

# Anthropic official skills
/plugin marketplace add anthropics/skills
/plugin install example-skills@anthropics/skills

# Community skills
www.skills.sh

RECOMMENDED:
frontend-designAnti-"AI slop" UI design
code-simplifierClean up after sessions
document-skillsdocx, pdf, xlsx, pptx
superpowersBattle-tested workflows

Custom skills: .claude/skills/name/SKILL.md

🔌

MCP Servers

Connect Claude to external tools via ~/.claude/mcp.json

{
  "mcpServers": {
    "github": {
      "command": "npx",
      "args": ["-y",
        "@modelcontextprotocol/server-github"],
      "env": { "GITHUB_TOKEN": "ghp_..." }
    }
  }
}

server-githubRepos, Issues, PRs
server-postgresQuery DB directly
server-slackRead/write Slack
server-filesystemRemote file access
server-puppeteerBrowser automation

Manage: /mcp · MCP commands appear in /help

🌐

Chrome & Git Integration

CHROME:
claude --chrome # or /chrome in session

Claude can navigate, click, fill forms, screenshot, verify UI. Requires Chrome Extension v1.0.36+, Claude Code v2.0.73+, Pro/Max.
⚠️ Stops at logins/CAPTCHAs. Not supported: Brave, Arc, WSL.


GIT:

Claude handles git natively — commits, pushes, creates PRs.

# Claude can do all of this:
"Commit changes with clear message"
"Push to main and open a PR"
"Show git log for last 5 commits"

# GitHub Actions integration:
/install-github-app
# Then tag @claude in PRs & Issues!
⚙️

Custom Slash Commands

.claude/commands/name.md (project) or ~/.claude/commands/name.md (personal)

---
description: Verify codebase vs PRD
allowed-tools: Bash(*), Read(*), Grep(*)
argument-hint: [focus-area]
---

## Context
!`git diff --stat`

## Task
Analyze codebase against PRD.md.
Focus on: $ARGUMENTS
Report: done, in-progress, todo.
Use subagents for thorough review.

Syntax: !`cmd` = shell preprocessing (runs before prompt) · @file = include file · $ARGUMENTS = all args · $1 $2 = positional args

Ideas: /commit-push-pr · /test-and-fix · /code-vs-prd · /backend-audit · /security-scan
File Structure Reference
# Global (your machine) — one-time setup                 # Project (per repo — commit to git!)
~/.claude/                                          project/
├── CLAUDE.md       # your preferences            ├── CLAUDE.md          # project config (/init)
├── mcp.json       # MCP servers                  ├── .claude/
├── settings.json  # global permissions            │   ├── commands/      # slash commands
├── commands/      # personal commands             │   ├── agents/        # custom subagents
└── tasks/         # persistent task lists          │   ├── skills/        # custom skills
                                                │   └── settings.json  # project permissions
                                                ├── docs/              # API docs (on demand)
                                                └── .env.example       # env var template