codex-mirror

codex-mirror is a skill for Claude Code from tonydzi/second-brain-starter-kit. It costs 87 tokens per session (1,810 once invoked), scanned A, original, MIT.

A maintenance tool for keeping Codex’s rule mirror in sync with the main CLAUDE.md instructions. It compares versions and rebuilds the shared AGENTS.md copy when the rules change.

In plain words
What is it for?
Use it to check, back up, stamp, publish, and test the Codex instruction mirror after changing CLAUDE.md.
Why use it?
It prevents Codex from following outdated instructions after a rules update. Automated checks also catch missing version marks, structural parts, or an oversized file.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: mentions CLAUDE.md; reads ~/.codex paths; runs codex exec.

Part of the second-brain-skills plugin — 249 skills, 3 agents, 1 plugin shipped together

Good fit Use it to check, back up, stamp, publish, and test the Codex instruction mirror after changing CLAUDE.md.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/tonydzi/second-brain-starter-kit/codex-mirror
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add tonydzi/second-brain-starter-kit --skill codex-mirror
Clone the repo
git clone --depth 1 https://github.com/tonydzi/second-brain-starter-kit

Made for: Claude Code.

Or install second-brain-skills, the plugin that ships this one along with the rest of its 249 skills, 3 agents, 1 plugin.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for codex-mirror

README.md
[![agentmods](https://agentmods.dev/badge/skills/tonydzi/second-brain-starter-kit/codex-mirror/github.svg)](https://agentmods.dev/skills/tonydzi/second-brain-starter-kit/codex-mirror)
Your own site
<a href="https://agentmods.dev/skills/tonydzi/second-brain-starter-kit/codex-mirror"><img src="https://agentmods.dev/badge/skills/tonydzi/second-brain-starter-kit/codex-mirror/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for codex-mirror

Your own site · 80×15
<a href="https://agentmods.dev/skills/tonydzi/second-brain-starter-kit/codex-mirror"><img src="https://agentmods.dev/badge/skills/tonydzi/second-brain-starter-kit/codex-mirror.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 87 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,810 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00087 $0.01810
Opus 5.5 $0.00035 $0.00724
Sonnet 5.5 $0.00017 $0.00362
Haiku 4.5 $0.00009 $0.00181

Measured 21d ago against content hash 3a59a0622c8e, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

codex-mirror scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 21d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/codex-mirror/SKILL.md · 79 lines

How it starts

The opening of the file, as written. The whole thing — 79 lines — stays where its author put it; the contents beside it link to each section on GitHub.

codex-mirror — the shared-canon mirror for Codex

The pain (found 2026-07-25): CLAUDE.md went through a v2 revision on 07-22, while ~/.codex/AGENTS.md quietly stayed on its June version — Codex worked off stale rules for a month, and the drift checker of that era was blind to the very same revision. The cure: the mirror is version-based (we compare versions, not shape), a watchdog shouts at night, and this skill is the cheap "rebuild" button so that the shouting doesn't turn into evening manual labour.

Roles (AK-47): the script moves the bytes and checks everything; I only write the text of the new rules. Do not retype the file by hand and do not eyeball the byte count.

Engine: python %USERPROFILE%\.claude\scripts\codex_mirror.py <check|backup|stamp|publish|selftest>

Step 0 — RECALL + the frame

  • Memory: [[canon-versioning-and-drift-watchdog]] (the class "the watchdog died silently together with the thing it watched"), [[codex-cli-install]], [[any-llm-vault-actor]], [[claude-md-compression-contract]].
  • The mirror = a canon edit → only the owner's machine in a live session; followers are receive-only ([[machine-governance-leader-follower]]).
  • The 32 KiB cap is hard (DR 06-29: "lost in the middle" — a bloated file is WORSE than an empty one). The mirror = a distillation + pointers, NOT a copy of CLAUDE.md.

Step 1 — What exactly is stale

python %USERPROFILE%\.claude\scripts\codex_mirror.py check

Prints both versions, the headroom left before the cap and the delta from CLAUDE.CHANGELOG.md — exactly the entries that appeared after the mirror's version. That is the work list; you don't need to read all of CLAUDE.md.

  • VERDICT: OK → leave, nothing to do.
  • PATCH lag only → green by design; write it in only if the micro-edit changes BEHAVIOUR (thresholds, gates), not wording.
  • REBUILD → carry on.

Step 2 — The safety net

python %USERPROFILE%\.claude\scripts\codex_mirror.py backup

Snapshot into ~/.codex/_backup/AGENTS.md.pre-<version>-<date-time>. Rollback = copy it back.

Read the full file on GitHub · 79 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 21d ago Changed 3a59a0622c8e
  2. 1mo ago Changed · -1 lines 57167c39cbe6
  3. 1mo ago Changed · +14 lines · -52 tokens per session scan B → A 16785c521100
  4. 1mo ago Changed · -16 lines · +52 tokens per session scan A → B 6b5993588cbb
  5. 2mo ago Changed · +1 lines · -24 tokens per session f4cd8ad6acbf
  6. 2mo ago First seen · 81 lines · 111 tokens per session scan A 899b85e5c4d8

Subscribe to this mod's changes

codex-mirror is a skill published in the GitHub repository tonydzi/second-brain-starter-kit (15 stars, last pushed yesterday), licensed MIT. It adds 87 tokens to every session and 1,810 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

codex-mirror compared with skills from other repositories

codex-mirror next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
codex-mirrortonydzi/second-brain-starter-kitSkill15yesterdayMITA87Claude Code
wikiAgriciDaniel/claude-obsidianSkill16k17d agoMITA84Claude Code
defuddleAgriciDaniel/claude-obsidianSkill16k17d agoMITA61Claude Code
wiki-foldAgriciDaniel/claude-obsidianSkill16k17d agoMITA76Claude Code
wiki-modeAgriciDaniel/claude-obsidianSkill16k17d agoMITA83Claude Code
superbrain-distillm3talux/superbrainSkill433mo agoMITA36Claude Code
fabsolAiAi-Mastermind/aiai-mastermind-tools-and-skillsSkill227d agoMITA69Claude Code