Skip to content
Back to search

delegate-skill

Claude Code skill: Claude orchestrates, big self-contained work goes to Codex, Gemini (agy) or OpenCode in one call

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/tanvir3056--delegate-skill/badge.svg)](/listings/tanvir3056--delegate-skill)

HTML

<a href="/listings/tanvir3056--delegate-skill"><img src="/api/listings/tanvir3056--delegate-skill/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

git clone https://github.com/tanvir3056/delegate-skill ~/delegate-skill && bash ~/delegate-skill/install.sh

Needs Node 20+ and git, on macOS. `install.sh` runs `node bin/delegate.js install` for every Claude account folder it finds (`~/.claude`, each `~/.claude-*`, `$CLAUDE_CONFIG_DIR`); pass folders to pick them yourself: `bash ~/delegate-skill/install.sh ~/.claude-work`. Then log in to at least one Provider CLI (below) and start a new Claude Code session. How it works: https://tanvir3056.github.io/delegate-skill/

Update: `git -C ~/delegate-skill pull && bash ~/delegate-skill/install.sh` (install copies the skill, so re-run it after a pull).

`install` does these in one Claude config dir, idempotently (safe to re-run, e.g. after moving the checkout or updating): 1. copies the skill folder to `skills/delegate/` (`SKILL.md` plus its reference files, checkout path filled in); 2. adds one permission rule, `Bash(DELEGATE_LIVE=1 node <checkout>/bin/delegate.js *)`, so delegating runs without prompts; 3. removes the old SessionStart/SubagentStart hook entry (`inject-rules.js`) from `settings.json` if an earlier version added one (ADR 0005). Sessions that did not invoke the skill carry no delegate rules.

Other settings, hooks and rules in `settings.json` are kept. If `settings.json` is not valid JSON, install stops and changes nothing.

Two config dirs (e.g. two Claude accounts)

Each account has its own config dir. Install into each one:

node bin/delegate.js install --config-dir ~/.claude
node bin/delegate.js install --config-dir ~/.some-other-config-dir
# or: CLAUDE_CONFIG_DIR=~/.some-other-config-dir node bin/delegate.js install

