Speak to an Expert

AI Engineering

Building a Real Product with Claude: Cowork as Architect, Claude Code as Builders

AI gets you to a demo by lunchtime and then slows to a crawl. Here is the structure that fixes it: Cowork as the architect, Claude Code as the builders, a repository that enforces its own rules, and ten-hour overnight runs that stay honest.

Nov 13, 2026 · 12 min read
Title card reading Building a real product with Claude, beside four roles: you the owner, Cowork the architect, Claude Code the builders, and work that is tested before it is pushed.

Ask an AI to build an app and you will have a demo by lunchtime. Ask it to build a product, with a database, sign-in, payments, tests, CI and security you would defend in front of an auditor, and something odd happens around week two. The pace drops. Screens appear that nobody designed. Tests pass for the wrong reasons. A decision you made last Tuesday quietly un-makes itself.

None of that is fixed by a cleverer prompt. It is fixed the same way a real building site is kept honest: clear roles, drawings everyone builds from, an inspector who checks the work, and a few rules nobody is allowed to bend. This is a field guide to setting that up with Claude, learned over several weeks of building a multi-tenant SaaS product, including letting it build unattended for ten hours at a time.

Think of it as a building site

A builder who also inspects their own work is marking their own homework. So the work is split across four roles, and the line between them is the whole point.

Diagram of the four roles: the owner makes decisions and approvals; Claude Cowork, the architect, reviews reports against the real repository and writes paste-ready prompts; Claude Code, the builder, plans and builds slices with a fresh sub-agent per slice; GitHub and CI on a self-hosted runner receive the pushes.

On the site

Who

Does

Never does

The client

You

Decides product, money, legal and security questions; edits owner-only files; merges

Types code

The architect

Claude Cowork

Reads the repo, checks the builder's claims, recommends one option per decision, writes paste-ready prompts

Builds the product

The crew

A Claude Code session per repository

Plans phases, builds slices test-first, commits, pushes, raises questions

Answers questions reserved for you

Specialists

Sub-agents

Build one slice each, or run a read-only review

Talk to you directly

One more site rule: infrastructure (cloud, DNS, servers) gets its own repository and its own Claude Code session. The crew building the house is not the crew wiring the substation.

What you need on day one

  • A Claude plan that includes Claude Code and Cowork. Long autonomous runs use real capacity, so check your usage limits before planning a 24×7 crew.

  • The Claude desktop app for Cowork, and Claude Code on your development machine.

  • Git and GitHub, a private repository per codebase.

  • A task runner such as just, so every check is one named command.

  • Docker, for databases and browser tests.

Set up the architect's office

Create a Cowork project for the product and put three things in it.

  1. The drawings. Vision and scope, the spec (one document per area: roles, domain model, each app, payments and tax, non-functional requirements, roadmap), brand and security notes, and a build map of every design screen to where and when it gets built.

  2. Standing instructions. How you like to work: "Review the builder's reports critically. Recommend one option per decision and say why. Write instructions I can paste as they are. Cost first. Security without over-engineering."

  3. Memory. Durable facts, said once: your region, your machine, that your everyday account is not an administrator.

When a decision changes the spec, update the project copy too. You and Claude should always be reading the same drawings.

Plan before you pour concrete

The single biggest lever on quality is a plan specific enough that the builder never has to guess.

The design is data, not decoration

Export your designs into design/ and never edit them there. Then let scripts hold the code to them:

  • Registries mirror the design. A conformance check fails when the code's list of settings, errors or messages drifts from the design's.

  • Sample data stays sample data. Designs are full of invented names, phone numbers and prices. A check fails if any of them reaches the product, or "Priya Raman" ends up in a production error message.

Phases made of small slices

Split the product into phases of one to three weeks, and every phase into slices: at most a day of work (usually 20 to 120 minutes for the builder), test-first, one commit each, and explicit about what they touch and need.

