← →
Advanced Tactics

Claude Code Mastery

The techniques, configurations, and workflow patterns that separate power users from casual users.


Most developers use 10% of Claude Code's capabilities. This deck covers the tactics that turn Claude Code into a true development partner.

10x
Productivity Multiplier
5
Essential Config Files
80%
Less Context Switching
Repository Configuration

The CLAUDE.md Secret Weapon


Most people don't know this: Claude Code automatically reads a CLAUDE.md file from your repository root at the start of every session. This becomes part of Claude's system context.

Insider Tip

The file is read before your first prompt. Pre-configure Claude's behavior, coding style, and project knowledge without wasting tokens explaining it every time.

# CLAUDE.md ## Project Overview This is a Next.js 14 app with App Router. We use TypeScript strict mode and Tailwind. ## Code Style - Use functional components only - Prefer server components by default ## Commands - `pnpm dev` - Start development - `pnpm test` - Run tests

What to Include

Project Architecture
Tech stack, folder structure, key abstractions. Claude references this when suggesting code locations.
Code Conventions
Naming patterns, preferred libraries, import order. Claude follows these in generated code.
Common Commands
Build, test, lint commands. Claude runs these when you say "run the tests".
Business Context
What the app does, key domain terms. Reduces explaining in every prompt.

Pro tip: Keep CLAUDE.md under 500 lines. Link to detailed docs instead of inlining.

Advanced Configuration

Hidden Files Power Users Create


SCRATCHPAD.md

Purpose: Persistent memory between sessions

  • Current task context
  • Decisions made
  • Blockers and open questions
  • Links to relevant files
Why it works

Claude reads this at session start, instantly resuming context from yesterday.

TODO.md

Purpose: Task tracking Claude can update

  • Checkboxes Claude marks complete
  • Priority ordering
  • Sub-tasks and dependencies
  • Completion timestamps
Pro move

"Update TODO.md when done" — Claude maintains your task list automatically.

CONVENTIONS.md

Purpose: Framework-specific patterns

  • Component patterns
  • State management conventions
  • API route structures
  • Testing patterns
Example

"All API routes return { data, error }. Use zod for validation."

The pattern: Reference these in CLAUDE.md: See SCRATCHPAD.md for current context. Claude reads them when relevant, keeping your main config lean.

Command Mastery

Commands Most People Don't Know


Dangerously Skip Permissions

Power User
claude --dangerously-skip-permissions
"YOLO mode" — no confirmation prompts for file edits or commands. Essential for CI/CD pipelines where human approval isn't possible.

Print System Prompt

Debug
claude --print-system-prompt
See the full system prompt Claude receives. Invaluable for debugging why Claude behaves a certain way.

Resume Last Session

Workflow
claude --resume
Continue your previous conversation with full context intact. No re-explaining needed.

Slash Commands Inside Sessions

/compact Context
Summarizes conversation and clears old context. Use when Claude starts forgetting.
/clear Reset
Fresh start, keeps CLAUDE.md context. Use when switching tasks.
/model Switch
Change models mid-session. Haiku for quick tasks, Opus for complex reasoning.
/cost Monitor
Token usage and cost for current session. Essential for budget management.
Hidden gem

/review triggers a code review of staged changes against your CONVENTIONS.md.

Terminal Mastery

Navigating Like a Pro


Keyboard Shortcuts

Escape Cancel current operation
Up Arrow Recall previous prompts
Tab Autocomplete file paths
Ctrl + L Clear terminal (keeps conversation)
Most people miss this

Pipe input directly to Claude:

cat error.log | claude "explain this" git diff | claude "review these changes"

File References

Mention files directly and Claude will read them:
# These all work: "refactor src/utils/auth.ts" "what does @components/Button.tsx do?" "fix the bug in ./api/route.ts"

Multi-line Input

