Skip to content

Day 52 of 52 · about 40 min · Subagents · Bonus

Final capstone: ship a feature from plan to pull request

The last day puts the whole workflow on one real change: plan it, build it in its own worktree with your tests checking every reply, get it reviewed, and open the pull request.

You’ll finish with

  • One feature shipped as a reviewed pull request
  • A loop you can repeat on every change

You’ll need

  • Your repository from Day 29, with the test hook pushed to the default branch
  • The GitHub CLI gh, signed in, so Claude can open the pull request
  • One small feature you need, with a clear way to check it works

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: Start in a worktree

    A separate checkout, so your main folder stays untouched.

    Add .claude/worktrees/ to .gitignore first. New worktrees start from your remote default branch, so they get the hook you pushed. A worktree is a fresh checkout: ask Claude to install dependencies.

    Terminal

    Run: claude --worktree my-feature

    What happens: Claude starts in .claude/worktrees/my-feature/, on a new branch worktree-my-feature.

    One command creates the worktree and starts Claude in it.

    Check it worked

    In another terminal, git worktree list shows the new worktree.

  2. Step 2 of 5: Plan the feature

    Nothing is edited until you approve.

    Start the prompt with /plan. Claude explores and writes a plan. Press Ctrl+G to edit it in your editor, then approve it.

    In Claude Code

    You type: /plan add <your feature>. Done means <how we check it>. List the files you will change and the tests you will add.

    What happens: Claude reads the code and writes a plan.

    Plan first, inside the worktree.

    Check it worked

    The plan names the files to change and the tests to add, and you approved it.

  3. Step 3 of 5: Build with tests on every reply

    Your Stop hook checks each reply.

    Approving the plan switches Claude to editing. Each time it finishes a reply, the hook runs your tests.

    In order:

    1. Claude

      Claude implements the plan

    2. Hook

      Stop hook runs the tests

    • If a test fails

      Claude fixes it

      The failures go back to Claude

    • If all pass

      Claude reports back

    The loop that keeps broken code out.

    Check it worked

    Claude’s last reply ends with the tests passing, and /hooks lists the Stop hook.

    If it didn’t work

    /hooks shows no Stop hook.

    The hook isn’t on the remote default branch, which new worktrees start from. Push it and start a new worktree.

  4. Step 4 of 5: Review before you commit

    `/code-review` checks the changes in a subagent.

    It reviews uncommitted changes in a background subagent with its own context. Ask Claude to fix the findings you agree with.

    In Claude Code

    You type: /code-review

    What happens: You can keep working while the review runs.

    A bug review of the change.

    Check it worked

    The findings arrive in your conversation, and the ones you accepted are fixed with the tests passing.

  5. Step 5 of 5: Commit and open the pull request

    Claude writes the message and opens the PR.
    In Claude Code

    You type: commit with a descriptive message and open a PR

    What happens: Claude commits, pushes the branch and uses gh to open the PR.

    The last prompt of the challenge.

    Check it worked

    The PR is open on GitHub with a clear description, and claude --from-pr <number> finds this session later.

Finish · 5 of 5 steps to go

You shipped a change end to end

That’s all 52 days. Use this loop on your next real change: worktree, plan, build with tests, review, pull request.

What you’ll have checked

  • Claude planned before it edited
  • The tests passed and the review findings were handled
  • The pull request is open

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.