- [ ] 38c. **Remove a Location** (owner, 5 Nov)
  - Route: `DELETE /v1/locations/{id}` → 204, permission `settings.business`.
  - Refused: the main Location, and any Location something refers to.
  - Test first: the route on a Location in use answers the refusal;
    a Location nothing refers to is removed.
  - Proves: security.md §2, "a club can only change its own rows".
  - Needs: Q156.

Questions are first-class citizens

Whenever the builder meets something the plan, spec or design does not settle, it writes a numbered question with options and a recommendation, and you answer underneath, dated.

- [ ] Q156. **A Location's own audit rows stop it being deleted** (raised by 38c; blocks 38c)
  - (a) Recommended: removal is a status, `removed`; the row and its audit rows stay.
  - (b) A real delete; the Location's audit rows stop naming it.
  - (c) Relax the audit log's foreign key. Weakens a security control.
  → answer (owner, 5 Nov): (a)

One phase raised over a hundred questions. That sounds like a lot, until you count the hundred wrong guesses it prevented.

Teach the repository to run the site

Claude Code reads a handful of files at the start of every session. Together they are the site's rulebook, and they are what lets slice forty be built as carefully as slice one.

File

Its job on site

CLAUDE.md

The rules: what the product is, the stack and what is forbidden, module boundaries, security rules, the definition of done, what Claude must never do

.claude/commands/

Repeatable workflows you trigger: /plan, /build, /review, /fix

.claude/skills/

Know-how Claude picks up by itself when the work matches: add a migration, add an endpoint, fix a bug

.claude/settings.json

Permissions, hooks and the sandbox: the parts of the rulebook that enforce themselves

justfile

One command per check, so "it passed" always means the same thing

Skills: write one the second time you explain something

A skill is a folder with a SKILL.md, and its short description tells Claude when to use it, including halfway through a slice. That is why rules belong in skills rather than in commands you have to remember to run.

---
name: add-migration
description: Add a database migration. Use whenever a slice changes a table,
  an index, a constraint or a role grant.
---

1. Additive only within a release: add, backfill in a job, drop in a later release.
2. A new stored value ships readable by every process one deploy before any code writes it.
3. Every tenant table: an organisation column, row-level security forced, an isolation test.
4. Regenerate the offline query data, then run `just check`.

Hooks and the sandbox: two locks, not one

A hook runs your script before a tool call, and exit code 2 blocks it. Ours refuses edits to secret-looking files, generated files, accepted ADRs and owner-only files:

{
  "hooks": {
    "PreToolUse": [
      { "matcher": "Edit|Write|MultiEdit|NotebookEdit",
        "hooks": [{ "type": "command", "command": "bash .claude/hooks/protect-paths.sh" }] }
    ]
  },
  "sandbox": {
    "enabled": true,
    "filesystem": {
      "denyRead":  ["~/.config/yourapp", "~/.aws", "~/.ssh", "~/.config/gh"],
      "denyWrite": ["./.claude", "./docs/adr", "./docs/security.md", "./.githooks"]
    }
  }
}

The anti-hallucination playbook

Hallucination on a build site is rarely a wild invention. It is small, plausible gap-filling: a placeholder text that ships, a field the design never had, a vendor parameter that does not exist, a "done" that was never run. Eleven rules close those gaps.

  1. "Never invent" is a stop. Missing from the design, plan or spec? Raise a question, however obvious the fill looks.

  2. Some questions are always yours: anything that weakens a check or security control, changes an accepted ADR, touches money, tax, pricing, legal text or consent, adds a vendor, or that the builder is unsure about.

  3. Vendors come from official docs, read that day, in a docs/vendors/<name>.md page. Code follows the page, never memory.

  4. Evidence, not adjectives. "1025 passed, exit 0, CI run 412", never "all tests pass".

  5. The test fails first. A test that has never failed proves nothing.

  6. Never weaken a test. No raised limits, retries or skips to reach green.

  7. Every decision made without you goes in the done log. You cannot overrule what you cannot see.

  8. Review the repository, not the report. Our reviewer once found a "fix" that had only edited the plan.

  9. Fresh eyes for big reviews: read-only sub-agents, one per area, with no stake in the code.

  10. Sample data never enters code.

  11. Owner-only means owner-only. The builder writes the exact old and new text; you apply it with a script that checks the anchor first.