Use Shift + Enter for newlines, or wrap with """ for multi-line mode.

Power pattern: Use glob patterns for bulk operations: "add JSDoc to all files in src/utils/*.ts"

Hidden Capabilities

Advanced Features Most People Miss


MCP (Model Context Protocol)

Give Claude access to external tools — databases, APIs, browser automation.
# ~/.config/claude/config.json { "mcpServers": { "postgres": { "command": "mcp-postgres", "args": ["postgresql://..."] } } }
Now Claude can query your database: "Show me users who signed up last week"

Hooks System

Custom shell commands before/after Claude actions.
# Auto-format after every edit "postEdit": "prettier --write $FILE" # Run tests after src/ changes "postEdit": "npm test --findRelatedTests"

Session Memory

Claude remembers preferences across sessions with /remember:
/remember I prefer single quotes in JS /remember Always use pnpm, not npm /remember Run tests before committing
Persists in ~/.claude/memory.json for all future sessions.

Git Integration

Claude understands git context automatically:
  • Commits: "commit this with a good message"
  • Branches: Knows what branch you're on
  • Diffs: "explain what changed since main"
  • PRs: "write a PR description"
Insider tip

Claude reads your commit history to match your commit message style.

Prompt Engineering

The Art of Prompting Claude Code


High-Impact Patterns

Be Specific About Scope
WEAK
"fix the auth bug"
STRONG
"fix JWT expiry in src/auth/verify.ts:45"
State the Constraint
WEAK
"add caching"
STRONG
"add Redis cache, 5min TTL, don't change API"
Request Verification
End requests with: "...and run the tests" or "...show me the diff first"

The "Think First" Pattern

For complex tasks, ask Claude to plan before executing:
"Refactor auth to use OAuth. First, outline your approach and what files you'll change. Don't make changes yet."
Power user secret

The "as if" pattern: Prime Claude with expertise.

"As a senior engineer doing code review, analyze src/api/ for security issues. Be thorough and specific."

Key insight: Start broad, then drill down. "Fix all TypeScript errors" → "Now fix the ones in src/utils" → "Explain line 42"

Context Optimization

Managing the Context Window


Context Hygiene

Use /compact Regularly
After completing a task, run /compact. Claude retains key decisions but frees up space.
One Task Per Session
Start fresh for unrelated tasks. Context pollution degrades response quality.
Reference, Don't Paste
Say "look at src/api/users.ts" instead of pasting. Claude reads files on-demand.

The .claudeignore File

Most people don't know: Create .claudeignore (like .gitignore) to exclude files.
# .claudeignore node_modules/ dist/ *.log coverage/ .env* src/generated/
Why this matters

Without .claudeignore, Claude might read massive generated files, wasting context. A good .claudeignore can 2-3x your effective context window.

Context budget: Keep CLAUDE.md under 500 lines, SCRATCHPAD.md under 200. Reserve 80% for the actual conversation.

Framework-Specific

Best Practices by Stack


Next.js / React

Add to CLAUDE.md:

## Next.js Rules - App Router (not pages/) - Server Components default - 'use client' only when needed - next/image for all images
Pro tip

Tell Claude your Next.js version. Behavior differs between 13/14/15.

Python / FastAPI

Add to CLAUDE.md:

## Python Rules - Python 3.11+ features OK - Use Pydantic for validation - Async by default - pytest for testing
Pro tip

Include your pyproject.toml path for dependency awareness.

TypeScript / Node

Add to CLAUDE.md:

## TypeScript Rules - Strict mode enabled - No 'any' types - Zod for runtime validation - ESM imports only
Pro tip

Reference tsconfig.json so Claude respects compiler settings.

The Pattern That Works Everywhere

Create docs/llm-guide.md with examples of good code. Reference it in CLAUDE.md. Claude pattern-matches against real examples, not abstract rules.

Testing Integration

Include your test command in CLAUDE.md. Then "implement this and add tests" — Claude writes tests that actually run.

Putting It Together

The Expert Workflow


1

Set Up Your Repository

Create CLAUDE.md, SCRATCHPAD.md, TODO.md, and .claudeignore. 30 minutes that pays dividends forever.

2

Master the Commands

Know --resume, /compact, /model, and /cost by heart. Use --print-system-prompt to debug.

3

Prompt with Precision

Be specific about files and scope. State constraints. Ask Claude to plan before complex tasks. End with verification.

4

Manage Context Actively

Run /compact between tasks. Keep config files lean. Use .claudeignore. Reference files instead of pasting.

5

Iterate and Refine

Start broad, drill down. Use /remember for preferences. Update SCRATCHPAD.md at session end. Build knowledge over time.

The meta-secret

Treat Claude Code as a junior developer with perfect memory and infinite patience. Give it context, give it constraints, verify its work, iterate. The tool amplifies your expertise — it doesn't replace it.