Maintain and troubleshoot Codex setup
For first use, follow Connect Codex through configuration, registration, and recognition. Use this page to inspect an existing registration, repair missing owned files, or remove this module.
Installation versus registration
Package installation provides commands. setup registers user-level MCP and installs the recognition Skill in host mode. Complete global installation first. The configuration must be an existing trusted absolute .js/.mjs path. It is Node.js code whose initialization runs at startup. Use an ESM project for .js; compile TypeScript configuration to ESM .js.
Preview first, then register when appropriate. Quote Windows paths containing spaces. Reload the client after setup. Visible tools prove registration; recognition still needs prepare/accept.
Inspect, repair, and remove
INTENT_RUNTIME_HOME is an explicit absolute state directory, defaulting to the user's .intent-runtime. CODEX_HOME/config.toml defaults to .codex/config.toml. The Skill is installed at .agents/skills/<name>/SKILL.md. These local paths cannot be replaced through MCP arguments.
setup is idempotent and edits only its registration table. doctor is read-only by default, lists real stdio tools, and does not call a model. repair restores only missing content with a retained ownership record. User edits, another tool's name, unknown symlinks, or unsafe TOML layouts trigger protection conflicts. clean does not delete business configuration, environment variables, or other tools.
Reports always contain command/status/changed/checks/paths/warnings. status is ok/planned/conflict/failed; changed reflects actual writes only. Exit codes: 0 success/plan; 1 operation/startup failure; 2 invalid arguments/configuration; 3 protection conflict or unhealthy diagnostics. Transactions commit per file and roll back only content still owned by this write. Concurrent user edits are preserved. Interrupted recovery does not use expiry or forced overwrites.
Update and register again
For an existing setup registration, run npm install -g @devcodex/intent-runtime, then run setup with the original configuration path and the same --name to refresh the unmodified Skill managed by this module. Reload the client or start a new CLI session. This step is needed when tool names or Skill content change: doctor --repair restores missing items from the ownership record and does not replace setup for Skill updates. User edits remain protected and are never forcibly overwritten. Updates do not download business configuration. clean removes this module's owned registration/Skill without deleting configuration, business data, or other tools.
Common symptoms
CLI exit codes
0 means success/dry-run plan; 1 operation/startup failure; 2 invalid arguments/configuration; 3 ownership conflict or unhealthy diagnostics. The --json report describes maintenance, not an IntentResult or proof of completed model recognition.