Day 29 of 52 · about 30 min · Basics
Capstone: set up your own project end to end
Everything so far ran on a practice project. Now the same setup goes into the repository you work in every day, one piece at a time, with a checkup at the end.
You’ll finish with
- Your repository set up with the core features, ready to commit
- A
/doctorcheckup with no invalid settings
You’ll need
- A git repository you work in, and its test command
- A clean working tree, so today’s changes are easy to review
Before you start
Tell us about your setup and the steps change to fit it. Your answers stay in this browser, and you can change them at any time.
Which system are you on?
Commands differ between systems. Pick the one you’ll run Claude Code on.
The steps
One step at a time. When a step’s check matches, tick it and the next one opens.
Step 1 of 5: Write the CLAUDE.md
Let `/init` draft it, then cut it down.Start Claude Code in your repository and run
/init. If a CLAUDE.md already exists, it suggests improvements instead of overwriting. Keep the file under 200 lines.In Claude CodeWhat happens: Started with
claudein your repository.You type: /init
Draft the CLAUDE.md from your code. Check it worked
CLAUDE.mdis at the repository root, under 200 lines, and/contextlists it with the memory files.Step 2 of 5: Set permission rules
Allow your test command and deny reading secrets.Put these rules in
.claude/settings.json, using your own test command. The file is shared with your team when you commit it..claude/settings.json- permissions.allow: ["Bash(npm test)"]
- Runs your tests without asking
- permissions.deny: ["Read(./.env)", "Read(./.env.*)"]
- Claude’s file tools can’t read your env files
One allow rule and one deny rule. Check it worked
/permissionsshows both rules.Step 3 of 5: Add one skill and one subagent
Ask Claude to write both, then read what it wrote.Paste into Claude CodeLook at how we work in this repository, then create two files. Show me each one before you save it. 1. A project skill in .claude/skills/ for the task I repeat most: <describe the task>. 2. A project subagent in .claude/agents/ that reviews my uncommitted changes for bugs. It may read files but must not edit them, and it reports findings with file and line.your-repo/
- folder .claude
- folder skills
- folder your-skillNew
- SKILL.mdNew
- folder agents
- reviewer.mdNew
The two new files. Check it worked
/skillslists your skill, and/contextlists the subagent with the file it loaded from.If it didn’t work
The subagent doesn’t show up.
Restart Claude Code. A running session doesn’t notice a newly created
agentsfolder.Step 4 of 5: Add a hook that runs your tests
Make the test run a guarantee, not a request.This is the Stop hook from Day 14, pointed at your own tests.
Paste into Claude CodeAdd a Stop hook to .claude/settings.json that runs <your test command> when you finish a reply. - If the tests fail, the hook exits with code 2 and prints the failures to stderr, so you go back and fix them. - If stop_hook_active is true in the hook's JSON input, it exits 0, so it can't loop. Show me the script and the settings change before you save them.In order:
Claude
Claude finishes a reply
Hook
The Stop hook runs your tests
If the tests fail
Claude keeps working
The failures go back to it
If they pass
Claude stops
What the Stop hook adds to every reply. Check it worked
/hookslists a Stop hook. Break the code on purpose, ask any question, and Claude goes back to fix it.Step 5 of 5: Run the checkup
`/doctor` finds what you missed.It flags invalid settings, unused extensions and CLAUDE.md lines Claude could work out from the code.
In Claude CodeYou type: /doctor
What happens: Claude proposes fixes and applies them only after you confirm.
The setup checkup. Check it worked
No invalid settings files are reported, and
git statusshows your new files ready to commit.
Finish · 5 of 5 steps to go
Your project is set up
What you’ll have checked
/contextlists CLAUDE.md, your skill and your subagent/permissionsand/hooksshow what you added/doctorreports no invalid settings
Lesson updates by email
Get lesson updates by email
Leave your email and we’ll tell you when we add or update a lesson.
Claude Code for your team
Want Claude Code set up across your team?
HorizonLux sets up and repairs Claude Code for teams: CLAUDE.md rules, hooks that enforce them and reviewed MCP servers. Book a free call to talk it through.
Related
Sources
Checked against the official Claude Code docs on .
- Debug your configuration
- How Claude remembers your project
- Configure permissions
- Extend Claude with skills
- Create custom subagents
- Hooks reference
- Best practices for Claude Code
Independent resource, not affiliated with Anthropic. HorizonLux wrote this lesson; Claude Code is made by Anthropic.