Files
claude-hud/tests
Jarrod Watts daf37a8537 fix: use percentage-based autocompact buffer with config toggle (#55)
* fix: use percentage-based autocompact buffer with config toggle

- Change hardcoded 45k buffer to 22.5% of context window
- Scales correctly for enterprise windows (>200k)
- Add `display.autocompactBuffer` config option ('enabled' | 'disabled')
- Default 'enabled' preserves current behavior (buffered %)
- 'disabled' shows raw % for users with autocompact off

Fixes #48, #16
Related: #4, #30, #43, #49

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* test: add autocompactBuffer tests for renderSessionLine

Address review feedback:
- Add tests verifying autocompactBuffer: 'enabled' uses buffered %
- Add tests verifying autocompactBuffer: 'disabled' uses raw %
- Add autocompactBuffer check to loadConfig test
- Update baseContext() to include autocompactBuffer

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* docs: add clickable GitHub URLs to CHANGELOG credits

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* feat: add debug log for autocompactBuffer mode

When DEBUG=claude-hud is set and autocompactBuffer='disabled',
logs both raw and buffered percentages to help troubleshoot mismatches.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-09 11:58:46 +11:00
..
2026-01-03 18:52:12 +11:00