A day on site

  1. Start with /build <phase>. The builder takes the next slice, writes the failing test, builds, runs the definition of done, commits and reports.

  2. The report is six lines: what changed, evidence, time taken, what is next, open questions, risks. Plus every decision made without you.

  3. Paste it into Cowork. The architect reads the repository, checks the claims, and hands back a view on each decision, one paste-ready prompt for the builder, and any commands or errands that are yours.

  4. Paste the prompt into the builder's main window (not a sub-agent's box, which is easy to type into by mistake). Repeat.

Here is how Anthropic's own team approaches Claude Code, which pairs well with this loop:

Autopilot, and the ten-hour night shift

A fresh specialist for every slice

The /build command ends each slice by starting the next one itself, in a fresh sub-agent that sees only the rules, the plan and that one slice. The main session's context grows only by six-line reports, which is why a long run stays sharp to the end. Simple questions are answered on the builder's own recommendation, marked "autopilot, owner to review"; the ones reserved for you still stop.

The night shift

For an unattended night you paste a prompt that replaces "stop and ask me" for that night only. Everything else stays: test-first, the definition of done, the skills, the bug process.

Night-shift rule

Why it exists

A fixed end time, and "don't stop before it"

Early runs ended three or four hours early, on a hang or an empty queue

A fallback queue of useful work

So running out of buildable slices is never a reason to stop

Questions go to a file, not to you

The item waits; the builder moves to the next one that does not depend on it

Red after one real fix? Park it on a local wip/ branch

One stubborn slice never costs the whole night

One heavy job at a time, no unstoppable background processes

A sub-agent once left 18 CPU-burning processes its sandbox could not kill

Only one reason to stop completely

A suspicion that one customer's data could reach another's

A report before the end time

You wake up to evidence, decisions and a short list of questions

# Prepare the machine before you leave
caffeinate -dims -t 39600    # keep a Mac awake for 11 hours (plug in the charger)
# restart Docker fresh, stop your own dev servers, answer every open question

A tiny time log (just slice-start / just slice-end, idle gaps subtracted, the script owner-only) answers the question every plan needs: how long does a slice really take?

Bugs that never come back

Every bug gets its own file in bugs/, and every bug answers two questions: why did the code do this, and why did nothing catch it. The fix answers the first. A class guard answers the second.

  1. Record it in its own file.

  2. Reproduce first, at the layer where it lives and through the path where it was seen.

  3. Write down the cause and why it was missed.

  4. Fix the cause with the smallest change.

  5. Close the gap for the whole class: a type, a lint, a contract test, a startup check.

  6. Name the regression test after the bug, and fail the build if it is deleted or skipped.

Security and data bugs, anything that turns a check red, and bugs in the slice at hand are fixed at once. Everything else is recorded and fixed after the phase's last slice, so feature work stays fast and the phase still ends clean.

Testing without slowing down

We once ran about 2,600 browser tests on every slice, across every device size, three locales and dark mode. Each slice took an extra 33 to 40 minutes, mostly re-checking screens it never touched. The fix was to match each test to the moment it is useful:

When

What runs

Time

Every slice

just check plus the slice's own browser specs on one laptop and one phone

10 to 20 min

Each push batch, nightly, phase end

The full browser suite

about 45 min, while nobody waits

Before a merge

CI's full tier

as configured

Flaky tests are bugs, not bad luck. Wait on a state, never on a timer. And replace "finishes within 50 ms" with a check of scaling ("twice the input takes about twice the time") that a busy machine cannot break.

The machine, CI and the guardrails

  • One command runs everything locally (just dev), with sign-in codes routed to a local test inbox, guarded three ways so that path can never ship.

  • CI on your own hardware saves the minutes a busy private repository burns. Run it ephemeral and isolated; our guide to self-hosted GitHub Actions runners walks through it step by step.

  • Measure before you tune. Docker kept hanging; the data showed Docker had plenty of memory and the Mac did not, with a load average of 317 from 10 test processes and 5 browsers on 10 cores. Capping parallelism fixed it, and just check settled at about 12 minutes.

  • Secrets live where the sandbox hides them, so the builder can run the app but never read the keys.

  • Production is unreachable from development, and build machines get no route there at all.

  • Every security control is written down with the test that proves it, and isolation is tested continuously, including a production canary that tries to read across tenants.

