The architecture of a Claude Code consulting workflow is four files, committed before any feature work.

Most pages on this topic describe an abstract phase model (audit, strategy, implementation, optimization) and stop. That is a billing structure, not an architecture. The architecture is what is in the repo at any given moment: a writers manifest, a locked plan, a disk-backed scratch folder for facts that must survive compaction, and a settings file that defines the tool contract. Each maps to a published price tier on this site.

M
Matthew Diakonov
9 min read

Direct answer, verified 2026-05-01 against code.claude.com/docs/en/common-workflows

Four files. One PR. Before anything else.

A real Claude Code consulting engagement does not begin with a feature ticket. It begins with a single PR that adds four files to the client repo:

  1. CLAUDE.md. The writers manifest. Every entity (human, agent, hook, cron) that can mutate this repo, with the rules each one follows. The agent reads this on every session start.
  2. plan/<engagement-id>.md. The locked plan for this engagement: scoped deliverables, the named systems, the price tier, and the explicit out-of-scope list.
  3. scratch/<engagement-id>/. Disk-backed notes for load-bearing facts (row counts, ticket shapes, config diffs) that must survive compaction and a session restart.
  4. .claude/settings.json. Tool permissions, pre-commit hooks, allowed models. Committed with the rest, so every parallel session sees the same contract.

The phase model still applies (consult, scope, build, hand off), but it runs on top of these files, not instead of them. Without the four files, parallel agents race on stale state and a single teammate pushing to main can break a long task. With them, the workflow survives multi-writer reality.

What ends up in the client repo

A scoping PR for a typical SMB engagement (a single repo, one founder writing, a pre-commit formatter, an auto-commit cron) lands in this shape. The src/ tree is the existing client code, untouched. The four new top-level entries are the architecture.

client-repo/ (scoping PR landed)

Engagement IDs follow the pattern <year>-<month>-eng-<n> so a single client with multiple engagements has a separate plan and scratch space per engagement. plan/ and scratch/ are committed; this is a feature, not a leak. The next session in the next engagement should be able to read why the earlier engagement made the calls it made.

File 1: CLAUDE.md as a writers manifest, not a code-conventions doc

The most common self-rolled CLAUDE.md is 80 percent “here is what the codebase is” and 20 percent everything else. That ratio is backward. The codebase part the agent figures out from reading files. The part the agent cannot infer is who else is allowed to write, when, and what those writes look like.

Below is a stripped CLAUDE.md from a recent SMB engagement. Five sections, in this order: writers, tool contract, plan-pin policy, commit policy, escalation. Code conventions are intentionally absent; those live in the existing src/ files where the agent will find them naturally. The whole file is under 200 lines.

CLAUDE.md (excerpt)

Section 1 is the load-bearing one. The agent cannot infer that an auto-commit cron is going to push every 60 seconds, or that the founder edits files in a separate editor while a Claude session is running. If those facts are not in CLAUDE.md, every session re-discovers them as surprises. With them in writing, every session starts already knowing.

Files 2 and 3: plan/ and scratch/, the parts compaction cannot eat

On Claude Code, conversation history is summarized into a <summary> block when input tokens approach the window. That is fine for transcript shape, lossy for facts that lived only inside a tool output 40 turns ago. plan/ and scratch/ are the disk-backed mirror.

plan/<id>.md is the scope, locked at consult time. It carries the named deliverables, the price tier this engagement maps to (one of the published tiers on c0nsl.com), the hours-saved estimate I quoted on the call, and the explicit out-of-scope list. The agent refers to it instead of re-deriving scope from a 400-turn transcript. A plan-mode resume three days later starts by reading the plan, not by asking the founder what we agreed on.

scratch/<id>/ is for everything else that has to survive a compaction. When I read the support-ticket schema out of the Shopify admin, the row count of the orders table, the actual shape of the pricing tiers in JSON, those land in scratch/<id>/<topic>.md as soon as I read them. The pattern is mechanical: every load-bearing fact gets pinned within the same turn it was first observed. The durable copy is then safe through compaction, session restart, and handoff to a parallel agent.

