Skip to content

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 /doctor checkup 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.

0 of 5 steps done0%
  1. 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 Code

    What happens: Started with claude in your repository.

    You type: /init

    Draft the CLAUDE.md from your code.

    Check it worked

    CLAUDE.md is at the repository root, under 200 lines, and /context lists it with the memory files.

  2. 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

    /permissions shows both rules.

  3. Step 3 of 5: Add one skill and one subagent

    Ask Claude to write both, then read what it wrote.
    Paste into Claude Code
    Look 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

    /skills lists your skill, and /context lists 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 agents folder.

  4. 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 Code
    Add 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:

    1. Claude

      Claude finishes a reply

    2. 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

    /hooks lists a Stop hook. Break the code on purpose, ask any question, and Claude goes back to fix it.

  5. 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 Code

    You 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 status shows your new files ready to commit.

Finish · 5 of 5 steps to go

Your project is set up

Using an MCP server? Add it with --scope project as on Day 17, then check /mcp. Next: Day 30.

What you’ll have checked

  • /context lists CLAUDE.md, your skill and your subagent
  • /permissions and /hooks show what you added
  • /doctor reports 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.

We’ll email you when we add or update a lesson. We use your email only for this. Privacy policy

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.

Sources

Checked against the official Claude Code docs on .

Independent resource, not affiliated with Anthropic. HorizonLux wrote this lesson; Claude Code is made by Anthropic.