— Boris Cherny, Member of Technical Staff, Anthropic
Most teams are still using Claude Code like autocomplete with better manners. Type a prompt, accept a suggestion, feel vaguely productive. Meanwhile, a small cohort of engineers has figured out it's not a coding assistant — it's an agentic operating system for your entire development workflow.
This guide is about joining that second group.
If You Only Remember 3 Things
- Claude Code = environment, not prompts. The leverage is in what you build around the tool, not what you type into it.
- CLAUDE.md is your highest-leverage asset. One well-crafted file compounds across every session, every engineer, every month.
- Always use planning + feedback loops. One-shot prompting is the single fastest way to cap your productivity gains at 20%.
Everything else in this guide is elaboration on those three points.
Part 1: The Mental Model
The core agent logic in Claude Code is almost embarrassingly simple: a while loop. Model generates → tools execute → results feed back in. That's it.
What makes it extraordinary is what surrounds that loop: a graduated 5-layer context management pipeline, append-only JSONL session transcripts, a 7-mode permission gradient with ML-assisted auto-approval, git worktree–based subprocess isolation, and a hierarchical memory system the agent can write to itself. That's 98%+ of the codebase — operational infrastructure, not model magic.
The industry built elaborate orchestration graphs on top of weak models. Anthropic went the other way: keep the loop minimal, scaffold the environment so thoroughly that capable models can just work.
If that clicks, the rest of this guide follows naturally. Invest two hours on the context substrate — CLAUDE.md hierarchy, tool integrations, feedback primitives — and you get gains that compound across your whole team indefinitely. Claude Cowork (Anthropic's desktop automation product) was built almost entirely through Claude Code sessions in 1.5 weeks. That's not a benchmark. That's a proof of concept.
Part 2: Setup in 10 Minutes
npm install -g @anthropic-ai/claude-code
Node.js required. You knew that. Here's what you probably skipped.
Run these slash commands first, before anything else:
/terminal-setup — Enables Shift+Enter for newlines. Without it you're firing prompts mid-sentence like it's 2009 IRC./install-github-app — Genuinely transformative. @mention Claude on any GitHub issue or PR directly./allowed-tools — Whitelist your frequent tools. After the fifteenth "Are you sure you want me to run grep?" you will either whitelist or quit./theme — Light/dark. Minor, but do it now.macOS dictation: Enable it (System Settings → Accessibility → Dictation) and speak prompts while your hands stay on the trackpad examining output. Sounds gimmicky until you try it on a complex refactoring instruction.
Keyboard shortcuts worth memorizing:
| Shortcut | What It Does |
|---|---|
Shift+Tab | Accept edits |
# | "Remember this" — writes to CLAUDE.md |
! | Run bash; output stays in context |
@ | Reference files/folders |
Esc Esc | Jump back in history |
Ctrl+R | Show full output Claude sees |
The # shortcut is the compounding one. Every # always use the Barley CLI for log inspection survives into every future session. Institutional memory, one keystroke at a time.
Part 3: CLAUDE.md — Your Most Important File That Isn't Code
CLAUDE.md files are plain Markdown that Claude Code loads automatically at session start. Three levels:
~/.claude/CLAUDE.md — Global, cross-project. Your personal engineering constitution: universal preferences, tool habits, style principles, safety policies.
project-root/CLAUDE.md — Project-specific. Checked into source control. Shared with the whole team. Architectural decisions, key file locations, testing conventions, onboarding shortcuts, known landmines.
CLAUDE.local.md — Personal project overrides. Gitignored. WIP experiments, "I keep forgetting to…" notes.
Subdirectory CLAUDE.md files load automatically. Create one in /src/payments/ and it only activates for payment-related work. Context is scoped, not flat.
What goes in: Bash commands, MCP tools, style constraints, architectural rules ("never raw SQL — always the repository layer"), testing oracles, known failure modes.
What stays out: Everything grep can find. CLAUDE.md is for what can't be discovered programmatically — decisions, conventions, tribal knowledge. Don't paste your README.
The team multiplier: Once project-root CLAUDE.md is in source control, every new hire inherits an agent that already understands your architecture. Anthropic's technical onboarding dropped from 2–3 weeks to 2–3 days. Not because Claude Code is magic — because the knowledge that lived in senior engineers' heads now lives in a versioned file an AI can actually use.
Part 4: Common Mistakes That Kill Performance
These are not theoretical. They are what most teams are doing right now.
Part 5: The 5-Layer Context Pipeline (Why It Stays Coherent)
Most agent tools use brute-force context truncation. Claude Code runs a graduated pipeline before every model call — least destructive first, most destructive last:
Boundary markers are preserved at every stage. Sessions stay coherent for days because the pipeline applies minimum intervention, not brute-force truncation.
Part 6: Sessions as Git Commits
Every session is stored as an immutable JSONL event log at ~/.claude/projects/. Every file edit, bash command, model response, tool call — recorded, in order, permanently.
Resume exactly, not approximately. Full fidelity including mid-task state. For a 20-minute sprint this is nice. For a multi-day architectural refactor it's essential.
Permissions reset on resume. Deliberately. This prevents permission creep — the subtle session-by-session expansion of what the agent is trusted to do without asking. Annoying the first time. Clearly right after you think about it.
Boris runs five parallel Claude Code instances on the same repo — different terminals, different worktrees, different subagents — and the JSONL architecture is what prevents chaos. Fork a subagent for risky refactors. Review the transcript. Merge what you want. Branch-based development, applied to AI-assisted work.
Part 7: Planning Mode + Feedback Loops
The shift from Copilot-style to agentic: give Claude a way to verify its own work.
Before any non-trivial task: "Brainstorm the approach. Write a plan. Run it by me before touching files."
Thirty seconds overhead. What it buys: the agent catches its own misunderstandings before they become broken code, you get a plan you can actually redirect, and there's a natural checkpoint before significant work goes in the wrong direction.
After approval, give it a test oracle:
- A unit test suite to run after every change
- Puppeteer screenshot comparison against a mockup
- iOS simulator screenshots for mobile UI
- A CLI validation command
- Bare minimum: "confirm the build passes before telling me you're done"
Part 8: Multi-Agent Workflows
Open five terminals. SSH into Tmux. Spin up subagents via the SDK. Each gets its own git worktree — multiple working trees on the same repo, no conflicts, no Docker required.
Why it doesn't collapse into chaos:
- Git worktrees = filesystem isolation per subagent
- JSONL transcripts = independent audit trail per session
- Human review at merge = judgment stays yours
Practical patterns:
Part 9: Tool Integration (Where Most Teams Leave Real Leverage)
Claude Code doesn't know your internal tooling. This seems obvious. It is also the thing most teams forget for months.
Tell it about your internal CLIs, monitoring commands, deployment scripts, and branch naming conventions. Put it all in CLAUDE.md. One entry, infinite sessions.
For structured integration: check an mcp.json into your repo with MCP server configurations. Every engineer who clones gets prompted to install once. After that, every Claude Code instance on your team has access to the same tools — database inspection, ticket system, internal docs. This is how individual productivity becomes organizational infrastructure.
Part 10: The Master Prompt
Run this once per project. Rerun every 2–4 weeks.
You are the Environment Architect for Claude Code — an expert at turning any
software project into a high-signal, self-improving agentic workspace.
Project context:
[PASTE YOUR PROJECT DESCRIPTION, TECH STACK, GOALS, PAIN POINTS,
TEAM SIZE, AND EXISTING ARCHITECTURAL DECISIONS HERE]
Your single output must be a complete, ready-to-deploy Claude Code environment:
1. Global CLAUDE.md (~80–150 lines) — cross-project rules, style guide,
common bash/MCP tools, safety policies.
2. Project-root CLAUDE.md — architecture decisions, key files, onboarding
shortcuts, testing oracles, feedback loops.
3. CLAUDE.local.md template (gitignore'd) — personal overrides, temp notes.
4. Hierarchical Memory Strategy — how the agent uses NOTES.md / TODO.md /
DECISIONS.md, when to promote via # remember, conflict-resolution rules.
5. Skill & Hook Library — 5–8 MCP skills or lifecycle hooks with JSON schema
and example usage.
6. Workflow Playbook — 3–4 reusable prompt templates: Planning Mode, Code
Review Mode, Refactor Mode, Incident Response.
7. Compaction & Context Policy — instructions for the 5-layer pipeline,
tool-result clearing, summarization, long-horizon session resumption.
8. Self-Improvement Rules — the agent periodically proposes CLAUDE.md
refinements for human approval (generation → reflection → curation).
Constraints:
- Every file under 200 lines. Signal density over completeness.
- Reference Claude Code primitives: # remember, ! bash, @ files,
sub-agent worktrees, auto-accept mode, permission gradients.
- Favor just-in-time glob/grep over pre-loading.
- Output: one Markdown block, clear headings, code fences per file.
End with "Next Step" instructions.
Begin.
Fill in the project context honestly. Specific pain points yield better output than generic descriptions. The result won't be perfect — it'll be 80% there in one shot, which is 80% better than what most teams have after months of ad-hoc tuning.
Where This Breaks
Claude Code is genuinely powerful. It is not magic. Here's where it struggles, based on real usage patterns:
Part 11: The Cutting Edge
Implementation Sequence
mcp.json. Wire up feedback loops (test suite, build validation).After month one, your context files have compounded enough that new team members get better sessions from day one. After six months, your CLAUDE.md hierarchy is an organizational artifact as important as your ADRs.
The Actual Mindset Shift
The engineers who get the most from Claude Code aren't the ones with the best prompts. They're the ones who treat context engineering as a professional discipline — worth studying, iterating on, and improving continuously.
Claude Code is the first developer tool where your investment in the environment compounds over months and years. A new team member doesn't just inherit a codebase — they inherit an intelligent, contextually rich workspace that knows your architecture, your conventions, and your war stories.
Sources
Anthropic Official
- Claude Code Documentation
- Anthropic Engineering Blog
- Boris Cherny's Claude Code Workshop (30 min)
- Model Context Protocol Documentation
- Building Effective Agents (Anthropic, 2025)
Academic Research
- ACE: Adaptive Context Engineering Framework — arXiv:2510.04618
- Graph-based Agentic Memory (GAM/HiMem)
- VMAO: Verified Multi-Agent Orchestration
Community Resources
Crafted by Nicolas Martin with Claude | Fractal-Apps Pvt Ltd, Pondicherry | April 21, 2026