Claude Code Mastery
Guide
VOL.02 — 2026
48
tricks
to master Claude Code.
From session setup to multi-agent pipelines — the patterns that separate everyone who uses Claude Code from those who truly master it.
Section 01
Beginner
14 tricks
Section 02
Intermediate
18 tricks
Section 03
Advanced
10 tricks
VJVishal Jaiswal
01 / 27 →
Section 01 · Beginner
02 / 27
The fundamentals.
The very first things to do before writing any code. Session setup, context hygiene, and prompt
strategy that compounds for years.
/init
@filename
/clear vs /compact
Plan mode
/simplify
VJVishal Jaiswal
Section 01 — Beginner
Section 01 · Session Setup
03 / 27
Session setup.
The very first things to do before writing any code.
01Beginner
Always start with /init.
Run /init at project start to auto-generate a project-specific CLAUDE.md.
Without it, Claude defaults to global settings and misses critical project context entirely.
02Beginner
Monitor the /statusline.
The /statusline shows model name and context percentage with a progress bar.
Watch it to catch context bloat early — before it derails your session mid-task.
Swipe
VJVishal Jaiswal
Tricks 01 — 02
Section 01 · Context Hygiene
04 / 27
Context hygiene.
Precision context = better output + fewer wasted tokens.
03Beginner
Use @ to attach specific files.
Type @filename to inject only the files Claude needs, instead of letting it
scan everything. Targeted context produces sharper, more relevant responses.
04Beginner
/clear vs /compact — know the diff.
Use /clear for a full context wipe. Use /compact to summarise and
compress. Golden rule: 2 consecutive failures = /clear and restart with a better prompt.
VJVishal Jaiswal
Tricks 03 — 04
Section 01 · Token Management
05 / 27
Token management.
Control what survives compression — don't leave it to chance.
05Beginner
/compact with custom instructions.
Pass a policy: /compact Focus on API changes or /compact Preserve error
causes. You decide what context survives, not the algorithm.
06Beginner
Keep CLAUDE.md short.
Bloated CLAUDE.md = ignored rules. For every line ask: "If I remove this, will Claude
make mistakes?" If no, delete it. Brevity is a performance requirement.
VJVishal Jaiswal
Tricks 05 — 06
Section 01 · Prompt Strategy
06 / 27
Prompt strategy.
Structure how you talk to Claude; it changes everything.
07Beginner
Plan mode before writing code.
Always enter Plan Mode first. Claude lays out its full approach before touching a file.
This eliminates 80% of back-and-forth and misaligned implementations.
08Beginner
Ask for step one only.
Never say "implement the whole feature." Ask for step one → review → ask for step
two. Keeps you in control at every checkpoint. Tedious but worth it.
VJVishal Jaiswal
Tricks 07 — 08
Section 01 · Quality First
07 / 27
Quality first.
Build quality loops directly into your workflow.
09Beginner
Let Claude fix its own bugs.
Resist patching bugs yourself. When Claude self-corrects, it builds a better mental model
of your codebase. Your quick patch robs it of that learning opportunity.
10Beginner
Run /simplify before review.
Claude over-engineers by default. Run /simplify before every code review to
strip unnecessary complexity. You should review intention, not noise.
VJVishal Jaiswal
Tricks 09 — 10
Section 01 · Workflow Habits
08 / 27
Workflow habits.
Stop babysitting Claude. Stay in review mode.
11Beginner
Enable desktop notifications.
Turn on notifications so Claude pings you when long tasks finish. Walk away, do other work.
Claude calls you back when it needs input — stop watching the terminal loop.
12Beginner
Batch review with "add to todo".
During review, don't ask Claude to fix issues on the fly. Say "add to todo: fix
X." Collect all issues first → then process the todo list together. Stay in review mode throughout.
VJVishal Jaiswal
Tricks 11 — 12
Section 01 · Personal Setup
09 / 27
Personal setup.
Make Claude inherit your defaults — everywhere.
13Beginner
Screenshot bugs (Ctrl+V).
Screenshot visual bugs with Print Screen / Cmd+Shift+4 and paste directly into Claude with
Ctrl+V. A 2-second screenshot tells Claude more than 3 paragraphs of text description.
14Beginner
Global ~/.claude/CLAUDE.md.
Store personal preferences (tone, code style, output format) in
~/.claude/CLAUDE.md — every project inherits them automatically. Reserve project-level
CLAUDE.md for team-only rules.
VJVishal Jaiswal
Tricks 13 — 14
Section 02 · Intermediate
10 / 27
Build persistent
systems.
Move from prompting to designing AI systems. Subagents, skills, hooks, and integrations that
compound across sessions.
.claude/agents/
.claude/skills/
permissions.deny
MCP
/insights
VJVishal Jaiswal
Section 02 — Intermediate
Section 02 · Sub-Agents & Skills
11 / 27
Sub-agents & skills.
Move from prompting to building persistent AI systems.
15Intermediate
Subagents = isolated contexts.
Define agents in .claude/agents/ to run tasks in separate context windows. Use
for research, verification, and review — prevents contamination from failed attempts.
16Intermediate
Skills auto-fire on context.
Skills in .claude/skills/ activate automatically when context matches — no
manual trigger. Turn your team's tacit coding standards into a persistent, auto-applied knowledge layer.
VJVishal Jaiswal
Tricks 15 — 16
Section 02 · Permissions & Security
12 / 27
Permissions & security.
Stop clicking approve on everything — build guardrails instead.
17Intermediate
Allowlist safe commands.
Add trusted commands to permissions.allow, e.g. npm run test:*,
git status. Approval fatigue = clicking without reading = security fails.
18Intermediate
deny makes files invisible.
Set .env and secrets to deny in permissions — they become
completely invisible to Claude. More secure than hooks because deny evaluates first in the
permission chain.
VJVishal Jaiswal
Tricks 17 — 18
Section 02 · File Architecture
13 / 27
File architecture.
Structure your project files to work with Claude, not against it.
19Intermediate
Hierarchical CLAUDE.md files.
Root = team rules. Parent dirs = monorepo shared config. Child dirs = module-specific
rules. Each layer loads contextually — only what's needed per session.
20Intermediate
Download API docs locally.
When integrating any external API, download its docs and give Claude direct local access.
Eliminates hallucinated methods and can cut integration time by over 60%.
VJVishal Jaiswal
Tricks 19 — 20
Section 02 · Session Intelligence
14 / 27
Session intelligence.
Make every session smarter than the last — automatically.
21Intermediate
End each session with a retro.
Ask "What did you learn this session?" and save the output. Over weeks, this
becomes a project knowledge base. Future sessions start from a higher floor, not a blank slate.
22Intermediate
Build a /session-wrap skill.
Automate your retro: a skill that reviews affected docs, finds stale facts, proposes hooks
for rule violations, updates roadmap status, and commits to git, all in one command.
VJVishal Jaiswal
Tricks 21 — 22
Section 02 · Visual Debugging
15 / 27
Visual debugging.
Let Claude see your UI. Connect it to the browser.
23Intermediate
Use the preview pane.
The desktop app's Preview renders your frontend live. Claude interacts with it, spots
broken flows, takes screenshots, and self-fixes UI bugs — turning visual QA into an autonomous loop.
24Intermediate
Chrome DevTools via MCP.
Connect Claude to Chrome DevTools via MCP. It can inspect the DOM, capture console errors,
and debug network requests in real time — no more copy-paste feedback loops.
VJVishal Jaiswal
Tricks 23 — 24
Section 02 · Integrations
16 / 27
Smarter integrations.
Pick the right tool for the right surface.
25Intermediate
Clone any UI from a screenshot.
Screenshot any UI you admire and say "rebuild this." Claude reverse-engineers the
layout, spacing, components, and colour palette. A 30-second prototyping superpower.
26Intermediate
API mode vs MCP — know the diff.
Use the Claude API for batch pipelines and headless automation. Use MCP
for real-time tool integrations. Mixing them up wastes latency and cost.
VJVishal Jaiswal
Tricks 25 — 26
Section 02 · Safety Loops
17 / 27
Safety loops.
Catch regressions early. Roll back fearlessly.
27Intermediate
Run tests after every change.
Tell Claude to run tests after every significant change. Catching regressions immediately
is far cheaper than debugging them 10 commits later.
28Intermediate
Checkpoints for safe rollback.
Claude auto-creates checkpoints after every action. Restore just the conversation, just the
code, or both. Experiment freely — rollback is always one step away.
VJVishal Jaiswal
Tricks 27 — 28
Section 02 · Memory & Insight
18 / 27
Memory & insight.
Shape what Claude remembers. See what it sees.
29Intermediate
Run /insights regularly.
Type /insights to generate an HTML report of what Claude thinks you can
improve — in your workflow and codebase. Run it at each project phase. It's surprisingly self-aware.
30Intermediate
Praise to build specific memory.
Say "that worked great, love it" when Claude does something right — it creates
targeted memory files that reinforce the behaviour. Keeps CLAUDE.md lean. Works in reverse too.
VJVishal Jaiswal
Tricks 29 — 30
Section 02 · Documentation & Branches
19 / 27
Docs & branches.
Capture knowledge. Experiment safely.
31Intermediate
Generate a deployment guide.
Ask Claude to create a deployment guide: all env vars, startup commands, dependency
versions, migration steps. Invaluable when switching machines or onboarding a new team member.
32Intermediate
Branch before big experiments.
Tell Claude "create a branch for this experiment." Test freely, merge if it works,
discard if not. Pair with checkpoints for maximum safety on unfamiliar territory.
VJVishal Jaiswal
Tricks 31 — 32
Section 03 · Advanced
20 / 27
Scale & automate.
Run multiple agents. Test from the user's perspective. Audit security. Move from handcrafted
prompts to batch production workflows.
git worktree
tmux on VPS
Hooks
Writer / Reviewer
Security audit
VJVishal Jaiswal
Section 03 — Advanced
Section 03 · Parallelism
21 / 27
Run things in parallel.
Scale Claude across branches and large file sets.
33Advanced
Git worktrees for parallel sessions.
Run git worktree add ../project-review feature-branch to give each Claude
session its own directory. Prevents file collision when running multiple agents simultaneously.
34Advanced
Fan-out: test 2-3 files first.
Before mass migrations, test your prompt on 2-3 sample files. Verify output, adjust, then
fan out to hundreds of files. Discovering a bad prompt after 500 files is painful and expensive.
VJVishal Jaiswal
Tricks 33 — 34
Section 03 · Headless & Tests
22 / 27
Headless & tested.
Run Claude in the background. Generate tests automatically.
35Advanced
Run Claude headless on a VPS.
Deploy on a VPS with tmux for persistent background sessions. Use
--output-format stream-json for real-time monitoring. Long jobs run overnight — your laptop
stays free.
36Advanced
Auto-generate test suites.
Ask Claude to generate comprehensive tests for every new module. It uses implementation
context to cover edge cases you'd likely miss manually.
VJVishal Jaiswal
Tricks 35 — 36
Section 03 · Hooks
23 / 27
Mandatory hooks.
Don't trust prompts for non-negotiables. Use hooks.
37Advanced
Lint-on-save via hooks.
PostToolUse hook: auto-run lint after every file write. Claude fixes violations before you
ever see them — guaranteed clean commits.
38Advanced
Hooks are mandatory; CLAUDE.md is advisory.
Use PreToolUse/PostToolUse hooks for non-negotiables (auto-lint, block .env
writes). CLAUDE.md is for guidance needing judgment. Hooks are deterministic — they never forget.
VJVishal Jaiswal
Tricks 37 — 38
Section 03 · Specs & Reviewers
24 / 27
Specs & reviewers.
Separate intent from implementation. Use bias isolation as a feature.
39Advanced
Separate spec & implement sessions.
Session 1: "Interview me about this feature, output SPEC.md." Session 2:
"Implement SPEC.md." Clean context + clear spec = far fewer mid-build surprises.
40Advanced
Writer / reviewer pattern.
Session A writes code. Session B reviews it — with zero context bias. Works for tests too:
write tests in A, implement blind in B to pass them. Built-in QA isolation.
VJVishal Jaiswal
Tricks 39 — 40
Section 03 · User-Side Testing
25 / 27
User-side testing.
Spot bugs you can't see from the code side.
41Advanced
Give Claude its own user account.
Create a Claude account in your app. It navigates flows as a real user — spots UX bugs,
broken auth paths, and broken states you'd never catch from the code side. Delete it when done.
42Advanced
Ask for a security audit.
After any major feature, ask Claude to "perform a security audit of this
codebase." It checks for hardcoded secrets, injection vulnerabilities, exposed endpoints, and
insecure defaults.
VJVishal Jaiswal
Tricks 41 — 42
Section 04 · Pro Patterns
26 / 27
The pro playbook.
Six patterns that compound. Custom slash commands. Multi-agent pipelines. Cross-model review.
Admin debug backends. Named parallel sessions. Live docs via MCP.
43
Custom slash commands.
Encode your full review process. One trigger. Every step.
44
Multi-agent pipelines.
Planner, Writer, Reviewer, Tester. True parallel throughput.
45
Context7 MCP.
Inject up-to-date docs at query time. No more stale-API
hallucinations.
46
Vet plans with a 2nd model.
Cross-model QA pass before implementation. Senior-dev mandatory.
47
Admin debug backends.
Build in-app tools Claude can read. Surface patterns automatically.
48
/rename + /resume.
Build a portfolio of named parallel sessions. Switch context in
seconds.
VJVishal Jaiswal
Section 04 — Pro
Level up your workflow
48 tricks.
All yours.
Build faster, ship smarter, scale fearlessly. These are the patterns that separate developers
who use Claude from those who truly master it.
VJVishal Jaiswal
27 / 27 — END
Drop a connection request if you're building AI-native tools!