Skip to content

context-bar shows where auto-compaction really runs - #158

Merged
hamzafer merged 2 commits into
hamzafer:mainfrom
niemst:context-bar-pct-override
Oct 29, 2026
Merged

hamzafer merged 2 commits into
hamzafer:mainfrom
niemst:context-bar-pct-override

Conversation

@niemst

@niemst niemst commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

What changed

context-bar showed the wrong compaction point when CLAUDE_AUTOCOMPACT_PCT_OVERRIDE is set.
The breakdown's autoCompactThreshold leaves the override out: with CLAUDE_CODE_AUTO_COMPACT_WINDOW=660000 and the override at 50, the bar said "compacts at 627k", but compaction ran at 330k.

  • compactPoint applies the override as auto-compaction does: min(threshold, floor(window * pct / 100)) for 0 < pct <= 100.
  • The mod reads the override with $.env.get.
  • context-bar 0.1.3 → 0.1.4.

Checklist

  • claude plugin validate mods/<name> passes
  • claude plugin test mods/<name> passes
  • node --test test/*.test.mjs and cd cli && node --test pass
  • Changed a mod: version bumped in its plugin.json, in .claude-plugin/marketplace.json and on its site page (chip and JSON-LD)
  • New mod: mods/<name>/ and an entry in .claude-plugin/marketplace.json
  • New mod: README table row and docs/mods.md notes
  • New mod: site/mods/<name>/index.html, a row and JSON-LD entry in site/index.html, the "All N mods" counts updated, and a site/sitemap.xml entry
  • New mod: a screenshot in images/ (and site/images/)
  • New band mod: shared/bands.ts copied to mods/<name>/hooks/bands.ts
  • Community mod: a README row and a community.json entry

niemst and others added 2 commits October 29, 2026 14:39
The breakdown's autoCompactThreshold leaves out CLAUDE_AUTOCOMPACT_PCT_OVERRIDE, so with a 660k window at 50% the bar said 'compacts at 627k' while compaction ran at 330k. Apply the override as auto-compaction does: min(threshold, window * pct / 100) for 0 < pct <= 100.
Auto-compaction applies CLAUDE_AUTOCOMPACT_PCT_OVERRIDE to the effective window
(threshold + 13k), not the raw one, and reads it with parseFloat.
@hamzafer
hamzafer merged commit c7fa206 into hamzafer:main Oct 29, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants