gildeshiro/piebald-dynamic-subagents

5 stars · Last commit 2026-09-17

Per-subagent provider/model/profile routing for Piebald via a PreToolUse [[pbroute]] hook (Claude Code model:-per-subagent parity)

README preview

# piebald-dynamic-subagents

**Heterogeneous** native subagents for **Piebald**: give each native subagent a
**different brain** (provider + model) and its **own profile** (reasoning +
system prompt) at launch time — something Claude Code does via the subagent's
`model:` frontmatter field, but which Piebald does not expose natively.

Piebald routes **all** subagents to the same default provider/model/profile.
There is no "this subagent uses Opus, that one uses Gemini, the other uses Haiku"
field. This project adds per-subagent routing without forking Piebald: a **`PreToolUse`
hook** reads a routing directive from the subagent's prompt and writes the route into
`app.db` **just-in-time**, before the subagent is created.

> Replicates the `model:`/per-subagent-persona feature of Claude Code within the
> constraints of Piebald (which has no public per-subagent routing API). The route
> is a global state flipped per launch — hence the ordering rules below.

---

## The directive

View full repository on GitHub →