Bug
The official AGENTS.md template (reference/templates/AGENTS.md) uses ## Every Session and ## Safety as section headers. However, post-compaction-context.ts extracts sections named ## Session Startup and ## Red Lines.
This means any workspace using the official template loses startup context after compaction — extractSections() returns null because the expected headers don't match.
Evidence
Code (from bundled dist):
const sections = extractSections(
await fs.promises.readFile(agentsPath, "utf-8"),
["Session Startup", "Red Lines"]
);
Template (reference/templates/AGENTS.md):
## Every Session ← code expects "Session Startup"
## Safety ← code expects "Red Lines"
The BARE_SESSION_RESET_PROMPT (used by /new and /reset) also references "Session Startup".
CHANGELOG #22338 confirms the feature expects "Session Startup".
Expected fix
Update the template to use ## Session Startup and ## Red Lines, or update the code to accept both naming conventions.
Bug
The official
AGENTS.mdtemplate (reference/templates/AGENTS.md) uses## Every Sessionand## Safetyas section headers. However,post-compaction-context.tsextracts sections named## Session Startupand## Red Lines.This means any workspace using the official template loses startup context after compaction —
extractSections()returns null because the expected headers don't match.Evidence
Code (from bundled dist):
Template (
reference/templates/AGENTS.md):The
BARE_SESSION_RESET_PROMPT(used by/newand/reset) also references "Session Startup".CHANGELOG #22338 confirms the feature expects "Session Startup".
Expected fix
Update the template to use
## Session Startupand## Red Lines, or update the code to accept both naming conventions.