Build an Autonomous Claude Code Agent
Claude Code can fix an issue; the hard part is letting it run while you work on something else. Most teams either watch every step or let it loose with no checks, then stop trusting it after one bad pull request. Live, I give Claude Code a real GitHub issue and run it headless in its own worktree, with hooks and tests, until it opens a pull request that passed them.
The lessons, in order
Each lesson is one idea from the live build, cut to a few minutes, with chapters and the full transcript.
- 1Out
A Software Factory Is Not a Dark Factory
A software factory automates what can be automated and sends only what needs a human to review. Bug fixes and dependency updates, light and dark factories, and why the process, not the agent, is what you automate.
- 2Out
Boundary and Context Are Yours
Every company has its own immunity, so every company sets its own boundary for what an agent may do. Then context: the product domain and the technical standards no model knows until you write them down.
- 3Out
Skills Stop the Agent Improvising
A frontier model can figure out your process eight times in ten, but it pays for the research on every run and ten engineers reinvent it ten ways. A skill turns your team's loop into the steps the agent follows.
- 4Out
Verify Outside the Agent
Most teams have execution covered and lack verification. The agent that read the issue will always say its code is verified. Holdout tests belong in the plan, and delivery needs pull requests small enough to review.
- 5Out
The Repo Carries the Harness
A small bill-splitting repo whose .claude directory holds the rules, a fix-issue skill, a reviewer subagent with its own context, hooks and a deny list. Everything the agent knows and may do is checked in for every teammate.
- 6Out
Run Claude Headless on an Issue
One script runs Claude headless with the fix-issue skill on GitHub issue 178, in its own worktree, and opens a pull request. Why a worktree per issue, and how the same run moves to CI or a sandbox.
- 7Out
Hooks Refuse Before the Run
Asked to delete the database and reset the branch, the agent tried both and a hook refused each one before it ran. Autonomous pull requests need gates you trust, the same way a support bot is grounded and evaluated on every release.
- 8Out
The Stop Hook Sends Work Back
The agent wrote a test and said done without running it. The stop hook ran the test, got red and handed the work back; the agent fixed the code, not the test, and only stopped on green. Then a draft pull request and a reviewer subagent.
- 9Out
What It Takes to Automate a PR
A startup with zero users can prompt and ship. A company with revenue needs rules, a skill playbook, hooks, verification gates and holdout tests, so the pull request reads like an executive summary an engineer can merge.
What the course covers
Engineers who want Claude Code to finish an issue while they work on something else.
- Run Claude Code headless on a real issue
- Turn a GitHub issue into a task it runs in its own worktree, without you.
- Gate its work with hooks and tests
- Block unsafe commands and fail the run before a bad change reaches review.
- Hand back a pull request worth reviewing
- Open the pull request only when every check passes; an engineer merges.
More free mini courses
Every Lightning session becomes one, in the order the Software Factory gets built.