Skip to content

fix: fence console-context block so repo content below it is preserved#53

Merged
ProtocolWarden merged 1 commit into
mainfrom
fix/console-context-fenced-block
May 21, 2026
Merged

fix: fence console-context block so repo content below it is preserved#53
ProtocolWarden merged 1 commit into
mainfrom
fix/console-context-fenced-block

Conversation

@ProtocolWarden
Copy link
Copy Markdown
Owner

Summary

  • bootstrap.py used a DOTALL regex from <!-- console-context --> to EOF, wiping any repo-owned content below the OC block on every session start
  • Fix: add <!-- /console-context --> closing fence to the block template; switch to a non-greedy replace that only touches content between the two markers
  • New/fallback write paths also use the fenced block, so all future writes are safe
  • Migrates OC's own CLAUDE.md: adds closing fence and restores the Cognition Lifecycle section that was being wiped on every session

Test plan

  • Open any repo session — CLAUDE.md content outside the fenced block is untouched
  • Repo-specific sections below <!-- /console-context --> survive session restarts

🤖 Generated with Claude Code

bootstrap.py used a DOTALL regex from the open marker to EOF, wiping
any repo-owned content below the OC block on every session start.

Fix: add <!-- /console-context --> closing fence to the block template
and switch to a non-greedy replace that only touches content between
the two markers. Old-format files (open marker, no close) fall back to
the previous behaviour until they are migrated.

Migrates OC's own CLAUDE.md: adds closing fence and restores the
Cognition Lifecycle section that was getting wiped.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@ProtocolWarden ProtocolWarden merged commit 694f8cc into main May 21, 2026
4 of 5 checks passed
@ProtocolWarden ProtocolWarden deleted the fix/console-context-fenced-block branch May 21, 2026 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant