English | 한국어 | 中文
codexclaw
Development discipline and multi-model subagents for OpenAI Codex,
packaged as a single plugin.
Workflow inspiration: OMO / oh-my-openagent. Some components are adapted from historical MIT-licensed LazyCodex/OMO; credits, pinned sources and modifications. CodexClaw is a separate, unofficial project.
codexclaw turns the Codex runtime into a disciplined development environment. It does not ship its own agent harness — it layers skills, hooks, and components directly on codex, adding structured workflows, coding discipline, and multi-model orchestration that the base runtime doesn't provide.
Features
Dev Skill Family — 12 surface-specific routers (dev-architecture, dev-backend, dev-design, dev-testing, dev-security, dev-debugging, dev-data, dev-devops, dev-code-reviewer, dev-scaffolding, dev-visualizer, dev-design) governed by a canonical parent (dev). Every router inherits the parent's rule classes, verification gate, and safety rules. 155 unique rule IDs across the family.
PABCD Workflow — Plan / Audit / Build / Check / Done, implemented as a file-backed FSM with attestation-gated transitions. Phases advance through cxc orchestrate commands; each transition carries structured evidence. A durable goalplan ledger tracks work phases, success criteria, and captured proof across multiple cycles.
IDLE ── P ── A ── B ── C ── D ── IDLE
│ │ │
gate gate gate
└────┴────┴──── I (Interview, context preserved)
Multi-Model Subagents — role-based dispatch (explorer / reviewer / executor / architect) with per-role model and prompt overrides. Configuration persists across sessions and applies automatically through the spawn-wrapper hook. A local GUI (Vite + React) provides visual config and, when opencodex is detected, a provider link bar. (Dashboard: build from a repo checkout for now; bundled in a follow-up release.)
Architect proposes design and checks main's plan for alignment in each formal P plan; main owns the executable plan and decisions, and the independent reviewer retains A audit. It reuses one context per plan and rechecks only recorded design-decision changes. This is agent-followed guidance, not runtime enforcement. See the planning lifecycle.
Architect follows the live spawn schema. When native agent_type: "architect" is exposed, use it. On V1 without an agent_type field, use CXC-ROLE: architect in the supported message or text item, attach dev and dev-architecture, and state the read-only task constraints. This logical role needs no exception approval or registration; it does not claim a native read-only sandbox. A typed schema missing architect still needs authorized cxc subagents register architect, a fresh session and a live-schema check, without aliasing explorer/reviewer. Registration is never performed by dispatch. Design consultation and independent audit remain separate.
Subagent settings resolve per role: project → global → original session. Open Global Settings to edit user defaults in $CODEXCLAW_HOME/subagents.json (default ~/.codexclaw/subagents.json). The existing Subagents page edits <project>/.codexclaw/subagents.json: each model dropdown offers Main model, Global settings, and individual models. Global settings follows the entire role's defaults, including effort and prompt; choose a main/direct model to customize that project role. Existing explicit project entries and effort: null retain their meaning. Main model changes only the model source; session effort separately inherits the original session's effort.
The shared catalog reads OCX's enabled models with the non-mutating ocx models live --json, refreshes after a short cache lifetime, and supports Refresh models. Disabled or pending models are excluded. If OCX is absent it reads the configured Codex catalog (model_catalog_json, with CODEX_MODELS_CACHE_PATH override). An unavailable source yields an explicit error or labeled last-known list, never a fabricated four-model roster. The dashboard restricts effort choices to the model's advertised supported values; CLI/MCP validation still validates wire values only, not model-specific compatibility.
CLI list/get/set/reset accept trailing --global. MCP subagents_get/subagents_set and GET /api/subagents?scope=global / POST scope: "global" share the same store. inherit: true removes the selected scope's entire role override; effort: null only clears effort. The former unpublished $CODEX_HOME/codexclaw/subagents.json path is read only if the canonical file is absent and CODEXCLAW_HOME is not explicitly set. The first explicit global edit/reset preserves its other roles in the canonical file and leaves the old file untouched.
Recall — searches past Codex conversations and the memory store from disk artifacts before asking the user, so context survives session boundaries and compaction.
Repo Map — cxc map <dir> runs tree-sitter parsing + PageRank ranking to produce a structure overview of unfamiliar code, letting the agent orient before deep rg dives. (Repo checkout only — requires the vendored Python toolchain.)
Skill Search — cxc skill search <query> discovers dormant skills across cli-jaw-skills (primary), ClawHub, and Hermes catalogs. cxc skill show <id> loads them on demand.
Install
2 lines to install. No build step, no npm install, no config edits.
codex plugin marketplace add https://github.com/lidge-jun/codexclaw
codex plugin add codexclaw@codexclaw
Then restart Codex and approve the 31 hooks when prompted (upgrades ask again — content-hash trust). Everything runs from chat, and the terminal surface ships too — the payload includes its own cxc dispatcher, so agent-driven cxc orchestrate commands work on every install:
orchestrate status — check the PABCD state machine
- "Interview me first, then draft a diff-level plan."
- "Plan this with codexclaw PABCD and use multi-model subagents."
Agent-created thread approvals (optional)
Some Codex Desktop agent-created threads start with approval prompts even when your top-level Codex config requests approval_policy = "never" and sandbox_mode = "danger-full-access". Codexclaw warns in those threads. To let its trusted PermissionRequest hook answer pending approvals, including one-time network-access requests, add this JSON boolean to $CODEXCLAW_HOME/config.json (default ~/.codexclaw/config.json):
{"permissions":{"agentCreatedThreadAutoAllow":true}}
Preserve any other keys already in that file. The setting is off when absent and cannot be enabled by a project-local file. It applies only when the rollout identifies an agent-created root thread in the default approval mode and the user Codex config has both explicit top-level full-access values. It does not change the thread's sandbox or guarantee network or filesystem access; other hooks can still deny a request. New or changed hooks need Codex trust approval before they run.
Where codexclaw keeps plans and ledgers (optional)
In repositories whose origin owner is not on your allowlist, codexclaw keeps its plan units, ledgers, goalplans and evidence outside the checkout, in ~/.codexclaw/projects/<host__owner__repo-hash>/, so nothing codexclaw-related becomes committable there and the record survives worktree removal. cxc state path shows the mode and directories for the current checkout and cxc devlog path prints where plan units go. Set the allowlist, a different root, or a per-repository mode in $CODEXCLAW_HOME/config.json:
{"state":{"ownerAllowlist":["your-github-user"],"root":"/abs/path/private-state","projects":{"github.com/acme/app":"external"}}}
CODEXCLAW_STATE_MODE (repo, local, external, none) and CODEXCLAW_STATE_ROOT override it. If the root is a private git repository, cxc state sync pulls, commits and pushes it without forcing. A repository that forbids committing plans can keep only its plans outside the checkout with CODEXCLAW_PLANS_DIR or state.plansDir (absolute); plan edits there still satisfy the B>C source check. Details: structure/80_state_layout.md.
To move an existing enterprise checkout's in-repo state (devlog/ and the durable part of .codexclaw/) out of the repository, close any running PABCD cycle to IDLE, then from the checkout:
cxc state path # expect "mode: external" and the target directories
cxc state migrate # dry run: lists every move, union-merge, conflict and skip
cxc state migrate --apply # moves; conflicts keep both copies, tracked files stay put
If the checkout resolves to repo mode, run the migrate commands with CODEXCLAW_STATE_MODE=external in front, or set state.projects["github.com/<owner>/<repo>"] to "external" first.
Update / uninstall / optional CLI
codex plugin marketplace upgrade codexclaw # update
codex plugin remove codexclaw@codexclaw # uninstall
After an upgrade Codex marks the hooks Modified — re-approve them to reactivate.
Upgrading to 0.1.1+ also delivers the payload CLI (bin/cxc.mjs); existing installs must upgrade (or re-add) to receive new top-level directories.
Then open a new thread: skills, hooks and the CLI load when a session starts. cxc --version prints the running build. Skills can come from a newer machine than the installed hooks (a GOAT thread started elsewhere), so a skill may name a verb the installed CLI lacks: cxc loop pr-record needs 0.2.43+, and a 0.2.42 completion gate ignores the records it writes. Upgrade that host; builds after 0.2.43 name their version and this command when they meet a verb or record newer than themselves.
The CLI has two tiers. Every install ships the payload dispatcher — no PATH setup needed; when cxc isn't on PATH, the session-start banner prints this exact invocation:
node "<plugin-root>/bin/cxc.mjs" orchestrate status --session <id>
A PATH-level cxc is an optional convenience from a repository checkout (also unlocks cxc map and cxc gui):
git clone https://github.com/lidge-jun/codexclaw
alias cxc='node /path/to/codexclaw/bin/codexclaw.mjs' # or: npm link
Development install (dogfooding)
To change codexclaw while running it inside Codex, install your working checkout as a real
plugin copy from a local marketplace rooted at the repo:
scripts/dev-install.sh
That is the whole setup. The script points the codexclaw marketplace at your checkout itself,
including when a published git marketplace already holds that name — adding it by hand would fail
with marketplace 'codexclaw' is already added from a different source.
A git-source marketplace pins a commit, so a checkout under active development has to use the
local source — otherwise Codex keeps loading the pinned snapshot no matter what you edit.
Why not symlinks
An earlier scripts/dev-symlink.sh replaced each child of the plugin cache version directory with a
symlink into the repo, so edits were live with no reinstall. Codex does not resolve those
symlinked entries reliably and the plugin can silently fail to load, so that track is retired.
When dev-install.sh finds any symlink left in the plugin cache it clears the whole cache
directory and reinstalls from scratch.
What the install actually does
codex plugin add codexclaw@codexclaw copies the payload into
~/.codex/plugins/cache/codexclaw/codexclaw/<version>/ and prunes files that no longer exist in
the source. A same-version reinstall is therefore a true resync rather than a no-op, which is why
re-running the script is the whole update loop and the manifest version never needs bumping.
| Command |
Effect |
scripts/dev-install.sh |
build components, repoint the marketplace if it drifted, clear stale symlinks, reinstall, prune old version dirs, run doctor |
scripts/dev-install.sh --no-build |
the same without npm run build, for skill, hook or docs-only edits |
scripts/dev-install.sh --status |
report source, manifest version, marketplace root, cache roots and symlink count; change nothing |
The update loop
Edit -> scripts/dev-install.sh -> open a new Codex thread. Skills, hooks and MCP tools are read
when a session starts, so the thread you are in does not pick up the change.
Hook trust is hashed over the hook declaration — the event, matcher, command, timeout, async
flag and status message — not over the files a hook runs. Editing a matcher or command in
hooks/*.json breaks trust and Codex marks that hook Modified until you re-approve it, while
rebuilding the component dist/ a hook invokes changes many bytes and keeps its trust.
cxc doctor's hook-trust line tells you which case you are in. codexclaw never writes trust
state itself.
Verifying the install