rhwendt

Compactor — Development skill for Claude Code

Development community

Claude Code plugin: agent-controlled auto-compaction — hold compaction during fragile work, with handoff notes that survive it.

How to install Compactor

This entry records only its repository, not the path inside it, so there is no exact command to give. Open rhwendt/compactor and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Compactor does

Claude Code plugin: agent-controlled auto-compaction — hold compaction during fragile work, with handoff notes that survive it.

Alternatives in Development

  • Create Handoff — You are tasked with writing a handoff document to hand off your work to another agent in a new session 10k ★
  • Om Intake — Process all unread meeting notes in work/meetings/ — reads each file, classifies content, routes to the right 4.6k ★
  • Mem Save — Save a curated session-level summary to history 186 ★

README

compactor

Agent-controlled auto-compaction for Claude Code. The agent **holds** auto-compaction during fragile work, such as debugging chains or multi-file refactors, and **releases** it at a safe breakpoint. It can leave a **handoff note** that comes back after compaction.

What "control" means

Claude Code can't be told to compact early, by hooks or by the model. So compactor controls **when compaction is allowed**:

  • Below roughly your threshold, nothing compacts (Claude Code starts a little early; see Known Claude Code behaviors).
  • At or above it, compaction proceeds unless the agent holds it. Releasing lets it through at the next automatic check. The exception: by default, while a background subagent runs, compactions are held until the safety ceiling (see the same section).
  • A safety ceiling (90% of the window by default) overrides any hold, so a session never runs into the hard limit. It counts tool output that arrived since the model's last reply, and lets compaction through early when one more turn as large as the last would reach it.

Requirements

  • Claude Code with plugin support
  • python3 (3.9 or newer) on your PATH. It uses the standard library only. On Windows, make sure python3 resolves, for example through the Python launcher or an alias.

The test suite runs in CI on Linux, macOS and Windows (Python 3.9–3.13). Live sessions have been checked on Linux only, so reports from macOS and Windows are welcome.

Install

/plugin marketplace add rhwendt/compactor
/plugin install compactor@compactor

Enable

compactor is inactive until you set a threshold, which also pulls auto-compaction below the model's default. Add it to `~/.claude/settings.json`:

{ "env": { "CLAUDE_CODE_AUTO_COMPACT_WINDOW": "350000" } }

Set the threshold below the model's context window, for example `350000` on 1M-context models or `150000` on 200k models. The safety ceiling is always a percentag