delegate
Use when delegating a bounded task between Claude Code and native Codex. For same-provider work or isolation, use /claudna:worktree.
- License 许可
- Apache-2.0
- 最近更新
- 2026-11-15
- Stars
- ★ 0
- Forks
- 1
01 前言 Front Matter
- name
- delegate
- hosts
- [ "claude-code", "codex" ]
- requires
- [ { "cli": "python3", "reason": "Stdlib launcher; the destination's native Claude or Codex CLI must also be installed and authenticated" } ]
- description
- Use when delegating a bounded task between Claude Code and native Codex. For same-provider work or isolation, use /claudna:worktree.
- argument-hint
- [run|status] [task]
- user-invocable
- true
02 资源文件 1
- 参考文档native-clis.md5.5 KB
03 SKILL.md 正文
Delegate
Hand one authorized task to the other provider's native CLI; retain judgment and acceptance in the parent. Preserve native permissions and settings. Do not relax controls or retry until a model happens to comply.
Codex: Read
../_shared/codex-tools.mdfirst. Same-host subagents do not cross providers.
Procedure
- Resolve the actual plugin root per
../_shared/claudna-root.mdand readnative-clis.md. Honor the user's provider, model, native account and billing mode; reuse standing authorization. No automatic account/model substitution, API billing, permission widening or provider retry. - Identify the current parent's actual recorded
(agent_cli, session_id)from its host receipt; confirm with/claudna:session show. Never choose the latest session or infer identity from cwd. Missing identity/history blocks delegation; continue locally if authorized. Forstatus, runscripts/delegate.py status --parent <sid>through the bundled entry point below; no provider call. - Assign one objective, workspace-relative owned paths and a meaningful existing check. Hand off an absolute task-owned workspace and pause parent writes until observed exit. Edits require a clean baseline. Dirty prerequisites and concurrent work remain with the caller;
/claudna:worktreecan prepare isolation before delegation. Delegate never creates/removes a workspace. - Feed one JSON request to
python3 -B -S <claudna-root>/scripts/delegate.py run --request -:parent_sid,parent_provider,provider,cwd,owned_paths(list),task,model(explicit name or null for native default),deadline_seconds(1–3600),workspace_owned: true,read_only(boolean). Use the host transport below; serialize task data as JSON, never interpolate it into an executable shell command. State provider/model, owned paths and check before launch. The host's actual process timeout must exceeddeadline_seconds; a tool yield must retain the process handle. Preserve required controls; denied required actions block acceptance. - Keep the actual process handle and wait. A tool yield/timeout does not prove exit; do not start a replacement.
completedmeans native completion only. Inspect all changes, including untracked files, and verify scope and behavior. Inspect returnedpermission_denials: an optional diagnostic denial can coexist with completed work; a denied required action with no independently verified permitted result means rejection. Include the disposition of denials in acceptance evidence. Do not classify command text or accept worker prose as proof. Reuse fresh worker check evidence only when it matches the tested source. Do not add tests merely to pin implementation text. - Automatically record the parent decision using
scripts/delegate.py settle --request -and the JSON transport below, with concrete check evidence. Worker prose is not approval. Failed/partial edits stay in the same workspace; rejection never resets/deletes them. - Report worker outcome, parent decision and cleanup separately. Launcher bookkeeping is cleaned automatically, with retry on workflow entry/session start. An unresolved worker remains protected and blocks another launch until ownership is resolved. Build then continues its existing review/verify/ship once; delegate never opens a PR or repeats that pipeline.
Host input transport
On Codex, use the exposed process API's stdin input or write-to-process control and retain the returned handle. Claude Code's Bash tool has no stdin argument: use a single-quoted here-document containing the serialized request on one physical JSON line. Encode embedded newlines and other control characters inside JSON strings; never paste an unserialized prompt. The JSON object line begins with {, so it cannot equal the delimiter. Quoting the delimiter disables shell expansion, including dollar signs, backticks and command substitution.
python3 -B -S "<claudna-root>/scripts/delegate.py" run --request - <<'CLAUDNA_DELEGATE_JSON'
{"parent_sid":"<actual-parent>","parent_provider":"claude","provider":"codex","cwd":"/absolute/task-workspace","owned_paths":["file.py"],"task":"Bounded objective; encode embedded newlines as \n.","model":null,"deadline_seconds":300,"workspace_owned":true,"read_only":false}
CLAUDNA_DELEGATE_JSON
For Claude Code settlement, use the same single-line JSON transport. Existing permission checks still apply to these Bash calls; an unanswered approval blocks the call, without policy changes or retries.
python3 -B -S "<claudna-root>/scripts/delegate.py" settle --request - <<'CLAUDNA_DELEGATE_EVIDENCE'
{"parent_sid":"<actual-parent>","job_id":"<actual-job>","decision":"accepted","evidence":"<commands, actual results, changed scope and denial disposition>"}
CLAUDNA_DELEGATE_EVIDENCE
Limits
One foreground worker per state root. No native resume, recursive delegation, worktree factory, patch integration, recovery archives or heuristic reaper. Path ownership is an assignment, not a sandbox. read_only restricts local built-in tools or the local filesystem sandbox; native MCP/connectors and hooks retain their existing permissions. It does not guarantee external read-only access. Tasks requiring stronger external isolation are unsupported unless native policy already supplies it. Provider history is neither copied nor deleted; no direct vault writes. Useful lessons use /claudna:capture or existing session harvest with privacy and human promotion unchanged.
If an abrupt death leaves unknown execution, keep parent writes paused. Only after the operator verifies the owned worker has terminated and preserves its edits may they remove that exact <state>/delegation/active.json; never delete the stable lock. Routine terminal cleanup is automatic, including when parent history was removed by retention.
04 同仓库更多 Skills
example-review
Use when you want to review pull requests with detailed, actionable feedback on code quality, correctness, and maintainability.
bad-skill
Too short
worktree
Use when starting feature work that needs isolation from the current workspace, or when running multiple Claude sessions in parallel on different branches — creates and manages git worktrees. For fetching latest main into every existing worktree and branch across your sibling repos, use /claudna:sync-branches instead.
weigh-development-paths
Use when at a development junction with multiple viable approaches — architecture choices, refactoring strategies, where to put new code, or which pattern to follow. Triggers on 'which approach', 'how should I', 'Option A vs B', or any point where the next step isn't obvious and the wrong choice creates rework.
verify-completion
Use when about to claim work is complete, fixed, or passing -- requires running verification commands and confirming output before making any success claims.
vercel
Use for Vercel operations — deploy to production or preview (or roll back), view, filter, or debug deployment logs, or check project status (deployments, domains, env vars, config). Replaces /vercel-deploy, /vercel-logs, /vercel-status.