mirror of
https://github.com/jarrodwatts/claude-hud.git
synced 2026-04-28 15:42:40 +00:00
* 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>
10 lines
384 B
TypeScript
10 lines
384 B
TypeScript
/**
|
|
* Autocompact buffer percentage.
|
|
*
|
|
* NOTE: This value (22.5% = 45k/200k) is empirically derived from community
|
|
* observations of Claude Code's autocompact behavior. It is NOT officially
|
|
* documented by Anthropic and may change in future Claude Code versions.
|
|
* If users report mismatches, this value may need adjustment.
|
|
*/
|
|
export const AUTOCOMPACT_BUFFER_PERCENT = 0.225;
|