Delegate to cli
Skill Phoenixrr2113/agent-harness/defaults/skills/delegate-to-cli
A file-first agent operating system. Build AI agents by editing markdown files, not writing code. Self-managing, self-improving, durable. Agent Skills compatible.
npx -y skills add Phoenixrr2113/agent-harness --skill delegate-to-cliAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Delegates bounded subtasks (text-in/text-out, large-token, no harness MCPs needed) to a local CLI agent (claude/codex/gemini) via scripts/delegate.sh. Use when the task is large enough to warrant a subprocess but doesn't need the harness's own primitives. Returns the subagent's final text plus structured error info.
SKILL.md
3.0 KB, as published. Nobody here has run it
delegate-to-cli
When to use
Reach for this skill when all four are true:
- Bounded — clear start, clear end, output is text or a verifiable file change
- Text-in/text-out — no need for tool-call structure back to the parent
- Large in tokens — would burn the parent's context if done inline
- Doesn't need this harness's own primitives or MCP servers
Available scripts
scripts/delegate.sh <cli> <mode> <prompt>— Run a bounded subtask via a local CLI agent and return its result. CLI:claude|codex|gemini. Mode:read|edit.scripts/verify-cli.sh <cli>— Check the CLI binary is on PATH and meets the minimum version. Run once if delegate fails withCLI_NOT_FOUNDorCLI_VERSION_TOO_OLD.
Workflow
- Verify the CLI is available (first use):
scripts/verify-cli.sh claude - Delegate:
scripts/delegate.sh claude read "Summarize the README" - Read the JSON result. On
status: ok, the subagent's output is inresult.output. - On
status: error, follownext_steps. Common cases listed inreferences/failure-modes.md.
Gotchas
- Permission mode is the #1 source of silent hangs.
scripts/delegate.shrequires<mode>to beread(analysis-only) oredit(file modification). The script maps these to the correct CLI permission flags. If you bypass the script and call the CLI directly without the right flag for an edit task, the subprocess hangs forever — seereferences/permission-flags.md. - CLI invocation may fall outside the CLI's subscription TOS. The user opted in during
harness initif delegation is enabled. - Do not fall back silently on CLI_NOT_FOUND. Tell the user what is missing so they can install it.
Failure modes
If scripts/delegate.sh returns status: error, read error.code:
CLI_NOT_FOUND— binary missing; tell the user to install it.CLI_VERSION_TOO_OLD— seereferences/failure-modes.mdfor minimum versions and upgrade paths.INVALID_INPUT— bad<cli>or<mode>argument; re-invoke with correct values.PERMISSION_FLAG_MISSING— subprocess hung; re-invoke witheditmode instead ofread.RATE_LIMITED— provider returned 429; back off and retry after a delay.SUBPROCESS_TIMEOUT— run exceeded the wall-clock limit; increase or split the task.SUBPROCESS_FAILED— non-zero exit not matching the above; checkerror.evidencefor raw output.
For detailed recovery hints on each code, load references/failure-modes.md.