Claude Code in Action: Takeaways
Key takeaways from the course: Claude Code in Action
How Coding Assistants Work
A language model alone can only read and produce text — it can’t touch your filesystem. Claude Code closes that gap with tool use: given a task, it gathers context, forms a plan, then calls tools (read files, run commands, edit code) to act on it. How well an assistant handles real work comes down largely to how well its underlying model uses tools.
Context
CLAUDE.md — persistent project instructions, loaded at the start of every session.
CLAUDE.md(or.claude/CLAUDE.md) — committed, shared with the team. Generate a starting one with/init.CLAUDE.local.md— personal, gitignored, same directory.~/.claude/CLAUDE.md— applies to every project on your machine.- Claude also reads an existing
AGENTS.mdwhen your project has noCLAUDE.md— a repo already set up for another coding agent works without extra setup. - Type
#at the start of a message to save it straight to a CLAUDE.md file — Claude asks which one. Or just ask Claude to “add this to CLAUDE.md.”
Anthropic’s official claude-md-management plugin (/plugin install claude-md-management@claude-plugins-official) packages two ways to keep it current instead of maintaining it by hand:
claude-md-improverskill — audits every CLAUDE.md in the repo against a quality rubric, scores it, and proposes targeted fixes for what’s missing or stale./revise-claude-md— run after a productive session to have Claude scan what it just learned and propose diffs to CLAUDE.md (or CLAUDE.local.md), which you approve before anything is written.
Auto memory (new) — separately from CLAUDE.md, Claude now also writes its own notes as it works — your corrections, preferences, and project context it can’t derive from the code — without you asking it to. Browse or edit what’s been saved with /memory.
Bringing files into context
@path/to/filein a message includes that file’s contents in the request.- The same
@syntax works inside CLAUDE.md, so a file like your schema is always available rather than searched-and-read on demand. - Screenshots: paste with Ctrl+V — even on macOS — often faster than describing a UI bug in words.
Controlling context
- Escape — interrupt Claude mid-response to refocus it on one task.
- Escape twice, or
/rewind— roll conversation and code back to an earlier checkpoint, without losing everything Claude has learned about your codebase. /compact— summarize history while keeping what Claude has learned; use when moving to a related task./clear— wipe history entirely; use when switching to something unrelated.
Plan Mode & Thinking
Plan Mode — press Shift+Tab (twice) to toggle it on. Claude explores and proposes an approach without editing anything, so you can redirect it before it touches code. Best for multi-file changes or anything needing broad codebase understanding.
Thinking effort — Claude now decides on its own how much to reason before responding (adaptive thinking), so you rarely need to ask for more. When you do:
- Run
/effort, or set it in/model, to pick a level: low, medium, high, xhigh, or max. - The word “ultrathink” in a prompt is a shortcut for max effort on that one request.
Best paired together: ultrathink through the approach first, confirm the plan, then implement.
Commands and Skills
A custom command is still just a markdown file in .claude/commands/ — the filename becomes the command:
.claude/commands/write_tests.md → /write_testsWrite comprehensive tests for: $ARGUMENTSBut commands have been merged into skills: a .claude/skills/write-tests/SKILL.md produces the same /write_tests command, plus support for bundled files, allowed-tools, and Claude triggering it automatically without you typing the slash. Existing commands keep working — write anything new as a skill instead.
MCP Servers
Extend Claude Code with external tools via MCP:
claude mcp add --transport http notion https://mcp.notion.com/mcp
# for a local process, note the required `--` before the command:
claude mcp add --transport stdio playwright -- npx @playwright/mcp@latestSSE transport is deprecated — prefer http for hosted servers. Grant tool permissions in .claude/settings.local.json:
{
"permissions": {
"allow": ["mcp__playwright"],
"deny": []
}
}Run /mcp to see connected servers, authenticate, or disable ones you’re not using.
GitHub Integration
Run /install-github-app to connect Claude to a repo — it installs the GitHub App, wires up a secret, and opens a PR with workflow files for you to merge.
- Mention workflow:
@claudein any issue or PR comment gets Claude to respond, and it can implement changes and push commits. - Review workflow (optional, chosen during setup): Claude reviews new and updated PRs automatically and posts findings as inline or summary comments.
For automatic PR review without maintaining a workflow file at all, Claude Code also has a separate, simpler Code Review feature — worth checking before building your own review workflow.
Hooks
Hooks run your own commands at points in Claude’s lifecycle — useful for formatting, tests, logging, or blocking specific actions. There are far more hook events now than just “before or after a tool call” — session start/end, prompt submission, compaction, subagent lifecycle, and more — but the two you’ll reach for most are:
- PreToolUse — runs before a tool executes; can block it.
- PostToolUse — runs after a tool succeeds; can’t block it, but can run follow-ups (like formatting the file just edited).
{
"PreToolUse": [
{ "matcher": "Bash", "hooks": [{ "type": "command", "command": "~/.claude/hooks/check.sh" }] }
]
}Configure hooks in ~/.claude/settings.json (global), .claude/settings.json (shared with the team), or .claude/settings.local.json (personal). Run /hooks to confirm one is registered.
Agent SDK vs. Client SDK
Agent SDK (renamed from “Claude Code SDK”) — the same agent loop, tools, and context management as Claude Code, as a library. Python and TypeScript only; for other languages, run the CLI as a subprocess with -p --output-format json.
import { query } from '@anthropic-ai/claude-agent-sdk';
for await (const message of query({
prompt: 'Look for duplicate queries in the ./src/queries dir'
})) {
console.log(JSON.stringify(message, null, 2));
}Client SDK — direct access to the Claude API; you implement the tool loop yourself. Official SDKs cover Python, TypeScript, Java, Go, and C#, each with idiomatic types, streaming, and retries built in.