Skip to content

docs(architecture): trim architecture.md under the 150k-char context limit#1344

Open
dolho wants to merge 1 commit into
devfrom
docs/trim-architecture
Open

docs(architecture): trim architecture.md under the 150k-char context limit#1344
dolho wants to merge 1 commit into
devfrom
docs/trim-architecture

Conversation

@dolho

@dolho dolho commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Why

docs/memory/architecture.md had grown to ~156.7k chars (on dev), past the 150k soft limit Claude Code warns about. The file is @-imported by CLAUDE.md, so it's auto-loaded into context every session — over the limit it risks silent truncation and eats a large slice of the context window each turn.

What

Compressed the densest prose, preferring summary + pointer wherever a dedicated feature-flows/ doc already owns the deep detail (the doc's own editorial rule #2):

  • Cross-Cutting Subsystem narratives: Agent Runtimes/Codex parity, Status-as-projection, Circuit Breakers, Idempotency, Heartbeat, Soft-Delete sweeps, Session Tab, Real-time, VoIP, Git Sync, Agent Compatibility, Agent Runtime Data, Subscription token rotation.
  • Architectural Invariants Feature/vector log retention #3 (dual-track migrations) and Client/Viewer User Role (AUTH-002) #17 (non-root containers).
  • A few over-long catalog/endpoint rows and the longest frontend UI prose blocks.

Result

156.7k → 149.3k chars (~4.8% smaller) — clears the warning.

Safety

  • No facts dropped — every issue tag, field name, default, and error-string preserved.
  • Protected SQLite DDL (tracked by /validate-schema) untouched.
  • Heading / code-fence / table counts unchanged vs dev (68 / 58 / 32).
  • All 12 newly-added feature-flows/*.md links resolve.

🤖 Generated with Claude Code

…limit

architecture.md had grown to ~156.7k chars (on dev), past the 150k
soft limit Claude Code warns about when auto-loading it each session
(it's `@`-imported by CLAUDE.md). Over the limit the file risks silent
truncation and eats a large slice of the context window every session.

Compressed the densest Cross-Cutting Subsystem narratives, the migration
and non-root-container invariants (#3/#17), a few catalog/endpoint rows,
and the longest frontend UI prose — preferring summary + pointer where a
dedicated `feature-flows/` doc already owns the deep detail (the doc's own
editorial rule). Result: 156.7k → 149.3k chars (~4.8% smaller).

No facts dropped: every issue tag, field name, default, and error-string
is preserved; protected SQLite DDL (tracked by /validate-schema) untouched;
heading/code-fence/table counts unchanged; all 12 added flow-doc links
resolve.

Related to the over-limit warning surfaced in Claude Code.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@dolho dolho requested a review from vybe June 25, 2026 07:39
@github-actions

Copy link
Copy Markdown

⚠️ Nightly unit-suite check skipped — merge conflict against dev.

Resolve by running git merge dev locally and pushing the result. The next nightly run will re-test once the conflict is gone.

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