preserved-thinking-audit tests Claude agent harnesses
Anthropic engineer CJ released preserved-thinking-audit, an open-source auditing skill to verify that AI agent harnesses preserve Claude's thinking blocks across multi-turn sessions. The tool supports testing against the Claude API's new on-demand compaction beta, ensuring conversation history can be summarized in the background without invalidating reasoning traces.
As reasoning models enforce strict prefix-integrity checks on thinking tokens, context compaction can no longer rely on naive client-side truncation. On-demand compaction paired with dedicated harness auditing provides the architectural blueprint developers need to keep long-running agents stateful without blowing token budgets or triggering invalid-signature errors.
- –Prefix integrity enforcement: Claude models like Fable 5.1 strictly validate signatures on preserved thinking blocks, meaning any client-side tampering with past messages or tool definitions triggers API errors or drops thinking.
- –On-demand background compaction: The compact-2026-09-04 beta allows agents to request signed compaction blocks asynchronously while execution continues on full history, eliminating latency spikes during context truncation.
- –Keep-tail preservation: Retaining recent conversation turns uncompacted ensures that an agent's immediate chain of thought remains coherent and valid following a compaction swap.
- –Automated harness verification: The preserved-thinking-audit skill automates 23 separate static and dynamic checks against local recording proxies, catching subtle signature-breaking bugs before agents hit production.
DISCOVERED
1h ago
2026-09-16
PUBLISHED
1h ago
2026-09-16
RELEVANCE
AUTHOR
cjav_dev