File 4: .claude/settings.json, committed not local

The default move with settings.json is to keep it on your laptop. For a consulting engagement that is wrong. If I ship the work and the founder opens Claude Code in the same repo three months later without my settings.json, they get default permissions, no hooks, and the contract I priced for stops firing. Every parallel agent and every teammate session also needs the same contract, so the file lives in the repo.

.claude/settings.json

Two pieces are doing real work here. The deny list under permissions blocks the irreversible operations that cause the worst incidents (force-push, hard-reset, recursive rm). The PreToolUse hook on Edit and Write runs a tiny node script that confirms the file the agent is about to write to has a corresponding entry in plan/<id>.md; if it does not, the edit is paused and the agent is told to update the plan first. That is the difference between a session that quietly drifts off-scope and one that cannot.

Self-rolled vs. scoped: what the four files actually change

Two CLAUDE.md files from the same week, both for SMB founders using Claude Code on their own repos. The left is what the founder wrote before we worked together. The right is what we landed after the scoping engagement. The right is shorter and the agent behavior on top of it is more predictable.

Same repo, two CLAUDE.md files

# CLAUDE.md

## About this codebase
Next.js 15 app, App Router. Uses Drizzle ORM
on top of Postgres. Tailwind 4. shadcn/ui.

## Conventions
- Use server components when possible
- Use Tailwind utility classes only
- Don't use any
- Prefer named exports
- Components go in src/components
- API routes go in src/app/api
- Use zod for schema validation
- Tests go in __tests__ next to source
- Don't use console.log in committed code
- Use useEffect sparingly
- Don't use class components
- Use proper TypeScript types
- Don't ship secrets in client code
- Use env vars for config
- Don't push to main directly

## Style
- Two-space indent
- Single quotes for strings
- Trailing commas in arrays/objects
- Semi colons
- Prettier on save

## Workflow
- Run npm test before committing
- Open a PR for everything
21% fewer lines

The left has 22 lines of code conventions and 0 lines of writer information. The right has 0 lines of code conventions (those live in the source files) and 5 lines of explicit writer information, plus four sections of contract. The agent on the right does not re-discover the auto-commit cron every session as a surprise. It also does not amend pushed commits, because that line is in writing.

How a four-file engagement actually runs

The phase model still exists. It just runs on top of the architecture, not instead of it. Below is the public flow for a small-integration tier engagement, from the moment a founder books the consult to the handoff PR.

From booked consult to shipped architecture

  1. 1

    Consult

    30 or 60 minutes, $75 published rate. I read the existing repo (or a shared diff), name three concrete automations ranked by hours saved per week, and identify which of the four files are missing or wrong. The output is a fixed-scope quote inside 48 hours mapped to one of the published tiers.

  2. 2

    Scoping PR

    I open a PR that adds the four files: CLAUDE.md, plan/<id>.md, scratch/<id>/ (empty seed), and .claude/settings.json. The founder reviews and merges. No feature work yet. The architecture lands first so every later session is already inside it.

  3. 3

    Build

    I implement the named automations, with the agent reading CLAUDE.md and plan/<id>.md on session start, pinning load-bearing facts to scratch/, and respecting the deny list. Parallel sessions and the auto-commit cron behave because they share the same contract.

  4. 4

    Handoff

    Final PR, 30-minute walkthrough, and a short loom on how to extend CLAUDE.md when a new writer (a new agent, a new cron, a new teammate) appears. The architecture stays in the repo. The founder does not need me back unless the writer set changes.

Agency-shaped engagement vs. single-engineer engagement

The agency-shaped four-phase template (audit, strategy, implementation, optimization) is what most pages on this topic describe. It is the right shape for a fifteen-person team selling into a Fortune 500 procurement process. It is the wrong shape for a five-person SMB on a $500 to $10K budget who needs the agent to stop shipping bad commits next Tuesday. Side by side:

