Published: 2026-04-27
Deep dive

32 Claude Code Tricks: CLAUDE.md, /compact, Sub-agents & More

Chapters / key moments (click to jump — plays here on the page)

Nate Herk compresses 32 practical Claude Code workflow improvements into 16 minutes — from /init auto-generating a CLAUDE.md and keeping it under 200 lines, to /compact at 60% context, plan mode, parallel sub-agents with Haiku for cheap processing, and building reusable custom skills in .claude/skills/.

Source video

"32 Tricks to Level Up Claude Code in 16 Mins" by Nate HerkWatch on YouTube →

Commands & Slash Commands Covered

/init

/init

Purpose: Scans your codebase and auto-generates a CLAUDE.md file mapping your architecture, conventions, and key files — a project "cheat sheet" that loads at the start of every session.

When to use: On any existing project before your first Claude Code session. Also useful for new projects — describe your goal and tech stack and Claude Code will write the CLAUDE.md for you.

/status line

/status line

Purpose: Creates a persistent status bar at the bottom of your terminal showing model, context percentage, cost, and whatever else you specify.

When to use: Set once per project so you always know how much context you have left and can avoid context rot before it affects quality.

/context

/context

Purpose: Shows a percentage breakdown of what's consuming your context window — system prompts, file contents, MCP servers.

When to use: When a session feels slow or expensive. Diagnose the source before restructuring.

/compact

/compact
/compact but keep all the API integration decisions and database schema

Purpose: Compresses conversation history to free context space. The optional "keep X" parameter tells Claude what to preserve through the compression.

When to use: At approximately 60% context fill. Don't wait until you hit the limit — compacting early keeps quality higher.

/clear

/clear

Purpose: Wipes the conversation history entirely for a clean slate — but your CLAUDE.md and project files are still there, so you're not starting from scratch.

When to use: When switching to a completely different task where the current conversation history is irrelevant.

/voice

/voice

Purpose: Native voice input — speak into the terminal to send prompts. Rolling out gradually as of the video date.

When to use: When typing is inconvenient, or for rapid ideation where you think faster than you type.

Step-by-Step Breakdown: The Key Patterns

  1. Generate CLAUDE.md with /init (beginner)

    On any existing project run /init. Claude Code scans your codebase and writes a CLAUDE.md. On a new project, tell Claude Code your goal and tech stack and have it write the file. From then on, every session starts with Claude already knowing your conventions.

  2. Plan mode before every coding session (beginner)

    Hit Shift+Tab to cycle modes until you reach plan mode. In plan mode, Claude reads and researches but won't change any files. It outlines steps, asks clarifying questions, and maps the approach before writing a single line of code. Switch out only when you approve the plan. Reduces revisions significantly.

  3. Compact at 60% — with a "keep" parameter (intermediate)

    Watch the context bar in your status line. Around 60% fill, run /compact with a "keep" instruction specifying what must survive the compression. This extends sessions without losing the most important architectural decisions.

  4. Deploy sub-agents for parallel work (intermediate)

    For complex tasks, include "use sub-agents" in your prompt. Claude Code spins up isolated sub-agents, each with their own context window. They work in parallel and report back to the main thread. This prevents the main context from bloating while exploratory or processing work runs in parallel.

  5. Use Haiku for sub-agents on simple tasks (advanced)

    When a sub-agent is doing simple processing (scraping articles, reading large amounts of text, formatting output), set its model to Haiku. Keep the main orchestrating thread on Opus. The cost difference is large — Haiku processing hundreds of thousands of tokens costs a fraction of Opus doing the same.

  6. Build custom skills in .claude/skills/ (advanced)

    Create markdown files in .claude/skills/ (e.g. techdebt.md, codereview.md) that define reusable workflows. Invoke them by name in natural language or via /command. Claude Code runs the workflow consistently every time. Commit to GitHub so the whole team shares them — your SOPs become automated.

  7. Keep CLAUDE.md under 150–200 lines (advanced)

    CLAUDE.md is your system prompt — it loads into every context window every session. Log new patterns and gotchas as you discover them, but trim actively. If it exceeds ~200 lines, cut the least essential content or route it to an external file.

  8. Route CLAUDE.md to external files (advanced)

    Instead of embedding style guides, business context, or project docs directly in CLAUDE.md, point to them: "see docs/style-guide.md for formatting conventions". Claude knows where to look but doesn't load the content into every session unnecessarily.

Gotchas & Caveats

  • CLAUDE.md bloat — every line in CLAUDE.md costs tokens in every session. A 400-line CLAUDE.md can eat 10–15% of your context window before you've typed a single prompt. Keep it lean; route to external files for reference content.
  • Exit early — if Claude starts going the wrong direction, hit Escape and re-prompt. Every token spent going the wrong way is wasted context that eats into your session budget.
  • Sub-agents aren't free — sub-agents each have their own context window and cost. Only spawn them for tasks that are genuinely parallel and worth the overhead.
  • Verify after /compact — /compact preserves what you tell it to, but always skim the session state after compressing to confirm nothing critical was lost.
  • /voice rollout — as of the video date, /voice was still rolling out and not available to all users.

Key Takeaways

  • /init auto-generates CLAUDE.md from your existing codebase — run it on every new project before the first session.
  • Keep CLAUDE.md under 150–200 lines and route reference content to external files to control context window costs.
  • Always start complex tasks in plan mode (Shift+Tab) before Claude writes any code — it dramatically reduces revision cycles.
  • Use sub-agents with Haiku for cheap parallel processing; keep the main thread on Opus for orchestration and decision-making.
  • Custom skills in .claude/skills/ make repeatable workflows automatable and shareable via GitHub.
  • /compact at ~60% context with an explicit "keep" instruction extends sessions without losing critical architectural decisions.

📬 Weekly Digest — In Your Inbox

One email a week: top news, releases, and our deepest new guide. No spam.