by Arkya-AI
A complete operating system for Claude that prevents context loss and makes multi-session work reliable
# Add to your Claude Code skills
git clone https://github.com/Arkya-AI/claude-context-osNew CLAUDE.md that solves the compaction/context loss problem and mimics persistent memory through effective session handoff in token efficient manner
v3 got 150+ stars. Then I read 9 peer-reviewed papers on how LLMs actually process system prompts. Turns out v3 was working against itself.
The research said three things that broke my assumptions:
LLMs track 5-10 rules before performance degrades. v3 had 15+. Some rules were silently dropped every session. (arXiv:2409.10715)
Explanatory prose actively interferes with instruction compliance. The "Why It Matters" sections in v3 weren't neutral — they competed with the actual rules for Claude's attention. Topically related filler is worse than random noise. (Chroma Context Rot, 2025)
Claude 4.6 overtriggers on emphatic language. "CRITICAL", "NEVER", "YOU MUST" worked for Claude 3.x. The newer models are more responsive to system prompts and now overcorrect when they see aggressive language. (Anthropic Claude 4 Best Practices)
The result: v4 is 47 lines and 7 rules. Down from 327 lines and 15+ rules. Every design choice maps to a specific research finding.
| | v3 | v4 | |---|---|---| | Lines | 327 | 47 | | Rules | 15+ | 7 | | Explanatory prose | Heavy | Zero | | Language style | "CRITICAL / NEVER / MUST" | Plain imperatives | | Session startup | Read all summaries | Read only what handoff references | | Reference content | Embedded in CLAUDE.md | Moved to docs/context/ (loaded on demand) | | Templates | Same | Same + task template + handoff index |
No comments yet. Be the first to share your thoughts!
Claude's default summarization loses five specific things:
The fix isn't better summarization — it's structured templates with explicit fields that mechanically prevent these five failure modes.
CLAUDE.md (47 lines, ~1,200 tokens) — the operating system
templates/
claude-templates.md (on-demand only) — 6 templates, 3 subagent contracts,
3 workflow phases, task definition format
docs/
context/ (on-demand) — reference files loaded by work type
processing-protocol.md — how to handle multiple documents
archive-rules.md — summary lifecycle and file management
project-structure.md — full directory tree + scaffold commands
subagent-rules.md — when to use subagents vs. main agent
client-briefs/ — per-cli...