Start Claude Code afresh afterwards (the skill list loads at session start). To uninstall: delete `<dir>/skills/delegate/`, and the rule from `<dir>/settings.json`.

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 88 lines
  1. # delegate-skill
  2. A Claude Code skill plus a small Node helper (`delegate`). Claude stays the Orchestrator: it plans, briefs, verifies. Well-scoped work goes to other models' CLIs (Codex, Antigravity `agy`, OpenCode) through one command, with Fallback when a model is capped. No third-party packages. Node >= 20, macOS.
  3. MIT licensed. Design records: `docs/adr/`. Behaviour contracts: `docs/contracts.md`. Vocabulary: `GLOSSARY.md`.
  4. ## Install
  5. ```sh
  6. git clone https://github.com/tanvir3056/delegate-skill ~/delegate-skill && bash ~/delegate-skill/install.sh
  7. ```
  8. Needs Node 20+ and git, on macOS. `install.sh` runs `node bin/delegate.js install` for every Claude account folder it finds (`~/.claude`, each `~/.claude-*`, `$CLAUDE_CONFIG_DIR`); pass folders to pick them yourself: `bash ~/delegate-skill/install.sh ~/.claude-work`. Then log in to at least one Provider CLI (below) and start a new Claude Code session. How it works: https://tanvir3056.github.io/delegate-skill/
  9. Update: `git -C ~/delegate-skill pull && bash ~/delegate-skill/install.sh` (install copies the skill, so re-run it after a pull).
  10. `install` does these in one Claude config dir, idempotently (safe to re-run, e.g. after moving the checkout or updating):
  11. 1. copies the skill folder to `skills/delegate/` (`SKILL.md` plus its reference files, checkout path filled in);
  12. 2. adds one permission rule, `Bash(DELEGATE_LIVE=1 node <checkout>/bin/delegate.js *)`, so delegating runs without prompts;
  13. 3. removes the old SessionStart/SubagentStart hook entry (`inject-rules.js`) from `settings.json` if an earlier version added one (ADR 0005). Sessions that did not invoke the skill carry no delegate rules.
  14. Other settings, hooks and rules in `settings.json` are kept. If `settings.json` is not valid JSON, install stops and changes nothing.
  15. ### Two config dirs (e.g. two Claude accounts)
  16. Each account has its own config dir. Install into each one:
  17. ```sh
  18. node bin/delegate.js install --config-dir ~/.claude
  19. node bin/delegate.js install --config-dir ~/.some-other-config-dir
  20. # or: CLAUDE_CONFIG_DIR=~/.some-other-config-dir node bin/delegate.js install
  21. ```
  22. Start Claude Code afresh afterwards (the skill list loads at session start). To uninstall: delete `<dir>/skills/delegate/`, and the rule from `<dir>/settings.json`.
  23. ## Use
  24. Type `/delegate` once at the start of a Claude Code session. From then on Claude decides per task: small work (under ~100 lines, or needing the live conversation) it does itself; big self-contained work with checkable acceptance (150+ lines or 3+ files) it hands to another model in one call, then verifies. Delegated work needs a git workspace; the worker sees committed state only, so commit first (ADR 0002). By hand:
  25. ```sh
  26. DELEGATE_LIVE=1 node bin/delegate.js handoff --kind delegate --task-type code-feature --complexity medium \
  27. --workspace . --file - <<'EOF'
  28. Add a --json flag to cli.js; tests in test/cli.test.js must pass
  29. EOF
  30. ```
  31. - stdout: a header line (`delegate: <outcome> | <provider>/<model> | exit <code> = <meaning> | result: <file>`), then the worker's text. Exit 0 done (verify it); 10 no model succeeded (Orchestrator does it); 11 critical stop; 2/3 bad call.
  32. - `DELEGATE_LIVE=1` is required to start real Provider CLIs; without it they are refused and the helper exits 10 (so tests and probes never reach a login).
  33. - `--kind consult` asks read-only questions; `--targets "codex:<model>,opencode:<model>" [--fresh]` asks several models in parallel, each answer labelled.
  34. - `--file brief.txt` (a file instead of stdin) still works and prints one JSON line. `--dry-run` shows the route chain without running anything.
  35. - Edits from a `delegate` run arrive uncommitted in your workspace; review and commit them yourself.
  36. - `node bin/delegate.js report` summarises usage per model (token counts are a proxy, not Claude allowance). `overhead` records the context cost of the skill (`docs/overhead.md`).
  37. ## Providers
  38. Install and log in to the CLIs you want; the helper only uses what is present:
  39. | Provider | CLI | Note |
  40. |---|---|---|
  41. | `codex` | `codex` | OpenAI models; also the route for desktop-control |
  42. | `agy` | `agy` | Gemini. Never started when logged out (it would open a browser login) |
  43. | `opencode` | `opencode` | free and paid models; models on the restricted list in `config/routing.json` run only in public workspaces |
  44. ```sh
  45. node bin/delegate.js status # which Providers are usable (no model call)
  46. node bin/delegate.js status --probe # one tiny real call per usable Provider
  47. ```
  48. Configuration files, all local and personal (never commit them). The state dir is `$DELEGATE_STATE_DIR`, else `~/.delegate-skill`:
  49. - `<state>/config.json`: `{"disabled_providers": ["agy"], "public_workspaces": ["/abs/dir"]}`. Disabled Providers are skipped silently. Restricted models (Chinese-vendor or unknown-origin) run only in workspaces listed under `public_workspaces`, on copies of the files passed with `--files`.
  50. - `<state>/routing.local.json`: override the shipped Routing table (`config/routing.json`): `{"version":1,"add":[<row>],"remove":[{"provider":"codex"}]}`. Row and field details: `docs/contracts.md`.
  51. Routing rationale and sources: `docs/research/routing.md`.
  52. ## Unattended runs
  53. Everything is non-interactive: worker stdin is closed, each attempt has a hard timeout (`--timeout`, default 900 s), workers run in a throwaway `git worktree`, and a capped or failing model hands over to the next route at once.
  54. - Quota: the Provider goes into cooldown (until its reset time, else 60 min) and is skipped.
  55. - Nothing left: exit 10, the Orchestrator does the task. If the Orchestrator itself is out of allowance, pass `--orchestrator-unavailable "<reason>"`: the helper logs a critical stop, shows a macOS notification and exits 11. Skip that task and carry on with others.
  56. - Log: `<state>/log/handoffs.jsonl`; results: `<state>/results/`.
  57. - Unattended Claude sessions still need their own permission mode for editing files; this tool only pre-approves the helper command.
  58. - Never run `delegate` from inside a worker; it refuses (exit 3).
  59. ## Develop
  60. `npm test` runs Seam 1 (fake CLIs, temp state, no network). `npm run test:seam2` drives real `claude -p` against the skill and spends Claude allowance. Tests never touch your real Claude config or state dir.
  61. Pre-commit hook (`.githooks/pre-commit`: rejects sed backup files `*-e`/`*-E`, duplicate-object-key lint on staged JS/JSON; no test run). `npm install` activates it via the `prepare` script; otherwise run `git config core.hooksPath .githooks`.

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.