Use Cases: primary-side delegation directive (CLAUDE.md snippet) — delegate when bridge env is set

Dai Ha
2026-07-19 07:30:04 +02:00
parent bcf15a85c9
commit 5f48e3e674
+50
@@ -171,6 +171,56 @@ stays warm across follow-ups, and recyclable so it never outgrows its context wi
Policy knobs in `bridged.yaml`: `idle_ttl`, `context_cap`, `max_workers_per_profile`.
## Primary-side directive — *when* to delegate (a `CLAUDE.md` snippet)
Mechanism 4 gives the **worker** a `CLAUDE.md` snippet so it knows how to answer. The **primary**
needs the mirror image: a standing reminder to *reach for the bridge in the first place* instead of
spending subscription tokens on work a cheaper worker could do. The trigger is an environment signal
— the `bridged` MCP tools being connected (e.g. a `BRIDGED_MCP_URL` marker in the primary's env).
When that property is set, this instance is a **bridge primary** and should delegate by default.
The decision the directive encodes:
```mermaid
flowchart TD
T["a task arrives"] --> Q{"bridge available?<br/>(BRIDGED_MCP_URL set /<br/>bridged MCP connected)"}
Q -->|"no"| SELF["do it on the primary"]
Q -->|"yes"| J{"needs YOUR judgment,<br/>or bulk / mechanical / parallel?"}
J -->|"judgment / interactive"| SELF
J -->|"bulk / mechanical / parallel"| DEL["bridge_send → worker"]
classDef self fill:#2f855a,stroke:#22543d,color:#ffffff;
classDef del fill:#2b6cb0,stroke:#1a365d,color:#ffffff;
class SELF self
class DEL del
```
*Figure: an env property (bridge available) flips the default from "do it myself" to "delegate unless
it needs my judgment."*
Suggested snippet to drop into the primary's `CLAUDE.md`:
```markdown
## Delegating off-subscription work (claude-bridge)
If the `bridged` MCP tools are connected (env marker `BRIDGED_MCP_URL` is set), you are a **bridge
primary** on a metered subscription. Default to pushing work that does not need your own judgment to
a cheaper worker instead of spending subscription tokens on it:
- **Delegate** bulk, mechanical, or parallelizable work — test writing, log triage, wide-area or
per-file reviews, codegen/refactors behind a clear spec — with
`bridge_send(to: <role@profile>, kind: <verb.noun>, body: {...})`. Fan several out and reduce.
- **Keep on the primary** the conversation with the user, final judgment, merge/commit decisions,
and anything that needs your on-subscription model's reasoning.
- **Never set `ANTHROPIC_BASE_URL` yourself.** Routing to an off-subscription model is the worker's
job (its ccs profile carries it); you stay env-clean — that boundary is the whole point of the bridge.
Rule of thumb: if you could hand the task to a junior with a written brief, `bridge_send` it.
```
This is a *suggestion*, not wiring: `bridged` never edits the primary's `CLAUDE.md` (that would cross
the subscription boundary in the wrong direction). The operator pastes it; the env property is what
makes the reminder fire only in sessions where a bridge actually exists.
## More use cases (catalogue)
Same machinery, different `kind`/lifecycle: