Claude Code Best Practices | Code w/ Claude
Anthropic (speaker: Cal, Applied AI team) · 25:53 · conference talk with live demos + Q&A · watch
Speaker background: joined Anthropic ~1.5 years ago to start the Applied AI team (helping customers build on Claude); downloaded Claude Code on a Friday night to build a notetaking app, topped Anthropic’s internal usage leaderboard over one weekend, and joined the Claude Code team as a core contributor — works on system prompts, tool descriptions/results, and evals.
What Claude Code is
Mental model: “like that co-worker that does everything on the terminal” — his junior-engineer memory of a mentor (“Tony”) doing wizardry in bash+vim.
Under the hood — Anthropic does “the simple thing that works”: Claude Code is a very pure agent = instructions + powerful tools + model running in a loop until it decides it’s done. Layers:
- Tools: file create/edit, terminal; extensibility via MCP
- No codebase indexing, no RAG. Instead: agentic search — Claude explores like a new teammate would, using glob/grep/find iteratively (search → read results → search more → conclude)
- Light UI layer + permission system that forces human input on dangerous actions
- Model backend choice: Anthropic API or AWS/GCP Bedrock/Vertex
Good use cases
- Discovery/onboarding: “where is this feature implemented?”, “read this file + git history and tell me the story of how this code evolved”
- Thought partner (underrated): ask Claude to investigate and report back 2–3 options without writing anything yet, then validate together before committing
- Building: zero-to-one from empty dir works and is fun, but the focus is existing codebases. Internal effects: abnormally high unit-test coverage (adding tests becomes trivial), good commit/PR messages (“hey Claude, write the commit for me”)
- SDLC/deployment: Claude Code SDK headless/programmatic use — sprinkled into CI/CD, GitHub Actions
- Support & scale: faster debugging; unpredicted hit with customers was long-postponed migrations (old Java versions, PHP→React/Angular) becoming digestible month-long refactors
- Terminal excellence transfers to all CLI tools — git, Docker, BigQuery: “how do I get out of this sticky rebase? I’ll just fire up Claude Code”
Best practices
- Use CLAUDE.md files — the agent has no memory between sessions; CLAUDE.md is how state is shared across sessions and teammates. Placed in working directory (checked into project), home directory (always loaded), etc. Contents: how to run tests, repo layout overview, style guide. Build them up over time.
- Permission management — reads run free; writes/bash trigger approve prompts. Shift-tab = auto-accept mode; settings can always-allow specific commands (
npm run test) you’re tired of approving. - Integration setup — CLI tools give Claude more capability; for well-documented tools prefer installing the CLI over an MCP server. Internal tools belong in CLAUDE.md too.
- Context management — context builds up during tool loops; 200K window, watch the bottom-right warning. Two options:
/clear(fresh start, keeps CLAUDE.md) or/compact(inserts a summarization pass — “hand off to another developer picking up where I left off” — and seeds the next stretch). Compact is heavily tuned; max-out → compact → keep going. - Planning + to-dos: instead of “fix this bug,” ask Claude to research cause and present a plan first — verify before implementation. Watch the generated to-do list while it works; if something looks wrong, escape and redirect early.
- Smart vibe coding: TDD loop (small change → run tests → verify), always check TypeScript/linting, commit regularly so you can fall back if it derails.
- Screenshots as input — models are multimodal; paste screenshots or reference image files (“look at mock.png and build this site”).
- Advanced:
- Multiple parallel Claudes — people run four at once via tmux/tabs (“I can only do two”). Orchestration challenge.
- Escape is your best friend — interrupt mid-run to redirect; timing when to interject vs let it work is the skill.
- Hidden feature: escape twice = jump back in conversation history (rewind).
- MCP servers when bash/tools genuinely can’t do something.
- Headless automation (GitHub Actions, beyond) — the frontier the team itself is still exploring.
New-at-time-of-talk features
/modeland/configswitching (default = Sonnet; Opus available)- Thinking between tool calls: previously extended thinking only happened before tool calls; since Claude 4 models can think between calls (visible as gray text interleaved with tool runs). Trigger with phrases like “think hard.”
- VS Code + JetBrains integrations (current-file awareness)
Housekeeping advice: the public anthropics/claude-code GitHub repo hosts issues + changelog — check weekly; shipping is fast enough that even the team can’t keep up.
Q&A highlights
- Nested CLAUDE.md files: subdirectory ones aren’t auto-loaded (monorepo opening at root would blow up context). Claude is instead encouraged to discover and read relevant child-directory CLAUDE.md files while searching.
@-references in CLAUDE.md can pull other files in explicitly. - CLAUDE.md being ignored (kept regenerating obvious inline comments despite instructions): partly a model problem — Claude 3.7 loved leaving comments no matter what the prompt said; largely fixed in Claude 4, which also follows instructions better overall. Suggestion: after moving to new models, re-audit your CLAUDE.md — prune stale workarounds, refresh what remains.
- Multi-agent shared context (audience question): no native support; philosophy stays “one great single agent.” Practical workaround today: have agents communicate through shared markdown files — he personally writes
ticket.mdhandoffs and tells another Claude instance “another developer left this note for you.” Native product support may come later.