- Add `shopt -s expand_aliases` to snapshot so aliases captured by
`alias -p` actually work under `bash -c` (review comment #2)
- Pass threshold=0 in enforce_turn_budget() so L3 can force-persist
results below the 50K default when aggregate budget is exceeded
(review comment #3)
- Add regression test: 6x42K results (each under 50K) exceeding 200K
budget are now correctly persisted
Add tools/tool_result_storage.py implementing Layer 2 (per-result) and
Layer 3 (per-turn budget) persistence for large tool outputs. Results
exceeding thresholds are written to disk with a <persisted-output>
preview block replacing the inline content. Extend ToolEntry and
ToolRegistry with max_result_size_chars for per-tool threshold control.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>