DEV Community

Robort Gabriel
Robort Gabriel

Posted on • Originally published at coding180.com

I Built a 4-Agent Claude Code Pipeline That Ships Code While I Sleep

I Built a 4-Agent Claude Code Pipeline That Ships Code While I Sleep

You type one command before bed. By morning: a written spec, the actual code, tests that already ran, and a SHIP, NEEDS WORK, or BLOCK verdict waiting for you. That's the whole idea behind a Claude Code agent pipeline, and once it's running it changes how you think about using AI to write software.

The Loop Most People Get Stuck In

You ask Claude to plan, it plans. You ask it to write the code, it writes the code. You ask it to test, it tests. Somewhere in there you're still the one carrying context from step to step, still the one deciding what happens next. The moment you stop typing, the whole thing stops moving. That's not a prompting problem, it's an architecture problem. The fix is four specialist agents that hand off to each other automatically, triggered by one command.

The Handoff: A Shared Folder, Not a Shared Context Window

The part that makes this actually reliable is simple. Each agent writes its output to a file in a .pipeline/ folder, and the next agent reads that file to pick up exactly where the last one stopped.

.pipeline/spec.md          <- Planner writes
.pipeline/changes.md       <- Coder writes
.pipeline/test-results.md  <- Tester writes
.pipeline/review.md        <- Reviewer writes
Enter fullscreen mode Exit fullscreen mode

One folder, four files. If something breaks, you open any one of them and see exactly what that agent had to work with.

The Four Agents

Each one is a Claude Code subagent: a narrow job, its own isolated context, one output.

Planner never writes code. It reads the codebase, understands how things are actually built, and writes a spec: which files change, what functions are needed, edge cases, open questions.

Coder reads that spec and builds exactly what it says, following the patterns already in the codebase. Keeping it scoped this tightly is what stops the "helpful" scope creep where an agent quietly rewrites things you never asked it to touch.

Tester reads what the Coder built and writes tests for the normal case, the edge cases the Planner flagged, and at least one failure case, then actually runs them. If something fails, it stops and reports rather than trying to patch the code itself.

Reviewer is the final gate. It reads the spec, the changes, and the test results, runs a diff, and gives one of three verdicts: SHIP, NEEDS WORK, or BLOCK. It's read-only by design. It can flag a problem but not fix it, which keeps one agent from writing code and grading its own homework.

Wiring It to One Command

Wrap all four in an orchestrator, saved as a project skill (.claude/skills/ship/SKILL.md). Then type:

/ship add rate limiting to the login endpoint
Enter fullscreen mode Exit fullscreen mode

The orchestrator sends your request to the Planner, waits for the spec, passes it to the Coder, waits for the code, passes it to the Tester, waits for results, passes everything to the Reviewer, and shows you the final verdict. One line in, four agents run in sequence, one full feature out. It's the same pattern Anthropic describes for chaining subagents in sequence: specialized workers, each with their own context, tied together by an orchestrating instruction set.

What Actually Changes

The shift here isn't "AI writes code faster." It's that you stop being the one who manually connects plan to code to test to review. You become the person who reviews finished work and decides what ships. The first time /ship handed me back a tested feature with a clear verdict waiting for me, it changed how I scheduled my day. I stopped blocking time to babysit the AI and started blocking time to review what already got done.

Try It Yourself

I wrote up the full walkthrough with all five files ready to go, the ship.md orchestrator plus the four agent configs, drop-in for .claude/skills/ and .claude/agents/: How to Build a 4-Agent Claude Code Pipeline That Ships While You Sleep. Grab the free kit there, adjust the paths and constraints to match your own repo, and you'll have your own /ship command running in about ten minutes.

Top comments (0)