You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since #1119, the generated CODEV HOT CONTEXT block (written by codev init / codev update into both root docs) replaced the inlined contents of arch-critical.md / lessons-critical.md with two Claude Code @import lines:
renderHotContextBlock() in packages/codev/src/lib/managed-block.ts renders one block and syncHotContextBlock() writes it to both ROOT_DOCS (CLAUDE.md and AGENTS.md, deliberately byte-identical).
For CLAUDE.md this is an improvement: Claude Code expands @import at session launch, the hot files stay the single source of truth, no copy to drift (exactly #1119's rationale).
For AGENTS.md it is a regression for most non-Claude consumers: the agents.md standard defines no import mechanism ("just standard Markdown"; import support is open request agentsmd/agents.md#11), so @-expansion is a per-tool extension. Verified consumer matrix (2026-07-19, methods in the comments below):
@file refs documented only for .cursor/rules/*.mdc
Copilot coding agent / VS Code
undocumented
no expansion claim in docs
Sharpest consequence: consult's own non-Claude lanes (codex and agy) are empirically confirmed to lose the hot tier. Every CMAP review run in an updated project has its codex and gemini lenses reasoning without the always-on facts and lessons. This is self-inflicted on our consultation stack, not just a third-party-adopter concern. Also observed in an adopting project after its latest codev update: ~65 lines of inlined hot content in AGENTS.md replaced by the two literal import lines.
Porch phase prompts are unaffected (they consume the hot files at runtime via readHotTierFiles()).
Why per-tool native reference mechanisms are NOT a substitute
Several tools do offer their own way to pull extra files into always-on context, so "reference instead of inline" was evaluated per tool:
.cursor/rules/*.mdc with alwaysApply: true + @file refs
yes
Copilot CLI
@relative/path in AGENTS.md itself
already works today
Copilot VS Code
.github/copilot-instructions.md / *.instructions.md (docs: file refs NOT expanded in .instructions.md)
only by inlining there too
Codex
effectively none for this case: repo-level .codex/config.toml exists (trusted projects), but project_doc_fallback_filenames is consulted only when AGENTS.md is ABSENT at that directory level — it cannot add files alongside an existing AGENTS.md; and discovery is a root→cwd directory walk, so codev/resources/*.md is never on the path. Content must physically be in AGENTS.md (or AGENTS.override.md)
no
Antigravity (agy)
GEMINI.md override file; no documented import/include mechanism
no
Two conclusions:
The per-tool route still doesn't reach codex or agy — the two consult lanes, the empirically confirmed losers. For them the content has to be in AGENTS.md itself, which forces inlining regardless of what else is done.
It's an N×format maintenance matrix: each tool has its own config file, syntax, and clobber semantics, and adopters may already own those files (codev would be merging into opencode.json / .cursor/rules/ it didn't create). One regenerated Markdown block has zero per-tool knowledge and covers every present and future consumer.
A later polish issue could add native wiring for OpenCode/Cursor to slim AGENTS.md, but it would be additive, not a substitute.
Suggested fix
Render the block per consumer at generation time:
CLAUDE.md: keep the @import lines (zero-drift, expanded at launch).
Side effects of inlining on the edit workflow (in scope, not afterthoughts)
Inlining moves a sync burden onto whoever edits the hot files (architects in MAINTAIN cycles, builders routing lessons at review time). Consequences the implementation must address:
A regeneration step enters the hot-file edit loop. Only codev init/update calls syncHotContextBlock() today, and there is no lightweight command that refreshes just the block (codev update does far more). Ship a small regeneration affordance (e.g. a codev subcommand that re-syncs the root docs' managed block) and wire it into the places that edit hot files: the update-arch-docs skill, the MAINTAIN protocol, and review-phase prompts.
Builder PRs gain a second file to stage. A lesson-routing PR must touch the hot file AND the regenerated AGENTS.md. With explicit staging (no git add -A), forgetting the second file is easy; the symptom is a surprise AGENTS.md working-tree diff at the next codev update (exactly the confusion that produced this report).
Duplicated merge-conflict surface. Two concurrent builders adding lessons currently conflict only inside the small hot file. Inlined, they also both rewrite the same generated block, and conflicts in generated content are the worst kind (correct resolution is "regenerate", which git cannot express).
Freshness needs enforcement. In this repo: extend governance-sweep.test.ts to assert AGENTS.md's block equals renderHotContextBlock()'s current output, so a PR that edits hot files without regenerating fails CI. In adopter repos: Surface codev doctor results (incl. scaffold drift) in the VS Code extension #1207's doctor drift check (block-vs-hot-files is a local byte-compare, no version info needed).
Unaffected either way: porch phase prompts (runtime injection via readHotTierFiles()), and CLAUDE.md under option 1 (session-launch expansion spares the majority harness all four costs).
Impact on non-Claude users under option 1
Non-Claude consumers become strictly better than today but freshness-second-class unless regeneration is enforced:
The gap: Claude sessions expand @import at launch (always current); non-Claude sessions read the inlined block (current as of last regeneration). If regeneration lags, agents on the same repo diverge: the Claude lane knows a newly added invariant, the codex/agy lanes don't. In a 3-way CMAP this means reviewers disagreeing because they hold different governance snapshots, not different perspectives; in mixed human teams, a Cursor user's agent can violate an invariant a Claude user's agent already respects — the exact failure class the hot tier exists to prevent.
With the enforcement above (regeneration wired into the edit loop + CI freshness check), the staleness window collapses from release cadence to the life of the editing PR — effectively zero for everyone consuming main. The workflow burden in the previous section is the price of making non-Claude consumers first-class rather than absent.
Design tension to resolve (the actual decision)
The hot-tier invariant (in arch-critical.md, echoed in managed-block.ts's ROOT_DOCS comment) says CLAUDE.md and AGENTS.md MUST stay byte-identical. Per-consumer rendering breaks byte-identity. Options:
Amend the invariant to: identical outside the managed block; the generated hot-context block is rendered per-ecosystem (import for Claude, inline for the standard). Recommended: the invariant's intent is equal capability across tool ecosystems, and the current byte-identity literalism is what produced unequal capability. Per-consumer rendering from a single source still delivers semantically identical content to both files.
Whichever lands, the equality test in governance-sweep.test.ts and any byte-compare between the two docs needs updating to compare content outside the managed block (option 1) or is unchanged (option 2).
Bug
Since #1119, the generated CODEV HOT CONTEXT block (written by
codev init/codev updateinto both root docs) replaced the inlined contents ofarch-critical.md/lessons-critical.mdwith two Claude Code@importlines:renderHotContextBlock()inpackages/codev/src/lib/managed-block.tsrenders one block andsyncHotContextBlock()writes it to bothROOT_DOCS(CLAUDE.mdandAGENTS.md, deliberately byte-identical).For CLAUDE.md this is an improvement: Claude Code expands
@importat session launch, the hot files stay the single source of truth, no copy to drift (exactly #1119's rationale).For AGENTS.md it is a regression for most non-Claude consumers: the agents.md standard defines no import mechanism ("just standard Markdown"; import support is open request agentsmd/agents.md#11), so @-expansion is a per-tool extension. Verified consumer matrix (2026-07-19, methods in the comments below):
.cursor/rules/*.mdcSharpest consequence: consult's own non-Claude lanes (codex and agy) are empirically confirmed to lose the hot tier. Every CMAP review run in an updated project has its codex and gemini lenses reasoning without the always-on facts and lessons. This is self-inflicted on our consultation stack, not just a third-party-adopter concern. Also observed in an adopting project after its latest
codev update: ~65 lines of inlined hot content in AGENTS.md replaced by the two literal import lines.Porch phase prompts are unaffected (they consume the hot files at runtime via
readHotTierFiles()).Why per-tool native reference mechanisms are NOT a substitute
Several tools do offer their own way to pull extra files into always-on context, so "reference instead of inline" was evaluated per tool:
opencode.json→instructionsarray (repo-committed, glob-capable).cursor/rules/*.mdcwithalwaysApply: true+@filerefs@relative/pathin AGENTS.md itself.github/copilot-instructions.md/*.instructions.md(docs: file refs NOT expanded in.instructions.md).codex/config.tomlexists (trusted projects), butproject_doc_fallback_filenamesis consulted only when AGENTS.md is ABSENT at that directory level — it cannot add files alongside an existing AGENTS.md; and discovery is a root→cwd directory walk, socodev/resources/*.mdis never on the path. Content must physically be in AGENTS.md (orAGENTS.override.md)Two conclusions:
opencode.json/.cursor/rules/it didn't create). One regenerated Markdown block has zero per-tool knowledge and covers every present and future consumer.A later polish issue could add native wiring for OpenCode/Cursor to slim AGENTS.md, but it would be additive, not a substitute.
Suggested fix
Render the block per consumer at generation time:
@importlines (zero-drift, expanded at launch).codev update, so drift is bounded by update cadence, and Surface codev doctor results (incl. scaffold drift) in the VS Code extension #1207 (doctor drift surfacing) further shrinks that window.Side effects of inlining on the edit workflow (in scope, not afterthoughts)
Inlining moves a sync burden onto whoever edits the hot files (architects in MAINTAIN cycles, builders routing lessons at review time). Consequences the implementation must address:
codev init/updatecallssyncHotContextBlock()today, and there is no lightweight command that refreshes just the block (codev updatedoes far more). Ship a small regeneration affordance (e.g. acodevsubcommand that re-syncs the root docs' managed block) and wire it into the places that edit hot files: the update-arch-docs skill, the MAINTAIN protocol, and review-phase prompts.git add -A), forgetting the second file is easy; the symptom is a surprise AGENTS.md working-tree diff at the nextcodev update(exactly the confusion that produced this report).governance-sweep.test.tsto assert AGENTS.md's block equalsrenderHotContextBlock()'s current output, so a PR that edits hot files without regenerating fails CI. In adopter repos: Surface codev doctor results (incl. scaffold drift) in the VS Code extension #1207's doctor drift check (block-vs-hot-files is a local byte-compare, no version info needed).Unaffected either way: porch phase prompts (runtime injection via
readHotTierFiles()), and CLAUDE.md under option 1 (session-launch expansion spares the majority harness all four costs).Impact on non-Claude users under option 1
Non-Claude consumers become strictly better than today but freshness-second-class unless regeneration is enforced:
@importat launch (always current); non-Claude sessions read the inlined block (current as of last regeneration). If regeneration lags, agents on the same repo diverge: the Claude lane knows a newly added invariant, the codex/agy lanes don't. In a 3-way CMAP this means reviewers disagreeing because they hold different governance snapshots, not different perspectives; in mixed human teams, a Cursor user's agent can violate an invariant a Claude user's agent already respects — the exact failure class the hot tier exists to prevent.Design tension to resolve (the actual decision)
The hot-tier invariant (in
arch-critical.md, echoed inmanaged-block.ts'sROOT_DOCScomment) says CLAUDE.md and AGENTS.md MUST stay byte-identical. Per-consumer rendering breaks byte-identity. Options:codev update(package-upgrade cadence). Inline-both makes staleness uniform across all consumers instead of keeping the majority harness (Claude Code, which runs porch builders and MAINTAIN itself) always fresh via session-launch expansion.Whichever lands, the equality test in
governance-sweep.test.tsand any byte-compare between the two docs needs updating to compare content outside the managed block (option 1) or is unchanged (option 2).Affected surfaces
packages/codev/src/lib/managed-block.ts(render + sync)codev init/adopt/updatecall sites inscaffold.tsand commandsarch-critical.md(both trees:codev/andcodev-skeleton/)Evidence trail
Sources: agents.md spec · agentsmd/agents.md#11 · GitHub Copilot CLI custom-instructions docs · learn.chatgpt.com Codex AGENTS.md guide + config reference · opencode.ai/docs/rules · anomalyco/opencode#2225