Vibe-Log Logo Vibe-Log
Focus • Discover • Optimize

CLAUDE CODE COOKING CHEATSHEET

CORE PROMPTING PRINCIPLES

Be Clear & Specific

  • Exact wants: "React auth component" vs "login thing"
  • Sequential: Break into numbered steps
  • Context: Framework, language, constraints
  • Output: "Only code" or "With comments"

❌ AVOID

  • fix the bug
  • make it better
  • optimize this

✅ PREFER

  • fix race in auth.js:42
  • optimize SQL indexes
  • add error unit tests

Few-Shot Prompting (Teach by Example)

> Create API endpoints following this pattern:
> Example 1: GET /users/{id} - Returns user data
> Example 2: POST /users - Creates new user
> Now create endpoints for: products, orders
Golden Rule: Specificity upfront = fewer iterations
Pro Tip: Press @ in Claude Code to quickly reference files and folders in your workspace (e.g., @app.js, @src/components)

CODEBASE ONBOARDING

Initialize New Projects

/init - Automatically reads all files and creates a comprehensive CLAUDE.md

Claude analyzes your codebase structure, patterns, and conventions to generate project-specific guidelines.

Questions That Work (No special prompting needed)

  • "How does logging work in this codebase?"
  • "How do I make a new API endpoint following the existing patterns?"
  • "What does async move { ... } do on line 134 of foo.rs?"
  • "What edge cases does CustomerOnboardingFlowImpl handle?"
  • "Why are we calling foo() instead of bar() on line 333?"
  • "What's the equivalent of line 334 of baz.py in Java?"

COURSE CORRECTION TOOLS

Essential Tools

1. Plan Mode

Shift+Tab+Tab

Forces thoughtful planning before implementation

2. Escape

Press Escape key

Interrupt any phase, preserves context

3. Esc+Esc

Press Escape twice

Jump back in history, edit previous prompts

4. Undo

"Undo the last changes and try a different approach"

Clean slate while maintaining context

5. Git Restore

git restore [file]

Discard Claude's changes to specific files

CUSTOM COMMAND PATTERNS

What Are Custom Commands?

Create reusable prompts that you and your team can invoke with a simple slash command. Store them in .claude/commands/ for consistent workflows.

Project Commands (Shared with team)

echo "Analyze performance and suggest 3 specific optimizations:" > .claude/commands/optimize.md

Use with: /project:optimize

Commands with Arguments

echo "Fix issue #$ARGUMENTS with tests" > .claude/commands/fix.md

Use with: /project:fix 123

🙏 Community Resource: Awesome Claude Code commands (13k+ GitHub stars)

THE ANTI-YOLO METHOD HIGH ROI

Brainstorm → ASCII → Plan³ → Test → Ship

Brainstorm: Explain problem space, not solutions. Let Claude suggest approaches with collaborative discussion.
ASCII Wireframe: Before any code, request ASCII art wireframes. Lightning fast iterations with minimal token usage.
Plan³: Shift+Tab+Tab (plan mode) → @ tag brainstorm file → Ask Claude to ask YOU clarifying questions first.
Test: Implement and verify the solution works as planned. Run tests, check edge cases, validate against requirements.
Ship: With tested implementation, deploy with confidence knowing it works correctly.
⚠️ Critical Rule: Read the plan twice. If you change nothing, you're probably missing something. Test thoroughly before shipping.
🙏 Community Resource: The Anti-YOLO Method: Why I Make Claude Draw ASCII by u/Big_Status_2433 (300+ upvotes)

SOLO DEV/STARTUP/POC MODE HIGH ROI

The Problem: Claude over-engineers simple solutions (59 test cases for a button!), burning tokens aggressively.

CLAUDE.md for Solo Developers

Anti-Bloat Prompt Template

"You MUST strive for elegant, minimal solutions that eliminate complexity and bugs. Remove all backward compatibility and legacy code. YOU MUST prioritize simple, readable code with minimal abstraction—avoid premature optimization."
🙏 Community Resource: Anti-bloat CLAUDE.md saves tokens by u/AshxReddit (150+ upvotes)

STATUSLINES & MONITORING

Enhanced Terminal Experience

Add visual feedback and monitoring to your Claude Code sessions with these community-built statuslines.

Vibe-Log logoVibe-Log's Co-Pilot

npx vibe-log-cli

Uses your local Claude Code to provide strategic guidance that pushes you to ship faster. It remembers your original goal and gives concrete, actionable steps to achieve it. Helps you stay focused.