FeatureAgency, four phasesSingle engineer, four files
First deliverableAudit deckScoping PR with CLAUDE.md, plan, scratch, settings
Pricing visibilityQuote on requestPublished on the homepage, $75 to $10K+
Who writes the codeA team you have not metThe same engineer who took the consult
Handles parallel agents on same repoNot addressedYes, settings.json + CLAUDE.md make the contract uniform
Handles auto-commit cron / formatter on saveNot addressedYes, named in the writers manifest
Survives a session restartDepends on the deckYes, plan + scratch are disk-backed
Course or program upsellFrequentlyNone
Time to first feature shippedWeeksDays

Where the architecture is overkill

One-person hobby repo with no other writers, no formatter, no cron, no parallel sessions: you do not need this. The Edit tool's Read-before-Edit contract is enough on its own, and a five-line CLAUDE.md telling the agent the project is in TypeScript will cover the gap. The four-file architecture earns its weight the moment a second writer appears, which on a real client repo is day one.

It is also overkill if you only run Claude Code in short, supervised bursts. If your sessions are 10 minutes long and you watch every tool call, compaction is not a problem and scratch/ is overhead. For sessions that run for an hour or more, or that pass through a /compact, scratch/ pays for itself the first time the agent reaches for a fact that compaction would have summarized away.

What a c0nsl engagement looks like, by tier

Mapped to the published rates on c0nsl.com:

  • $75 consult. 30 or 60 minutes. I read the existing repo, identify which of the four files are missing or wrong, and quote a fixed scope. You leave with three named automations and an hours-saved estimate written down. Refunded if I cannot.
  • $500 to $2K small integration. The four files installed and tuned for one repo, with one to three named automations implemented on top. Typical timeline is half a day to three days, depending on how many writers the repo already has.
  • $2K to $10K+ custom system. Multi-repo rollout, the same architecture committed to every repo in the client's stack, plus the cross-repo conventions that let a single agent move between them safely. Includes the custom hooks (the plan-pin enforcer, the writer-manifest auditor) and the eval harness that exercises the multi-writer cases.
  • $1K to $5K mo retainer. I keep the architecture current as the model evolves and as new writers appear (a new agent, a new cron, a new teammate). The retainer is for clients running the architecture across enough repos that maintaining it is itself a part-time job.

The pricing is on the page, not on a sales call. If your repo and your writer set tell me the engagement should sit at a different tier than where you started, I tell you on the consult, in writing, with a refund of the $75 if my read on the scope is wrong.

Audit your repo against the four-file architecture

Bring your existing CLAUDE.md, the names of every writer to the repo, and one task where Claude Code shipped something you did not intend. I come back with the missing files, the rewritten contract, and a fixed-scope quote against the published tiers.

Frequently asked questions

What is the actual architecture of a Claude Code consulting workflow?

Four files committed in a single scoping PR before any feature work starts: CLAUDE.md (the multi-writer contract that names every entity allowed to write to the repo, including humans, parallel agents, formatters, and cron jobs), plan/<engagement-id>.md (the locked plan a session can refer back to instead of re-derive), scratch/<engagement-id>/ (load-bearing facts pinned to disk so they survive compaction), and .claude/settings.json (tool permissions, pre-commit hooks, allowed model list). Every Claude Code session that runs against the repo reads CLAUDE.md on start, so the architecture is already in the agent's context the moment a session opens. The pattern is borrowed from how the platform itself uses CLAUDE.md and from how Anthropic teams scope agentic work.

Why four files and not the four phases (audit, strategy, implementation, optimization) every other guide describes?

Because the agency phase model is a billing structure, not an architecture. It tells you when invoices go out. It does not tell you what is in the repo at any given moment, what the agent is allowed to do, or who else is writing. A single accountable engineer running Claude Code on a real client repo needs an architecture that survives parallel sessions, a teammate pushing to main mid-task, a formatter rewriting bytes on save, and a background cron auto-committing. The four files are the contract that handles those cases. Phases happen on top of the architecture; they do not replace it.

What goes into CLAUDE.md for a consulting engagement?

