32 Claude Code Tips and Tricks: Beginner to Pro Guide
AI Infrastructure Lead
⚡ Key Takeaways
- Route sub-agents to Haiku — the single biggest cost lever, cutting session costs by 40-60%
- Run /init first, always — generates a CLAUDE.md that prevents Claude from starting every conversation cold
- /compact at 60-70%, /clear between tasks — the context management discipline that prevents hallucinations
- Git worktrees for parallel sessions — run 4+ isolated Claude sessions simultaneously
- Context7 MCP — eliminates hallucinated APIs by injecting version-specific docs on demand
Why Most Developers Use Claude Code at 30% of Its Potential
The gap between a casual Claude Code user and a power user has nothing to do with talent. It comes down to roughly ten commands and a couple of mental model shifts. The casual user types prompts and waits. The power user has a status line showing live context burn, a sub-agent on Haiku doing exploration in parallel, a hook auto-formatting on every save, and a /loop running in the background while they sleep.
We spent three weeks testing every trick in this guide against real production workflows — content pipelines, client builds, security automations. Some of these tricks are obvious once you know them. A few are the kind of thing only developers who have shipped hundreds of Claude Code sessions stumble into. All thirty-two are below, organized from beginner to pro.
Watch the full video walkthrough of all 32 Claude Code tricks
Prefer to listen? Catch this episode on our podcast
Listen on Spotify →Beginner Tricks (1-10): The Foundation Every User Needs
These are non-negotiable. If you are skipping any of them, you are paying a tax for nothing. Get all ten dialed in and you are already operating above 80% of Claude Code users.
1. Run /init Before Your First Prompt
The first thing to do in any new repo is run /init. It walks the codebase, identifies the stack, and writes a CLAUDE.md that captures conventions, file structure, build commands, and context that would otherwise eat your first three prompts. Skipping it means Claude starts every conversation cold.
2. Configure /statusline for Real-Time Visibility
Run /statusline and Claude sets up a custom dashboard at the bottom of your terminal showing the current model, remaining context window, session cost, and git branch. Claude Code without a status line is like driving without a fuel gauge — you only realize you have burned 80% of your context when responses start getting weird.
3. Use Voice Input for Dense Prompts
Apple's built-in dictation, Whisper Flow, or SuperWhisper — pick one. Voice prompts are denser and include the half-thoughts and edge cases you skip when typing. A five-hundred-word voice prompt takes a quarter of the time to produce and consistently gives Claude better specs to work with.
4. Keep Your Context Window Tiny
Every file Claude reads, every tool result, every conversation turn lives in the context window. That window is finite. Do not load a file unless you have a specific reason. Do not dump entire directories. Let Claude pull what it needs through grep and read tools. We learned this the hard way during a refactor when pasting a 2,000-line controller "for context" caused Claude to forget the original task ten turns later.
5. Run /context When Things Feel Off
/context shows exactly what is eating your token budget — conversation history, tool results, CLAUDE.md content, system prompt, MCP server outputs. Each gets a percentage. Eight times out of ten, when Claude does something inexplicably wrong, the issue is context pollution, not the model.
6. /compact at 60-70%, /clear Between Tasks
The folk wisdom is "compact at 80%." That is too late. By 80% Claude is already getting sloppy because the context-to-attention ratio has degraded. We /compact at 60-70% with a focused argument like /compact retain the schema and the failing test cases. When switching tasks entirely, use /clear for a full reset.
7. Plan Mode (Shift+Tab) for Multi-File Changes
Press Shift+Tab to toggle plan mode. Claude analyzes your codebase and produces an implementation plan without writing any code. You review, edit, approve, then execution starts. Make this non-negotiable for any change touching more than one file — the ten seconds reading the plan saves hours of debugging when Claude invents the wrong architecture.
8. Treat Claude Like a Smart Junior Developer
This is a mental model shift, not a command. Junior developers are brilliant but need structure — clear specs, code review, and someone catching architectural decisions before they become tech debt. Brief Claude like a junior. Review its output like a junior. The developers who get burned are the ones who treat it like a senior and walk away after a vague prompt.
9. Force Clarifying Questions Until 95% Confidence
Add one line to your CLAUDE.md: "Before writing code, ask clarifying questions until you are 95% confident in the requirements." The behavior shift is dramatic. Instead of generating half-right code that takes thirty minutes to fix, Claude asks the four questions that pin down the spec before writing anything.
10. Self-Checking Todo Lists With Visual Verification
When assigning multi-step tasks, tell Claude to maintain a todo list and verify each step before marking it complete. For UI work that means a screenshot. For backend work that means hitting the endpoint and showing the response. Without verification, Claude marks things "done" because it wrote the code — with verification, "done" means it actually works.
Intermediate Tricks (11-22): Where Claude Becomes a System
This is the layer where Claude Code stops being a chatbot and starts being a system you architect. With these twelve dialed in, you operate like a senior who has been using Claude Code for a year.
11. Deploy Sub-Agents in Parallel
Sub-agents are spawned-off Claude instances with their own context window and tool access. Define them in ~/.claude/agents/[name].md for global scope or .claude/agents/[name].md for project scope. When building anything with three or more independent components, delegate each to a sub-agent. Three things happen in parallel where you used to do one.
12. Build Custom Skills in ~/.claude/skills/
Skills are reusable instruction packs Claude loads automatically when their description matches the task. Each skill is a directory with a SKILL.md file. The frontmatter tells Claude when to use it, the body tells Claude what to do. Skills load on demand and unload when done — unlike a giant CLAUDE.md, they do not pollute context permanently.
13. Route Sub-Agents to Haiku to Cut Costs by Half
This is the single biggest cost optimization in Claude Code. Set model: haiku in the sub-agent frontmatter and that agent runs on claude-haiku-4-5 instead of Opus. Haiku is roughly 15x cheaper per token. For file searching, log parsing, codebase exploration, and JSON formatting, the quality gap is essentially zero. Three-tier routing (Opus for planning, Sonnet for implementation, Haiku for exploration) dropped average session costs from $2.02 to $0.98 in our testing.
14. Keep CLAUDE.md Under 200 Lines
Every line in CLAUDE.md gets loaded into every conversation. A 500-line file is silently eating context before you type a prompt. Cap it at 150-200 lines and treat anything below that ceiling as a forcing function for prioritization. Refresh it weekly — five minutes of pruning, ten minutes of adding new lessons.
15. Route CLAUDE.md to Linked Subdirectory Files
For larger projects, keep the root CLAUDE.md as a router, not a manual. It says "see docs/conventions.md for code style, see docs/architecture.md for system design." Claude reads the router, then pulls only the linked file relevant to the current task. Modular context loaded only when needed.
16. Exit Early and Re-Ask When Things Drift
If a session is going sideways — wrong direction, hallucinated API, repeated mistakes — do not try to correct it in the same session. Exit, open a fresh session, re-ask with a sharper prompt. Once a session has drifted, the bad context poisons every subsequent turn. A fresh session with a tighter prompt is almost always faster than five turns of correction.
17. Challenge Claude's Output Aggressively
When Claude returns something that "looks right," tell it: "Critique this implementation as if you were a senior engineer in code review. What would you push back on?" Claude is genuinely good at finding flaws when you frame the task as critique instead of generation. We caught a race condition in a payment flow using exactly this prompt — the original implementation passed tests, but the critique pass found the timing bug.
18. /rewind Is Your Quick-Undo Button
Press Esc twice or run /rewind for a checkpoint menu showing every previous conversation state. You can restore conversation-only or code-only — meaning you can roll back messages while keeping file changes, or vice versa. Invaluable when Claude goes down the wrong path five turns ago.
19. /hooks for Notifications, Validation, and Auto-Format
Hooks are deterministic shell commands that run at specific lifecycle points — pre-tool-use, post-tool-use, stop, notification. They run regardless of what Claude decides to do. A post-tool-use hook running prettier on every edited TS file saves ten minutes of cleanup per session. A pre-tool-use hook blocking rm -rf outside specific directories prevents disasters.
20. Screenshots for Visual Self-Check
When Claude edits UI, tell it to take a screenshot and verify the change matches the spec. With Playwright MCP installed, this catches alignment bugs, color drift, and the dozen tiny visual issues that text-only verification misses every time.
21. Chrome DevTools Integration for Live Debugging
Connect Claude to Chrome via the Playwright or DevTools MCP. Claude opens a browser, navigates to your dev server, inspects the DOM, reads console errors, and verifies behavior end to end. The session feels like pair programming with someone who has a browser open at all times.
22. Clone Inspiration Sites by Screenshot
Take a screenshot of a site you want to mimic, hand it to Claude, ask it to reproduce the layout in your stack. With a vision-capable model and good design tokens, you get a working clone in fifteen minutes that would have taken half a day. The output is not pixel-perfect, but the manual polish is fifteen minutes instead of three hours.
Pro Tricks (23-32): Where Claude Becomes Infrastructure
Most Claude Code users will never touch any of this. The ones who do operate at a multiple of throughput that genuinely feels unfair.
23. Parallel Sessions With Git Worktrees
git worktree add ../feature-payments feature/payments creates an isolated working directory tied to a branch. Launch a separate Claude Code session in that worktree — different files, different state, no conflicts. Four parallel sessions is the practical ceiling for most people. While auth ships in worktree A, the payment integration builds in B, the dashboard redesign renders in C, and the webhook handler runs tests in D. That is a feature week compressed into an afternoon.
24. Hit API Endpoints Directly Instead of MCP Servers
MCP servers register tools that get loaded into Claude's context whether you use them or not. A heavyweight MCP can eat 5-10% of your context budget on tool definitions alone. For one-off API interactions, skip the MCP and have Claude call the endpoint directly with curl. Keep MCP servers for tools used in 50%+ of sessions. Everything else goes through direct API calls.
25. /loop for Recurring Background Tasks
/loop 30m check the deploy logs and ping me if there's an error runs every thirty minutes. Omit the interval and Claude self-paces. Loops can run for up to three days. The trick is keeping loop prompts narrow — a loop with a vague mandate gets expensive fast. Narrow scope, clear exit condition, specific report format.
26. Host Claude Code on a VPS for Always-On Agents
Deploy Claude Code on a VPS for loops that run 24/7 without your laptop being open. A $20/month Hetzner box runs a tmux session with Claude Code in it, your loops fire on schedule, and you SSH in to check status from anywhere. The VPS becomes a persistent agent runner instead of a disposable session.
27. Remote Control Claude From Your Phone
Tunnel your VPS Claude session through ttyd or gotty, lock it behind HTTPS and basic auth, and you can drive Claude Code from your phone. Not for heavy work — perfect for quick "restart that loop" or "check the deploy status" interactions when you are away from the laptop.
28. Query Databases in Plain English
Install a database MCP server (Firebase, Supabase, BigQuery, MongoDB) and ask Claude questions like "how many signups in the last 24 hours from US users on the pro plan?" It writes the query, runs it, parses the result, gives you a one-line answer. For exploratory questions during a meeting, plain English through Claude is ten times faster than opening the database console.
29. Ultrathink for the Hard Problems
Anthropic recognizes magic words that scale Claude's thinking budget. The hierarchy: think → think hard → think harder → ultrathink. Each step allocates more thinking tokens. ultrathink triggers roughly 32K thinking tokens — the maximum reasoning Claude will deploy. Use it maybe twice per session, on problems where the wrong answer costs more than the extra tokens.
30. Edit Permissions in settings.json
Stop clicking "approve" twenty times per session. Open ~/.claude/settings.json and configure three permission tiers:
{
"permissions": {
"allow": ["Bash(npm run *)", "Bash(git status)", "Bash(pytest *)"],
"deny": ["Bash(rm -rf *)", "Bash(git push --force *)"],
"ask": ["Bash(git push *)", "Bash(npm publish *)"]
}
}
Allow rules let Claude run safe commands without prompting. Deny rules block destructive commands no matter what. Ask rules force confirmation for sensitive operations. With good permissions, agent loops run autonomously for hours.
31. Build Agent Teams With Shared Context
An "agent team" is a collection of specialized sub-agents — a planner, a coder, a tester, a reviewer — each with its own role, model, and tool access. They communicate through a shared markdown file (team-state.md) that each agent reads at the start of its turn and writes at the end. The planner runs on Opus, the coder on Sonnet, the tester on Haiku. One human, four agents, throughput that genuinely scales.
32. Context7 MCP for Version-Specific Documentation
If you only implement one thing from this entire guide, make it this. The Context7 MCP from Upstash injects up-to-date, version-specific library documentation directly into Claude's context the moment you reference a library. Without Context7, Claude generates code based on training data — deprecated APIs, wrong import paths, functions that do not exist in your version. With Context7, Claude pulls the actual current docs and writes code that works first try.
claude mcp add context7 -- npx -y @upstash/context7-mcp
Restart Claude Code. Done. The hallucinated-API problem essentially disappears for any library Context7 supports.
The Compound Effect: What Changes When You Run All 32
Any one of these tricks is incremental. A few percent better. Five minutes saved. Implement all thirty-two and the curve goes nonlinear.
Our numbers after running all 32 for a full month: average session cost down 60%, throughput up roughly 4x, hallucination rate down by an order of magnitude (mostly thanks to Context7 plus tighter CLAUDE.md hygiene), and time spent clicking "approve" down to near zero because of the permission rules in settings.json.
The mental model shift is real. Stop treating Claude Code like a chatbot. Start treating it like a developer environment you architect. Every trick in this guide is a piece of that architecture.
Our recommendation: do not try to implement all thirty-two at once. Pick three from the beginner section and get them dialed in over a week. Then add three from intermediate. Then ratchet up to pro. The compound effect builds layer by layer, not in a single weekend.
Frequently Asked Questions
model: haiku in the sub-agent frontmatter. Haiku is ~15x cheaper than Opus per token, and for exploration, log parsing, and routine tasks, the quality difference is negligible. Most users report 40-60% cost reduction with this single change./compact summarizes your conversation to free context while keeping continuity — use it at 60-70% when working on the same task. /clear wipes everything — use it when switching to an unrelated task. Mixing two unrelated tasks in one session is one of the fastest ways to make Claude hallucinate.git worktree add ../feature-name feature/branch-name creates an isolated working directory. Launch a separate Claude Code session inside it. Each session has its own files and state. Four parallel sessions is a sustainable ceiling for most developers.claude mcp add context7 -- npx -y @upstash/context7-mcp.settings.json. Common uses include auto-formatting after edits, notifications when long tasks complete, and blocking dangerous commands.Recommended AI Tools
Kie.ai
Unified API gateway for every frontier generative AI model — Veo, Suno, Midjourney, Flux, Nano Banana Pro, Runway Aleph. 30-80% cheaper than official pricing.
View Review →HeyGen
AI avatar video creation platform with 700+ avatars, 175+ languages, and Avatar IV full-body motion.
View Review →Kimi Code CLI
Open-source AI coding agent by Moonshot AI. Powered by K2.6 trillion-parameter MoE model with 256K context, 100 tok/s output, 100 parallel agents, MCP support. 5-6x cheaper than Claude Code.
View Review →Undetectr
The world's first AI artifact removal engine for music. Remove spectral fingerprints, timing patterns, and metadata that distributors use to flag AI-generated tracks. Distribute on DistroKid, Spotify, Apple Music, and 150+ platforms.
View Review →