Mistakes we made, so you can skip them

Mistake

What happened

The fix

Hooks as the only guard

A builder changed an accepted ADR with sed

Owner-only paths in the sandbox's denyWrite too

Superuser in development

Row-level security silently off locally

A startup check refuses any role that can bypass it

Smoke test through the API only

Sign-up worked via the API, failed in the browser

A browser test against the real server

Full browser suite every slice

30 to 40 minutes per slice re-testing untouched screens

Slice-level specs; full suite nightly

Unmeasured speed "fixes"

A whole night on settings that changed nothing

Measure first

Overnight runs stopping early

Ended hours early on a hang or an empty queue

Fallback queue, fixed end time, work around

Design sample names in code

Invented people in real strings

A check that fails on any sample value

Squash merges

Bug files pointed at commits that no longer existed

Merge commits

Trusting a report

A "fix" existed only in the plan

The reviewer reads the repository

Templates to steal

A CLAUDE.md skeleton

# <Product>: rules for Claude

## 1. What this is
<five lines>

## 2. Stack and hard rules
- Money is {minor, currency}; never a float.
- No personal data in logs (allow-list in <file>).

## 4. Security
- Every tenant table: organisation id, row-level security forced, isolation test.
- The app's database role never bypasses row-level security (startup check).

## 5. Process
- Test first: show the failing output before the fix.
- One commit per slice; stage by path, never `git add -A`.
- Never invent a screen, field, text or flow: raise a question.
- Never weaken a test (no raised limits, retries or skips).

## 9. Definition of done
- `just check`: exit 0.
- `just e2e-slice` for any change to the web apps, sign-in, codes or sessions.

The overnight prompt

Overnight mode for 10 hours from now. Work the whole 10 hours. Don't stop early:
if something blocks an item, record it and move on to the next item or the
fallback queue.

Order: <slices and bugs, in order>.
Fallback queue: <useful work that needs no decisions>.

1. Questions that stop for me: write them with options and a recommendation,
   mark the item waiting, continue. Never invent a screen, field, text or flow.
2. Owner-only files: exact old and new text with anchors in the questions file.
3. Still red after one real fix, or a security doubt: park on a local wip/<item>
   branch, clean the tree, continue.
4. One heavy job at a time, sub-agents included.
5. Stop completely only if one customer's data could reach another's.
6. Twenty minutes before the end, start nothing new. Write the report: done
   (with minutes), decisions made without me, questions waiting, wip branches,
   bugs, CI results, and exactly what I must do next.

Applying an owner-only edit safely

cd ~/code/myproduct && python3 - <<'EOF' && git commit -m "Owner edit: <what>" -- docs/security.md
from pathlib import Path
p = Path("docs/security.md"); s = p.read_text()
old = "<exact old text>"
new = "<exact new text>"
assert s.count(old) == 1, "anchor not found exactly once; nothing changed"
p.write_text(s.replace(old, new)); print("updated", p)
EOF

git commit -- <paths> commits only those paths, even if the builder has other changes staged at that moment.


Claude can build a serious product, and it does its best work inside a structure: drawings precise enough that it never has to guess, a rulebook the repository enforces by itself, an architect who checks the work against the code, and you, making the calls that are yours to make. Set that up once, and you can hand over a phase in the evening and wake up to reviewed, tested, committed work, plus a short list of questions only you can answer.

Planning an AI-first build of your own and want a team that already works this way? Talk to us at Techpuvi.

Niranjana serves as a Senior Architect at Techpuvi. She brings more than 15 years of experience in software development, having built several products from the ground up. Choosing to specialize as a full-stack engineer, she maintains a strong commitment to continuous learning.