GitHub: vibe-log-cli

CCusage logoCCusage

npx ccusage@latest

Track your Claude Code token consumption and costs. Provides detailed analytics on usage patterns and spending.

GitHub: ccusage (7k+ stars)

🎮 Claude Code Tamagotchi

npm install -g claude-code-tamagotchi

Gamify your coding sessions with a virtual pet that evolves based on your Claude Code activity. Keep coding to keep your pet happy!

GitHub: claude-code-tamagotchi

SUBAGENTS

What Are Subagents?

Specialized Claude instances with focused expertise, like having a senior specialist on-call for specific tasks.

Generate Subagent

claude --subagent "You are a database migration expert"

Claude creates optimized subagent config

Use Subagent

/user:db-expert "Optimize this query"

Invoke specialist for focused tasks

Example Subagents

Performance Optimizer

Security Auditor

Best Practices

  • Single Responsibility: Each subagent should have one clear focus
  • Specific Instructions: More specific = better results
  • Start with Claude: Let Claude generate the initial subagent, then customize
  • Test & Iterate: Refine based on actual usage
🙏 Community Resource: Volt production-ready subagents (2k+ GitHub stars)

VERSION CONTROL SAFETY

Commit Early, Commit Often

Critical: Claude can rewrite files incorrectly. Without frequent commits, you lose hours of work in seconds.

Safety Prompt

"Before any code changes, commit current state: git commit -am 'WIP'. After each working change, commit immediately with descriptive message. Always create new branch for new features."

New Feature = New Branch

git checkout -b feature-name

Before Claude

git commit -am "Checkpoint before Claude"

After Success

git commit -am "Working: feature complete"

Quick Recovery

git reset --hard HEAD
Golden Rule: If Claude made something work, commit it IMMEDIATELY. Clean up history later.

CLAUDE.md MASTERY

The Problem: Claude acts like an overly eager junior dev - agrees with everything, adds unnecessary comments, praises obvious code, and jumps straight to implementation without planning.

Global Context Template

Pro Tips: Press # in Claude Code to quickly reference files (e.g., #CLAUDE.md loads your config). This template transforms Claude from an eager assistant into a thoughtful peer who plans before coding.
🙏 Community Resource: Global CLAUDE.md examples by u/iBzOtaku (200+ upvotes)

CLAUDE CODE COMMANDS

Session Management

Continue Last Conversation

claude --continue

Resume exactly where you left off

Continue with Prompt

claude --continue --print "Show me our progress"

Continue with specific instruction

YOLO Mode (Danger Zone)

⚠️ Warning: Skips ALL permission prompts. Claude will automatically edit, delete, and execute without asking. Use only when you fully trust the outcome.
claude --skip-permission dangerously

Perfect for repetitive tasks where you know exactly what needs to be done. Dangerous for exploratory work.

Thinking Modes (Magic Words)

Add these keywords to your prompts to trigger extended thinking. Claude will show its thought process in teal boxes.

"think"

"Let's think step by step about this"

~4,000 tokens for reasoning

"think hard" / "megathink"

"Think hard about the best approach"

~10,000 tokens for deeper analysis

"think harder"

"Think harder about this architecture"

Extended reasoning budget

"ultrathink"

"Ultrathink: solve this complex issue"

Maximum 31,999 tokens (45-180s)

When to Use: • Basic "think": Syntax fixes, simple refactoring • "Megathink": Architectural decisions, complex debugging • "Ultrathink": System design, performance optimization, intractable problems
Note: These are prompt keywords, NOT CLI flags. Just include them in your message. Performance follows logarithmic curve - megathink often provides optimal balance.

PERFORMANCE OPTIMIZATION

  • Commit frequently: Save work before/after Claude changes
  • Stagger requests: Break large features into 3-4 focused requests
  • Front-load context: Provide all information upfront
  • Use role setting once: Set expertise at session start
  • Leverage history: --continue is faster than re-explaining
  • Trust inference: Claude understands intent; over-explaining slows you down

Common Pitfalls to Avoid

  • Not committing before Claude sessions
  • Explaining basic programming concepts
  • Using thinking modes for simple tasks
  • Creating new sessions for related work
  • Waiting for "perfect" code before committing

🚀 Got a Claude Code hack?

Share your battle-tested workflows, game-changing repos, productivity tricks & tips with the community

Drop us a line → [email protected]