delegate
Skill2 starsChanged 11 days agoMITView on GitHub
Use when your Claude Code orchestrator should hand a scoped subagent, workflow, or background task to a NON-Anthropic model to keep it off the Anthropic budget - GPT via Codex (ChatGPT subscription), Grok (metered xAI key), or a free local model via Ollama. Triggers - "delegate this to codex/grok/gemma", "run this off-budget", "hand this to a cheaper model", "/delegate". NOT a router-proxy under ANTHROPIC_BASE_URL (that corrupts tool calls); this shells out to each vendor's own headless CLI so tool-calling stays native.
- Reads credentials
78 other projects use a version of this.
Adopted by
Most recently taken up by
- brasillero/brstacktheir own version, first seen Nov 8, 2026
- go-sphere/skillstheir own version, first seen Nov 8, 2026
- victor-falcon/skillstheir own version, first seen Nov 8, 2026
- AlomoesDataScience/claude-skillstheir own version, first seen Nov 8, 2026
- lehcode/claudelegatetheir own version, first seen Nov 8, 2026
- codewhale-hq/codewhale-plugin-marketplacetheir own version, first seen Nov 8, 2026
Used with
Projects with it also use state, preview and 8 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
MicrosoftSkillstate
Store and query a Microsoft Managed App's built-in state and file attachments with `ms project state` CLI schema commands and generated TypeScript clients. First, with the user signed in to the CLI, run `ms feature status --name state --json`; if `feature.enabled` is not `true`, recommend an alternative connector or data source.
Also in 3 projects that use this
kv0906Skillpreview
Render vault notes as styled HTML and open in browser. Turn markdown docs, decisions, progress reports into readable previews. Use for "/preview docs/project-a/checkout-flow.md", "/preview progress all", "/preview decide auth-approach", or when user wants to see a doc before sharing.
Also in 3 projects that use this
GitHubSkillprd
Generate high-quality Product Requirements Documents (PRDs) for software systems and AI-powered features. Includes executive summaries, user stories, technical specifications, and risk analysis.
Also in 5 projects that use this
nicolasestremSkilldocument
Create focused documentation for specific components or features
Also in 3 projects that use this
anombyte93Skilldiscover
Phase 1 of the prd-taskmaster pipeline: brainstorm-driven discovery. Delegates to superpowers:brainstorming in Interactive Mode (one adaptive question at a time), or self-brainstorms in Autonomous Mode when no user is present. Intercepts before the brainstorming chain hands off to writing-plans — this skill owns the exit. Extracts constraints, calibrates scale (Solo / Team / Enterprise), and advances the pipeline to GENERATE.
Also in 3 projects that use this
Microsoft AzureSkillskill-authoring
Write Agent Skills that comply with the agentskills.io specification. WHEN: "create a skill", "new skill", "write a skill", "skill template", "skill structure", "review skill", "skill PR", "skill compliance", "SKILL.md format", "skill frontmatter", "skill best practices". DO NOT USE FOR: general documentation. INVOKES: vally CLI.
Also in 3 projects that use this
Other versions78 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 78
- prassanna-ravishankar/repowire★ 270same name
- HurricaHjz/SecondSelf★ 156same name
- wlsdks/ontology-atlas★ 149same name
- HurricaHjz/second-yourself★ 105same name
- spmtitsolution/OpenBA-Kit★ 38same name
- pvjbuilds/delegate-router★ 32same name
- PyModel/claude-architect★ 31same name
- peterpme/skills★ 28same name
- jisuzzzz/haechi★ 17same name
- mhlaghari/stuntman★ 16same name
68 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository29 other files it gives its agents.
- AGENTS.mdAGENTS.md
- apply-review-findingsSkill
- author-workflow-fanoutSkill
- chain-launcherSkill
- design-consultationSkill
- design-fail-closed-gateSkill
- document-releaseSkill
- gistSkill
- goal-promptSkill
- grokbotSkill
- incident-as-codeSkill
- investigateSkill
- learn-captureSkill
- office-hoursSkill
- orion-deep-researchSkill
- oss-loopSkill
- pre-compactSkill
- pre-prSkill
- prove-control-bindsSkill
- prove-deploy-is-liveSkill
- readonlySkill
- reassert-guards-on-rewriteSkill
- reprobe-stale-premiseSkill
- scope-guardSkill
- shipSkill
- tdd-loopSkill
- tools-routerSkill
- triage-fanout-verdictsSkill
- xSkill
The file
We split this skill into the rules it gives an agent
5 rules. 0 are common, 2 are distinctive, and 3 are very specific to this project.
0
Common
Most of the 68 edited versions we read keep these.
2
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Keep your Claude model orchestrating.
- Very specific: line 18
Call should_delegate(task) (pure fn in scripts/delegate.py) or apply its rule directly:
- Distinctive: line 27
Only delegate genuinely separable, well-scoped work.
- Very specific: line 58
NEVER emits a sandbox-bypass flag (--dangerously-*, -y, --yolo, ...).
- Very specific: line 113
Verify a target is live before trusting it: python3 scripts/delegate.py codex "Reply with exactly: PONG" should return ok:true, …
“Common” is measured: kept by at least 6 in 10 of the 68 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
delegate - off-Anthropic subagent delegation
Keep your Claude model orchestrating; push scoped subagent, bulk, or background work to a
non-Anthropic model CLI so it runs off the Anthropic budget with that vendor's native
tool calling. The mechanism is a headless-CLI subprocess, never an ANTHROPIC_BASE_URL
router-proxy: a proxy makes a non-Claude model speak Claude Code's Anthropic-shaped API, and the
translation shim corrupts tool calls (empty-string params, fake tool_use, mistranslated server
tools, infinite Read loops). Each vendor's own CLI speaks its own protocol natively, so the tool
loop stays intact and the work bills that vendor, not your Anthropic allocation.
When to use (the decision)
Call should_delegate(task) (pure fn in scripts/delegate.py) or apply its rule directly:
| Task shape | Recommend | Why |
| off-budget + bulk + cheap-ok | gemma | free local model via Ollama, zero marginal cost |
| off-budget + needs X/Grok | grok | metered xAI key, X-search-grounded |
| off-budget + frontier coding | codex | GPT on the ToS-sanctioned ChatGPT subscription |
| not off-budget | stay-claude | keep it on the orchestrator |
Only delegate genuinely separable, well-scoped work.
Terms-of-Service reality (the binding constraint, not the tooling). Reusing a consumer subscription inside a third-party harness is prohibited and enforced at most vendors. Codex on a ChatGPT plan is the one sanctioned subscription path. Grok here uses a metered API key, not a consumer login; the local Ollama lane has no subscription to reuse. Do NOT wire a consumer Gemini, Grok, or Claude subscription through this layer; if you want those models, use their paid API keys.
Usage
D=~/.claude/skills/delegate/scripts/delegate.py
python3 "$D" codex "Refactor foo.py for readability" --dry-run # inspect argv + env, run nothing
python3 "$D" codex "Summarize the diff in HEAD" # real off-budget codex run
# grok + gemma read their config from the environment at call time (keep secrets off the argv):
XAI_API_KEY=xai-... python3 "$D" grok "X sentiment on agentic coding"
OLLAMA_HOST=http://<your-ollama-host>:11434 python3 "$D" gemma "cheap bulk summarize"From Python (fan-out, abstention-safe):
import delegate
delegate.fanout([
{"target": "codex", "task": "..."},
{"target": "gemma", "task": "..."}, # runs concurrently; errored lens -> state:"pending", never dropped
])Security posture (enforced in code, asserted by tests)
- NEVER emits a sandbox-bypass flag (
--dangerously-*,-y,--yolo, ...). Community CLI-bridges commonly bake those in; this layer exists partly to avoid that. - Child env is a least-privilege WHITELIST: base keys + ONLY the target's own key; no sibling-provider keys, no GH/Slack/secret-manager/Anthropic tokens.
- Child CLI selection must be an absolute first PATH hit outside the workspace.
Each traversed symlink/junction is checked, and the exact selected launcher is
checked again immediately before dispatch; launcher identity is preserved.
Unsafe selections raise
DelegateError, with no fallback to another CLI. This is workspace path exclusion, not publisher/binary authentication. - codex sandbox defaults read-only;
--writeescalates toworkspace-write(neverdanger-full-access). - codex stdin is
/dev/null(guards the >=0.120 non-TTY exec deadlock). - Rule of Two: a delegate acting on untrusted input must not also hold private access AND unsandboxed/consequential output at once. Keep the sandbox read-only unless you have vetted the input.
Gotchas
- Compatibility change proposed for the next MAJOR release: relative/empty PATH
selections and even intentional workspace-local CLI installs are now denied.
System, user, custom and group-writable absolute installations outside the
workspace remain accepted; no fixed installation allowlist is used.
Workspace means the nearest enclosing
.gitmarker, otherwise cwd. Start a non-Git call at the intended workspace root; nested repos define separate roots. Choose a vetted external installation deliberately; do not bypass denial by pointing an outside symlink back into the workspace. No version is reserved. - The OS, caller cwd/marker selection, outside installation writers and launcher contents are trusted. Interpreters, dependencies, inherited PATH and HOME access are unchanged. Hard-link/mount aliases and same-user replacement after the last check are not prevented. Use OS isolation for hostile code. Native Windows and macOS process execution remain unqualified; Linux fixture results are not native platform certification.
- The helper assignment above remains a deliberate direct-install path. Plugin-only helper resolution is not qualified by this change, and loading grants no execution permission.
- grok/gemma need their config at call time: an
XAI_API_KEYfor grok, anOLLAMA_HOSTpointed at your endpoint for gemma. Without them the run fails honestly (no silent fallback). A shell HOOK cannot reliably wrap a secret-injection step (it fails open); call this from an interactive session or a timer/service that already has the secret in its environment. - codex OAuth tokens are single-use/rotating; a concurrent Codex app-server (e.g. an IDE
extension) can invalidate this one (
refresh_token_reused401).codex login statuscan LIE; trust a real run. - gemma uses
keep_alive:-1so a probe does not evict the hot local model. - Parallel fan-out: codex app-server launches serialize via a broker; grok/gemma are independent.
Reap an orphaned broker process by EXACT PID, never a broad
pkill -f. - The
grok -p/--singleflag is load-bearing: a positional prompt opens the interactive TUI and hangs a non-interactive caller.
Boundary (defer to your own setup)
This skill is the DECISION + a uniform 3-target interface + fan-out; it is deliberately not a
credential manager or a deploy tool. Secret storage/injection, which host runs Ollama, and which
ChatGPT/xAI plan you hold are your environment's concern. Provide XAI_API_KEY and OLLAMA_HOST
from wherever you keep them; the skill only ever reads the one key its target needs and never
prints it. Adapt the three target CLIs to whichever vendor CLIs you have authenticated locally.
Verify a target is live before trusting it: python3 scripts/delegate.py codex "Reply with exactly: PONG"
should return ok:true, off_anthropic:true with an absolute argv0 and a genuine model reply.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

