技巧精选

Claude Code 安全规则压缩研究

If you keep safety rules or coding standards in an AGENTS.md or a CLAUDE.md, this one is worth your ...

精选理由

Claude Code 在安全规则压缩方面有显著改进,值得一看。

AI 摘要

研究人员测试了20个生产智能体配置的上下文压缩效果,Claude Code 在Sonnet 4.6上压缩后保留53%的安全规则,五轮后降至10%。通过知识分类和保留策略,改进方案能保留2到4倍的安全规则,五轮召回率96%。

原文 · elvis

If you keep safety rules or coding standards in an AGENTS.md or a CLAUDE.md, this one is worth your ...

If you keep safety rules or coding standards in an AGENTS.md or a CLAUDE.md, this one is worth your time. (bookmark it) Researchers measured what context compaction actually destroys across 20 production agent configurations. A safety rule and an episodic log compete for the same tokens, and when the budget overflows both get summarized at the same rate. Only the rule needs exact wording to stay enforceable. Claude Code compact on Sonnet 4.6 preserves 53% of safety rules after one round. After five rounds, it goes to 10%. Their fix is Knowledge Triage, which classifies each line of the knowledge base by type and routes each type through its own retention policy. Three deterministic operators handle compaction, partitioning, and retrieval, preserving 2 to 4x more safety rules at every ratio with 96% recall over five rounds. Paper: arxiv.org/abs/2608.22752 Track more trending AI papers in our academy: academy.dair.ai 💬 10 🔄 3 ❤️ 14 👀 1947 📊 13 ⚡