Five sections: writers (every entity that can mutate the repo, with the windows in which they are active), tool contract (Read-before-Edit is non-negotiable; the rules for re-Reading after a build, a pause, or a teammate push), plan-pin policy (load-bearing facts must be written to scratch/ before compaction, never trusted to a tool output 30 turns ago), commit policy (when to add specific files vs. -A, when to defer to the auto-commit agent, what never to amend), and escalation (the named workflow rules that trigger a human review, including the emotional 20 percent of customer support that must hard-route off the agent). The file is short, fewer than 200 lines is typical, and the agent reads it on every session start.

What goes in the plan/ folder?

One markdown file per engagement, named with the engagement ID. The plan locks the scoped deliverables, the named systems, the hours-saved estimate I quoted on the consult, the price tier this engagement maps to, and the explicit out-of-scope list. The agent refers to plan/<id>.md instead of re-deriving scope from a long conversation history, which means a plan-mode resume after a few days does not start by re-asking what we agreed. The plan is also the authoritative source the auto-commit agent reads to decide whether a diff is on-scope.

Why does scratch/ matter? Is it not the same as just longer context?

Longer context (1M-token windows on Sonnet 4.6) helps but does not fix the load-bearing-fact problem. If a fact you need lives only inside a tool output you read 40 turns ago (a directory listing, a database row count, a config diff), the compaction summary may compress it to nothing. Scratch is the disk-backed mirror of those facts. I write the row count, the listing, the diff into scratch/<id>/<topic>.md as soon as I read it. The durable copy survives compaction, survives a session restart, and is committed with the rest of the engagement so a different agent in a different session can pick up exactly where the last one left off.

Why do you commit .claude/settings.json into the engagement repo and not just keep it local?

Two reasons. First, settings.json is where tool permissions and pre-commit hooks live; if I ship the engagement and the client opens Claude Code three months later without my settings.json, they get default permissions and no hooks, and the workflow rules I priced for stop firing. Second, when a parallel agent or a teammate runs Claude Code in the same repo, the committed settings.json gives every session the same tool contract instead of one that depends on whose laptop is on. The committed file is reviewed exactly like any other source file. It is not secrets; secrets stay in the keychain.

How does this map to the published price tiers on c0nsl.com?

The $75 consult buys the scoping pass: I read the existing repo, identify which of the four files are missing or wrong, and quote a fixed scope. The $500 to $2,000 small-integration tier is typical for a CLAUDE.md rewrite plus the plan file plus the scratch convention on a single repo. The $2,000 to $10,000+ custom-system tier is what a multi-repo rollout costs (the same four files committed to every repo in a client's stack, plus the cross-repo conventions that let a single agent move between them safely). The $1,000 to $5,000 monthly retainer is for clients who want me to maintain the architecture as the model evolves and as new writers (new agents, new cron jobs) appear.

What is the most common mistake teams make when they architect this themselves?

They write a CLAUDE.md that lists what the codebase is and what the conventions are, but does not enumerate the writers. The codebase part the agent figures out from reading files. The writers part the agent cannot infer; if a teammate pushed to main while you were drafting an Edit, no amount of file-reading reveals that. CLAUDE.md is most valuable as a writers manifest, second-most valuable as a tool-contract sheet, and least valuable as a code-conventions document. Most self-rolled CLAUDE.md files are flipped: 80 percent code conventions, 20 percent everything else.

Does this architecture work with subagents and parallel task execution?

It is built for it. Each subagent gets the same CLAUDE.md on start, so the writer manifest and tool contract are uniform across the orchestrator and its children. The plan file is the shared source of truth a parent and its subagents can both reference without re-deriving scope. The scratch/ folder is the only place subagents are allowed to leave durable notes for each other. settings.json controls which tools each subagent type can call. With those four files in place, a six-agent fan-out on the same repo behaves; without them, the agents race on stale state and ship bad commits.

How long does it take to install this architecture into an existing client repo?

On a single repo with a clean main branch and one writer (the founder using Claude Code), about half a day. On a multi-repo SMB stack with a teammate pushing, a formatter on save, and an auto-commit cron, about two to three days, most of it spent watching the writer behavior and writing it down accurately. The published $500 to $2,000 small-integration tier is sized for that. I do not bill hourly, I bill the tier, and the deliverable is the four files in a PR plus a 30-minute walkthrough.