update — OpenAI Codex CLI¶
Check and refresh Polytropos harness installs and generated mirrors with the repository's updater. Use for install freshness, bundle drift, or an explicitly requested refresh; checking is read-only and always comes first.
- Source: codex/skills/update/SKILL.md
- Also available on: Claude Code
In practice¶
What it does¶
After a pull or a merge, tells you whether what is installed still matches the repository: harness installs, bundle files, and generated mirrors, on one card. Checking only reads. Refreshing is a separate step that runs only when you ask for it in the current conversation.
When to reach for it¶
- Use it after pulling or merging changes into a Polytropos checkout.
- Use it when a skill or prompt behaves like an older version of itself.
- Not as permission to write: a freshness question is not authorization, and when the intent is unclear the skill shows the dry run instead.
Worked example¶
python3 "$POLYTROPOS_ROOT/bin/harness_update.py" check --repo-root "$POLYTROPOS_ROOT"
python3 "$POLYTROPOS_ROOT/bin/harness_update.py" apply --repo-root "$POLYTROPOS_ROOT" --dry-run
The first line always runs first. Exit 3 means drift was found, not that the checker crashed. Read the card's vocabulary literally:
| On the card | Read it as |
|---|---|
| “not installed” | absence, not a failure |
unmanaged |
a warning |
conflict, managed-update |
actionable Codex drift |
not applicable here (install source) |
not drift: project agents belong in the checkout where Codex works |
Failure modes & fallbacks¶
applyreportserror. Stop and report it; a writer is never retried blindly.- A differing
AGENTS.mdor skill directory. Those destinations are no-clobber: the copy is reported asskip-differsand preserved, and it needs your own decision. - Project agents or the modern plugin look stale. They are outside this updater's apply scope; use the repository's Codex installer workflow when you want those surfaces refreshed.
- A stale Claude plugin cache. The updater never writes
~/.claude. It may print a remedy, which runs only after separate explicit approval.
Cost & safety¶
check and --dry-run write nothing and dispatch no model. A real apply may overwrite
Copilot bundle-owned files and Codex generated compatibility prompts, listing the ones that
differed; unknown files stay untouched. Pricing values and documentation snapshot tables are
never refreshed by this engine. The JSON modes and the human apply card can contain absolute
home paths, so scrub local paths before sharing output.
Related¶
- doctor gives the per-component detail behind the Codex section of the card.
- setup configures the native status line, which this updater does not touch.
- Deep dive: Codex harness covers what loads where and the ownership rules that keep your edits.
The skill card — what the model reads¶
This is the SKILL.md body the model reads, transformed for this page: the source's own leading title, if it had one, is removed; every remaining heading is demoted one level to nest under this section; and relative links are rewritten to site or GitHub URLs. ${CLAUDE_PLUGIN_ROOT} and {{POLYTROPOS_ROOT}} are install-time path variables, left intact exactly as the model sees them. The unmodified original is codex/skills/update/SKILL.md.
Resolve POLYTROPOS_ROOT from this skill's location. In a managed copy use POLYTROPOS_ROOT="{{POLYTROPOS_ROOT}}"; reject the literal placeholder. Confirm $POLYTROPOS_ROOT/bin/harness_update.py exists before running it.
Always begin with the read-only check and report its card:
python3 "$POLYTROPOS_ROOT/bin/harness_update.py" check --repo-root "$POLYTROPOS_ROOT"
Exit 3 means drift was found, not that the checker crashed. “not installed” is absence, unmanaged is a warning, and Codex conflict or managed-update entries are actionable drift.
Project agents reported not applicable here (install source) are not drift: the root is the checkout the Claude marketplace installs from, which never carries .codex/agents/. They belong in the checkout where Codex works; never install them into the install source.
Write boundary¶
Run apply only when the user explicitly requested a refresh in the current conversation. A freshness question is not authorization to write. If intent is unclear, show the dry-run instead:
python3 "$POLYTROPOS_ROOT/bin/harness_update.py" apply --repo-root "$POLYTROPOS_ROOT" --dry-run
After explicit authorization, run:
python3 "$POLYTROPOS_ROOT/bin/harness_update.py" apply --repo-root "$POLYTROPOS_ROOT"
Stop and report an error result; do not retry a writer blindly.
Interpret apply accurately¶
- Copilot bundle-owned files may be overwritten; unknown files remain untouched. A
preservedentry is intentional and needs a separate user decision. - Codex generated compatibility prompts may be overwritten and are listed when they differ. User-editable
AGENTS.mdand skill destinations are no-clobber: differing copies are reported asskip-differsand preserved. - Project
.codex/agents/*.tomlfiles and the modern Codex plugin are outside this updater's apply scope. Use the repository's Codex installer workflow separately when the user requests those surfaces. - Generated repository mirrors are refreshed by their existing sync tools. Pricing values and documentation snapshot tables still require the repository's documented human refresh procedure.
- The updater never writes
~/.claude. It may print a conditional stale-cache remedy; run that remedy only after separate explicit approval.
The check and apply JSON modes have different shapes, and JSON plus the human apply card can contain absolute home paths. Scrub local paths before sharing output outside the machine.
Finish with what was observed, what changed, any preserved/conflicting paths described without leaking the home directory, and remaining limitations.