Home / Claude Code mods / Cost & usage / better-compact

better-compact

better-compact is a Claude Code mod by koenvdheide that steers every compaction, including automatic ones, with a brief that keeps goal, next step, files, decisions and state. Once context runs high, a button above the prompt runs /compact, so.

Updated 2026-10-14

What is better-compact?

better-compact is a Claude Code mod by koenvdheide that steers every compaction, including automatic ones, with a brief that keeps goal, next step, files, decisions and state. Once context runs high, a button above the prompt runs /compact, so. It is listed under Cost & usage and has 1 GitHub stars.

TypeClaude code mod
Authorkoenvdheide
Repositorykoenvdheide/better-compact
Popularity1 GitHub stars
CategoryCost & usage
SecurityLow risk (100/100)
Rank#1,915 of 5,272 Claude Code mods; #331 in Cost & usage
LicenseMIT
Last commit2026-10-14
Hooks4 events
Seescompaction
Draws onAbovePrompt

Is better-compact safe to install?

better-compact scores 100/100 on the MCPMods security check: Low risk. No checks raised a concern. It passed 8 of 8 checks.

Mod footprints come from claude plugin validate, which lists every event a mod hooks and every API call it makes without running it.

CheckResult
No network accessPass
Starts no processesPass
Writes no files or configPass
Doesn't read environment variablesPass
Only sees the events it hooksPass
Doesn't drive ClaudePass
Passes claude plugin validatePass
Has an open-source licensePass

API calls in its code

CallWhat it means
$.command.rundrives Claude
$.ui.invalidatedraws interface
$.ui.resolvedraws interface

How do I install better-compact?

  1. Check your Claude Code version. Mods need Claude Code 2.1.287 or later and are on by default.
    claude --version
  2. Read its footprint. This lists every event it hooks and every API call it makes, without running it.
    git clone https://github.com/koenvdheide/better-compact
    claude plugin validate ./better-compact/.
  3. Install it. Run this in your terminal, then /reload-plugins in an open session.
    git clone https://github.com/koenvdheide/better-compact && claude --plugin-dir ./better-compact/.

Or ask Claude to set it up

Paste this into Claude Code and it installs better-compact for you:

Install the "better-compact" Claude Code mod from https://github.com/koenvdheide/better-compact. Run claude plugin validate on it first and show me what it can access before you enable it.