// delegation infrastructure

3P

Third-party delegation. Routes the mechanical work — find/replace migrations, dead code deletion, boilerplate generation — to a cheaper executor like Codex CLI or a local LLM, so Claude tokens stay reserved for the work that actually needs a brain.

// for laypeople

I was hitting the Claude weekly limit every single week. Most of what was burning tokens wasn't interesting — it was grunt work. Migrating a thousand inline styles to a design system. Renaming an import path across forty files. Deleting an orphaned component nobody uses anymore. Claude is wildly overqualified for this and it costs real money to keep using it on stuff a junior model can do for free.

3P is the dispatcher. When Claude spots a task that fits the profile — high-volume, low-judgment, mechanical — it tells me, writes a precise prompt for a cheaper executor, runs it, and verifies the result. The default executor is Codex CLI (free with the OpenAI subscription I already pay for). The next tier down is a local LLM running on the Mac Studio (free, no API). Claude only steps in if the verification fails or the work needed judgment after all.

What this buys me is week-to-week sustainability. Claude gets reserved for architecture, hard debugging, security, anything where being wrong is expensive. The grunt work goes to a model that's perfectly good at grunt work and doesn't tap the same wallet. The output gets checked the same way either way — does the build pass, does the diff look sane, did anything change that shouldn't have.

// for builders

Trigger: /3p <task>, or Claude self-triggers when a task matches the profile (mechanical, high-volume, no architectural choices, no business logic, no credentials). Executor priority is Codex CLI → local LLM via Ollama → Claude Haiku for non-code classification. Selection is a runtime probe — which codex, curl localhost:11434/api/tags — not a config flag, so it degrades cleanly when an executor is unavailable.

Every dispatched prompt is structured the same way: exact file path(s), the transformation to perform, a token/mapping table where applicable, a list of what to keep as-is (dynamic values, computed styles, library props), a list of what not to touch (logic, fetches, state), and a verification command (npm run build by default). The constraint isn't that Codex is dumb — it's that Codex without rails will quietly rewrite your data fetching while it's "cleaning up." The prompt is a fence, not a hint.

Verification is non-negotiable. After every dispatch: build passes, diff shows only expected files, spot-check confirms no logic/state/fetch drift, target metric improved (inline style count down, dead imports gone, whatever the task was). Failures fall back to Claude, or a git checkout if the prompt was too loose. Batches run sequentially, never parallel — file conflicts are the silent killer. One commit per batch. The skill is at /resources/skills/3p.