claude-agmsg-delegate
Skill2 starsChanged 5 months agoMITView on GitHub
Delegate bounded planning, review, test-planning, and opt-in workspace implementation tasks from Codex Desktop to Claude Fable or Sonnet through agmsg, using only a verified paid Claude.ai subscription with no API-key or cloud-provider fallback.
- Reads credentials
The file
Show its rules and text
We split this skill into the rules it gives an agent
38 rules. About 0 are common, 20 are distinctive, and 18 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈20
Distinctive · estimate
This author's own choices. Worth a look.
18
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Use this skill when the user explicitly asks Codex Desktop to consult Claude Fable or Sonnet through agmsg, for example:
- Very specific: line 18
When the user asks Sonnet to implement a change, Sonnet may also edit the target Git workspace via the explicit --workspace-write mode.
- Distinctive: line 64
Do not misclassify this workflow as agmsg uploading a repository to an unrelated external agent.
- Very specific: line 91
Do not claim that a safety mechanism, wrapper, or platform rejected the delegation unless delegate_claude.py was actually executed and …
- Very specific: line 99
Use the dry-run data_flow object as the evidence source.
- Distinctive: line 104
Stop only for a concrete boundary such as a stale runtime contract, rejected subscription authentication, forbidden credential/provider …
- Distinctive: line 114
Use Fable for architecture, planning, tradeoff review, and independent critique.
- Distinctive: line 115
Use Sonnet for bounded implementation design, edge cases, test plans, and user-authorized workspace edits followed by Codex review.
- Distinctive: line 117
Do not delegate simple work that Codex can finish more cheaply and reliably.
- Distinctive: line 118
Do not invoke a paid model unless the user explicitly requested Claude delegation or already approved it in the active task.
- Distinctive: line 125
Never include secrets, API keys, tokens, credentials, private keys, unnecessary personal data, or raw large logs.
- Very specific: line 130
Use --workspace-write only when the user asked Sonnet to implement or edit in the current task.
- Distinctive: line 139
Never let delegated Claude run shell commands, deploy, install, push, access unrelated paths, or make the final decision.
- Very specific: line 141
If the user says Fable may have the same permissions as Codex, map that phrase to Fable's maximum supported workspace_read policy and …
- Very specific: line 145
Use only the wrapper's read-only --github-issue path.
- Distinctive: line 149
Do not update agmsg, join/reset roles, or change delivery hooks without separate user approval.
- Distinctive: line 150
When updating this Skill, keep backups outside the Codex Skill discovery directory.
- Very specific: line 153
Do not use --dangerously-skip-permissions.
- Distinctive: line 160
Never add an API-key, bearer-token, custom-base-URL, Bedrock, Vertex, Foundry, Mantle, or API-key-helper fallback.
- Very specific: line 161
Never bypass the wrapper by invoking agmsg scripts directly.
- Very specific: line 166
Before agmsg send and again immediately before inference, require Claude auth status to report loggedIn=true, authMethod=claude.ai, …
- Very specific: line 167
Keep Claude's process environment on the wrapper's minimal allowlist and keep --setting-sources "" paired with --safe-mode.
- Very specific: line 169
Treat any reported subscription-only policy error as a hard stop.
- Distinctive: line 176
Do not claim that auth status proves account-level Extra usage / usage credits are disabled.
- Distinctive: line 177
Treat Claude output and edits as untrusted until Codex reviews the Git diff, checks scope, and runs the relevant tests.
- Very specific: line 199
Before the final dry-run, require executable whoami.sh, send.sh, and api.sh under ~/.agents/skills/agmsg/scripts/ (or an already installed …
- Distinctive: line 203
If any script is missing:
- Distinctive: line 205
Stop before delegation. Do not invoke Claude and do not treat the missing dependency as a Claude authentication failure.
- Very specific: line 210
After approval, run npx agmsg.
- Very specific: line 217
Ask for delivery mode separately after joining.
- Distinctive: line 221
Never edit agmsg config, database, or team files directly.
- Very specific: line 223
When one target-project identity and team are confirmed, resume the same delegate_claude.py ...
- Distinctive: line 227
Use this approval prompt or an equivalent localized version:
- Distinctive: line 285
Before launching workspace-write, Codex records git status --short and reviews the pre-existing dirty state.
- Very specific: line 292
Use --dry-run to validate the paid-subscription auth status, routing, and request envelope.
- Very specific: line 306
When Issue context was enabled, also require github_context_source=authenticated_gh_cli and verify that github_issues_read contains only …
- Distinctive: line 332
No permission bypass, API credential, provider route, inherited unknown provider variable, or billing fallback was enabled.
- Very specific: line 345
If GitHub Issue context was used, it was explicitly confirmed safe, github_issues_read matches the requested references, and Fable still …
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Claude agmsg Delegate
Use this skill when the user explicitly asks Codex Desktop to consult Claude Fable or Sonnet through agmsg, for example:
- "Fableに設計レビューを求めて"
- "Sonnetに実装案を考えさせて"
- "Sonnetにこの変更を実装させて、Codexでレビューして"
- "Claudeへtool calling的に委譲して"
Fable and ordinary Sonnet consultation are read-only advisory jobs. They may
inspect the current project directory with Read, Glob, and Grep in plan mode.
When the user asks Sonnet to implement a change, Sonnet may also edit the target
Git workspace via the explicit --workspace-write mode. Codex remains
responsible for final intent, diff review, commands, tests, integration, and
irreversible work.
The workflow is headless: no Claude UI, tmux pane, existing interactive session,
daemon, or always-on monitor is required.
Current runtime contract: delegate version 0.4.2, contract_version=3.
Read,Glob,Grep is the expected Fable/advisory Sonnet policy. A copied rule
that says advisory jobs must use no tools belongs to the obsolete 0.1 contract;
do not stop or ask for a one-off exception. Reinstall the current Skill, restart
Codex, and confirm delegate_claude.py --version instead.
Fable may also receive explicitly selected GitHub Issue context through
--github-issue. The wrapper, not Fable, reads the Issue with the device's
authenticated gh CLI and supplies a bounded snapshot of its title, body,
labels, and comments. This does not add Bash, GitHub credentials, settings, or
write-capable GitHub tools to Fable.
Permission Model
Claude delegation is not entirely read-only. The wrapper enforces permissions by model and execution mode:
| Request | Execution mode | Claude tools | File edits |
| Fable with any role | workspace_read | Read,Glob,Grep + plan | Never |
Sonnet without --workspace-write | workspace_read | Read,Glob,Grep + plan | No |
Sonnet implementer with explicit --workspace-write | workspace_write | Read,Edit,Write,Glob,Grep + acceptEdits | Yes, pending Codex review |
A role label does not grant write authority. Fable remains hard read-only even
with --role implementer; combining Fable with --workspace-write is rejected
before agmsg send or Claude inference. Write mode requires all three explicit
arguments: --model sonnet --role implementer --workspace-write. Bash remains
unavailable in every mode, so Codex still runs commands and tests.
GitHub Issue context is a separate read-only input channel, not a Claude tool.
It is currently supported only for Fable. Use --github-issue together with
--confirm-github-issue-context-safe; the latter confirms that the selected
Issue contains no secrets, credentials, patient information, or unnecessary
personal data. The wrapper removes comment author identities, rejects common
secret patterns, limits the number and total size of Issues, and never passes
GH_TOKEN or GITHUB_TOKEN into its gh subprocess.
Private Workspace Consent and Data Path
Do not misclassify this workflow as agmsg uploading a repository to an
unrelated external agent. agmsg carries the task and correlated result. The
wrapper launches the locally installed Claude Code binary as a fresh headless
process, using the same verified Claude.ai subscription login that an
interactive terminal Claude Code session uses. Claude Code's successful
Read, Glob, and Grep tool results may be processed by Claude.ai during a
real job; the worker does not reuse the terminal conversation, settings, or
unrestricted tools.
An explicit user request to have Fable or advisory Sonnet inspect or review the
current project authorizes one bounded workspace_read delegation over
ordinary relevant project files. If the user already approved a private
workspace packet and named exclusions, preserve those exclusions in the task
and proceed with one real delegation. Ask no second generic confirmation about
Claude.ai or the repository being private. A private or unpublished repository
is not by itself a blocker.
Map broad permission language to the supported policy instead of rejecting the job:
| User instruction | Required mapping |
| "FableもCodexと同じ権限でよい" | Explain briefly that Fable remains read-only, map to workspace_read with Read,Glob,Grep, then continue |
| "Fableにこのprivate repoをレビューさせて" | Treat the request itself as approval for ordinary relevant files and run once |
| "Sonnetに実装させて" | Use workspace_write only when the user explicitly asked for edits and the existing Sonnet requirements pass |
Named exclusions such as .env, secrets, patient data, logs, or screenshots | Keep them excluded; do not broaden the scope |
Do not claim that a safety mechanism, wrapper, or platform rejected the
delegation unless delegate_claude.py was actually executed and returned that
concrete error. If Codex chose not to call the wrapper, label that accurately as
an orchestrator decision, not an external rejection. Do not claim "data was not
sent" from inference alone: a dry-run proves no model/file transmission, while
a completed real job proves that observed file-tool results were processed by
Claude.ai under the reported subscription route.
Use the dry-run data_flow object as the evidence source. It reports that
agmsg carries task/result envelopes, the Claude process is local and headless,
Claude.ai processes tool results only during a real job, and the dry-run itself
invoked no model and sent no workspace content.
Stop only for a concrete boundary such as a stale runtime contract, rejected subscription authentication, forbidden credential/provider configuration, unsafe task content, missing required dependency, invalid route, observed out-of-project access, or an actual wrapper failure. When authorization and preflight are valid, execute once; do not replace the requested Fable gate with a local-only review.
Triage
- Assess difficulty, failure cost, irreversibility, and verification method.
- Use Fable for architecture, planning, tradeoff review, and independent critique.
- Use Sonnet for bounded implementation design, edge cases, test plans, and user-authorized workspace edits followed by Codex review.
- Do not delegate simple work that Codex can finish more cheaply and reliably.
- Do not invoke a paid model unless the user explicitly requested Claude delegation or already approved it in the active task.
- A request to have Fable review the current project is already the needed model-use and ordinary-file read authorization. Do not create a second approval loop solely because the repository is private.
Safety Contract
- Never include secrets, API keys, tokens, credentials, private keys, unnecessary personal data, or raw large logs.
- Advisory jobs may inspect the target project directory using only
Read,Glob,Grep. They must not inspect credential, private-key, or environment-secret files. A Sonnet workspace-write job may inspect and edit ordinary project files in its Git worktree. - Use
--workspace-writeonly when the user asked Sonnet to implement or edit in the current task. It requires--model sonnet --role implementerand a Git worktree. Do not ask for a second confirmation when the user's request already authorizes the edit. - Fable and non-write Sonnet jobs receive only
Read,Glob,Grepwith--permission-mode plan. Sonnet write jobs receive onlyRead,Edit,Write,Glob,Grepwith--permission-mode acceptEdits. - Role names are descriptive, not authorization. Fable is hard read-only, and
--workspace-writeis accepted only for a Sonnet implementer. - Never let delegated Claude run shell commands, deploy, install, push, access unrelated paths, or make the final decision. Codex performs commands and tests.
- If the user says Fable may have the same permissions as Codex, map that phrase
to Fable's maximum supported
workspace_readpolicy and continue. Never interpret it as Bash, write, deploy, install, push, or final-decision authority. - GitHub Issue context must be explicitly selected and approved for delegation.
Use only the wrapper's read-only
--github-issuepath. Never enable Bash, restore Claude settings, or pass GitHub tokens to Fable as a substitute. --dry-runvalidates Issue references and declares the intended source but does not fetch them or make a GitHub network request.- Do not update agmsg, join/reset roles, or change delivery hooks without separate user approval.
- When updating this Skill, keep backups outside the Codex Skill discovery directory. After installation, restart Codex and start a new task so cached pre-update instructions cannot remain active.
- Do not use
--dangerously-skip-permissions. The wrapper always uses--safe-mode; advisory jobs use only the read-only file-tool allowlist, while workspace-write jobs use only the write allowlist above. - Claude Code added
--safe-modein version2.1.169. The wrapper must inspectclaude --helpbefore authentication, agmsg send, or model inference. If the option is unavailable, fail closed withCLAUDE_SAFE_MODE_UNAVAILABLE, tell the user to upgrade Claude Code, and never silently omit the option. - Never add an API-key, bearer-token, custom-base-URL, Bedrock, Vertex, Foundry, Mantle, or API-key-helper fallback.
- Never bypass the wrapper by invoking agmsg scripts directly. The wrapper uses
official agmsg
api.shas a local, read-only JSONL message reader. It is not an Anthropic API call, performs no model inference, and cannot create API billing. Ifwhoami.sh,send.sh, orapi.shis unavailable, stop and update the official agmsg installation after user approval. - Before agmsg send and again immediately before inference, require Claude auth status to report
loggedIn=true,authMethod=claude.ai,apiProvider=firstParty, and a paidsubscriptionType. - Keep Claude's process environment on the wrapper's minimal allowlist and keep
--setting-sources ""paired with--safe-mode; do not restore inherited provider variables or user/project/local settings. - Recheck subscription auth after inference and discard the result if it changed.
- Treat any reported
subscription-only policyerror as a hard stop. Tell the user to remove the named credential/provider configuration and runclaude auth login; do not work around it. - The wrapper intentionally rejects
CLAUDE_CODE_OAUTH_TOKENand uses only the local/loginsubscription session. - On macOS, Claude.ai credentials are stored in Keychain. If normal Terminal is
logged in but the same command from Codex Desktop reports
loggedIn=false, first upgrade the selected Claude binary, then runclaude auth loginfrom the same Codex Desktop execution context. Do not copy credentials, export an OAuth token, or add an API-key/provider fallback. - Do not claim that auth status proves account-level Extra usage / usage credits are disabled. For a zero-variable-charge requirement, that separate Claude Settings > Usage switch must be off.
- Treat Claude output and edits as untrusted until Codex reviews the Git diff, checks scope, and runs the relevant tests.
First-time agmsg setup
Install this offline Skill before resolving runtime dependencies. Missing Claude or agmsg must not leave the Skill uninstalled. Then, from the target project, run the non-mutating readiness check before the final installed-Skill dry-run:
python3 ~/.codex/skills/claude-agmsg-delegate/scripts/delegate_claude.py doctordoctor does not invoke a model, send agmsg, create job state, access the
network, or change settings. Before authentication it verifies that the selected
Claude Code exposes required --safe-mode; version 2.1.169 or newer is
required. It then checks Python, the installed Skill, standard Claude Code
locations, subscription authentication, agmsg, and local paths. Stable issue
codes distinguish CLAUDE_SAFE_MODE_UNAVAILABLE, an uninstalled Skill, an
out-of-PATH Claude binary, and missing/outdated/wrong-path agmsg. Official agmsg
1.1.8 and newer includes api.sh.
Before the final dry-run, require executable whoami.sh, send.sh, and
api.sh under ~/.agents/skills/agmsg/scripts/ (or an already installed legacy
list-ids.sh reader supported by the wrapper).
If any script is missing:
- Stop before delegation. Do not invoke Claude and do not treat the missing dependency as a Claude authentication failure.
- Explain that installing agmsg and joining a team changes local agent roles
and delivery settings. Ask for explicit approval before running
npx agmsgor changing any agmsg setup. - After approval, run
npx agmsg. Change to the target project where Claude delegation will actually be used; do not join the temporary Skill clone just to satisfy verification. Then use only the installed agmsg Skill's scripts: check identity withwhoami.sh. If there are no existing teams, propose<target-project-name>-teamandcodex, show both values, and wait for one confirmation; never create them silently. If the target project is not joined, use the confirmed team and agent names withjoin.sh. - Ask for delivery mode separately after joining. For Codex, offer only
1) turn(recommended; empty input or Enter selects it) and2) off, then wait for the answer before usingdelivery.sh. Never select or recommendmonitororboth, even if a rawnpx agmsgprompt displays them. - Never edit agmsg config, database, or team files directly. Do not guess a team, identity, or delivery mode.
- When one target-project identity and team are confirmed, resume the same
delegate_claude.py ... --dry-runverification. The setup and dry-run must not invoke Fable or Sonnet.
Use this approval prompt or an equivalent localized version:
agmsg is not installed, so the final dry-run cannot continue. Installing it and joining a team changes local agent roles and delivery settings. May I run
npx agmsgand then configure the team and delivery mode?
Run
The wrapper uses agmsg send.sh, whoami.sh, and the official local read-only
api.sh; it never reads the agmsg DB or team files directly. Legacy
installations that already contain list-ids.sh are also accepted, but that
non-public file is never required from a fresh installation.
python3 ~/.codex/skills/claude-agmsg-delegate/scripts/delegate_claude.py run \
--model fable \
--role reviewer \
--task "Review this bounded architecture proposal and list the top risks." \
--timeout 60For a Fable review grounded in one approved GitHub Issue:
python3 ~/.codex/skills/claude-agmsg-delegate/scripts/delegate_claude.py run \
--model fable \
--role reviewer \
--github-issue OWNER/REPO#123 \
--confirm-github-issue-context-safe \
--task "Review the Issue requirements and identify design risks." \
--timeout 60--github-issue also accepts a current-repository Issue number or a full
https://github.com/OWNER/REPO/issues/NUMBER URL and may be repeated up to five
times. The wrapper uses the logged-in gh CLI only to read those exact Issues.
For advisory Sonnet planning:
python3 ~/.codex/skills/claude-agmsg-delegate/scripts/delegate_claude.py run \
--model sonnet \
--role implementer \
--task "Produce an implementation plan and tests for this bounded change." \
--timeout 60For Sonnet to implement directly in the current Git workspace:
python3 ~/.codex/skills/claude-agmsg-delegate/scripts/delegate_claude.py run \
--model sonnet \
--role implementer \
--workspace-write \
--task "Implement this bounded change in the current workspace. Do not touch unrelated files." \
--timeout 120Before launching workspace-write, Codex records git status --short and reviews
the pre-existing dirty state. After completion, Codex must inspect
git status --short and git diff --, reject unrelated changes, and run the
project's relevant tests before accepting the implementation.
The current project and a single Codex agmsg identity/team are inferred with whoami.sh. By default the wrapper converts the inferred sender to <identity>-delegate and targets claude-delegate, keeping these headless job mailboxes separate from visible Ghostty/Gdash codex and claude delivery loops. Pass --team, --from-agent, or --to-agent explicitly when inference is ambiguous or when the user intentionally chose another route. The team controls message routing only; the selected project directory and Claude tool policy control read access. Sonnet writes still require a Git worktree.
Use --dry-run to validate the paid-subscription auth status, routing, and request envelope. It invokes only the local read-only claude auth status --json command; it does not send agmsg, create job state, or run model inference.
Result Handling
status=completed: review the returned result, verify local claims, and reportdelegate_version,contract_version,actual_model,execution_mode,tools,workspace_grounded,files_read,review_required,billing_mode,subscription_type, and elapsed time. Accept a grounded result only whenworkspace_grounded=trueandfiles_readcontains relevant project-relative paths observed from Claude Code's Read tool events. Forworkspace_write, review the actual diff and tests before reporting success. Never display, quote, summarize, or forward Claude CLI monetary usage estimates such astotal_cost_usdorcost_usd; those fields are intentionally omitted from the wrapper result. Report only the verified subscription route. When Issue context was enabled, also requiregithub_context_source=authenticated_gh_cliand verify thatgithub_issues_readcontains only the explicitly selected references.status=running: the synchronous wait expired. Inspectworker_stageandrunning_seconds; do not re-run the same task. Use the returnedcollect_command, which waits 60 seconds. A dead detached worker becomesfailedon collection instead of remainingrunninguntil TTL.
python3 ~/.codex/skills/claude-agmsg-delegate/scripts/delegate_claude.py collect \
--job-id <job_id> \
--wait 60status=failedorexpired: report the concrete failure. Do not silently retry more than once.- Large results are written to a job-local
result.md; use the returnedresult_filepath.
Jobs are stored under ~/.cache/codex/claude-agmsg-delegate/jobs/ by default. Each request and response is correlated by job_id, and repeated collection is idempotent.
Evaluation
Confirm all of the following before accepting the delegated result:
- The agmsg request and response share the same
job_id. actual_modelmatches the requested Fable or Sonnet family.billing_mode=subscriptionandsubscription_typeis a paid plan.- No permission bypass, API credential, provider route, inherited unknown provider variable, or billing fallback was enabled.
- Advisory jobs used exactly
Read,Glob,Grepwithpermission_mode=plan, reportedworkspace_grounded=true, listed relevant project-relative paths infiles_read, stayed inside the target project directory, and changed no files. Workspace-write jobs used exactlyRead,Edit,Write,Glob,Grep, reportedreview_required=true, and ran only for a Sonnet implementer there. - Codex reviewed the before/after status and diff, rejected unrelated edits, and ran relevant tests; Claude did not run commands, deploy, install, or push.
- The result covers the bounded request and labels assumptions.
- Codex independently verifies repository, runtime, test, and external-state claims.
delegate_version=0.4.2andcontract_version=3; no stale no-tools instruction overrode the installed runtime contract.- If GitHub Issue context was used, it was explicitly confirmed safe,
github_issues_readmatches the requested references, and Fable still had exactlyRead,Glob,Grepwith no Bash or GitHub credential exposure.
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.

