Claude Code Tips: A Short Course From a Real Repo
Thirteen Claude Code lessons from a real repo: CLAUDE.md, permissions, skills, hooks, subagents, tokens, MCP, headless runs and settings, doc-checked.
By Matthews WongReviewed on Checked against Claude Code v2.1.301
Key takeaway
Claude Code is Anthropic's agentic coding tool for the terminal. These thirteen lessons show how one real repository steers it: a CLAUDE.md that sets the rules, permissions that remove friction, skills that teach house style, hooks that check every edit, subagents that work in parallel without collisions, habits that keep context small, MCP servers, headless runs, parallel worktrees and safe rewinds.
Free, no sign-up, no certificate. Built from the setup that runs this website.
Start the courseWhat you will be able to do
- Write a CLAUDE.md and settings that steer Claude Code without slowing you down.
- Teach project rules once with skills, and enforce them automatically with hooks.
- Run subagents in parallel safely, and keep context and token use under control.
Who it is for
Developers who already use Claude Code for small tasks and want it to follow their project's rules on bigger ones.
Before you start
- Claude Code installed and signed in, and a git repository to practise in.
- Basic terminal and JSON familiarity.
Five questions to find your starting lesson
Already know some of this? Answer five questions from across the course and get a lesson to start at. It is only a suggestion: every lesson stays open.
Claude Code tips
- CLAUDE.md File Example: Global, Project and Local LayersA real CLAUDE.md file example: the managed, user, project and local layers, how they load, @imports, and what belongs in a skill or a hook instead.10 min
- Claude Code settings.json Example: Allow, Ask and Deny RulesA real Claude Code settings.json example: which settings file wins, how allow, ask and deny rules match, why deny wins, and how to keep .env out of reach.12 min
- Claude Code Skills Examples: Write One That Actually TriggersClaude Code skills examples from a real repo: SKILL.md frontmatter, why the description decides triggering, what loads when, and skills vs CLAUDE.md.10 min
- Claude Code Hooks Examples: Guardrails That Always RunClaude Code hooks examples from a real repo: events, matchers, the JSON on stdin, exit codes and JSON output, and when a hook should block or only advise.12 min
- Claude Code Subagents Examples: When to Delegate a TaskClaude Code subagents examples from a real repo: what a subagent sees, the name, description and tools fields, when to delegate, and safe parallel fan-out.12 min
- Claude Code Tips to Save Tokens: Context, Compaction, ScopeClaude Code tips to save tokens: read /context, compact or clear at the right time, scope reads, load skills on demand and keep exploration in subagents.11 min
- Add an MCP Server to Claude Code: Scopes and PermissionsAdd an MCP server to Claude Code with claude mcp add: http vs stdio, local, project and user scope, .mcp.json, MCP permission rules, and the risks.12 min
- Claude Code Headless Mode: claude -p With a Pass/Fail GateRun Claude Code headless with claude -p: output formats, permission modes, allowedTools and dontAsk, plus a verification gate script that closes the loop.13 min
- Claude Code Worktrees: Run Parallel Sessions Without CollisionsRun parallel Claude Code sessions with git worktrees: what claude --worktree creates, what it isolates, what stays shared, cleanup, and subagent isolation.11 min
- Claude Code Rewind and Plan Mode: Undo Risky ChangesHow to undo Claude Code changes: what /rewind restores and what it cannot, how plan mode holds edits for review, and why git stays your real safety net.11 min
- Claude Code Settings Scopes: Which File Wins, What Is SharedClaude Code settings scopes explained from a real repo: user, project, local and managed files, which one wins, what git shares, and how lists merge.10 min
- Where to Put Instructions in Claude Code: A Decision GuideWhere to put instructions in Claude Code: CLAUDE.md, rules, skills, custom commands, hooks or auto memory. A decision table built on a real repo.11 min
- Claude Code Git Workflow: Safe Commits, PRs and Push RulesA Claude Code git workflow that keeps main clean: commit and PR attribution, feature branches, and a deny rule or hook that stops git push and force-push.12 min
10 questions from across the course
One question from each part of the course, in order. Get 8 of 10 right and you have its core. Every answer links to the lesson that teaches it, and nothing is locked either way.