rasatpetabit

Autocompactor — Development skill for Claude Code

Development community

Smarter, earlier, instruction-tailored compaction for Claude Code: boundary-aware timing, phase-aware summaries, artifact extraction, local telemetry, offline backtester.

How to install Autocompactor

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

What Autocompactor does

Smarter, earlier, instruction-tailored compaction for Claude Code: boundary-aware timing, phase-aware summaries, artifact extraction, local telemetry, offline backtester.

Alternatives in Development

  • Octo Freeze — Restrict file edits to a specific directory boundary 2.8k ★
  • Claudeception — A Claude Code skill for autonomous skill extraction and continuous learning 2.2k ★
  • Setup Context — Set up your Skill Memory — a pm-context.md every skill reads so outputs come back tailored to you 1.3k ★

README

autocompactor

A **Pi context compactor**: smarter, earlier, cheaper compaction for the Pi coding agent. The Pi extension shells out to a harness-agnostic Python core that watches occupancy and task boundaries, decides when a compaction is worthwhile, and tailors the instructions the summarizer is given.

agent_end ─────────→ pi_bridge evaluate  (watches occupancy + boundaries,
                     │                     advises or actuates ctx.compact())
                     ▼
session_before_compact → pi_bridge prepare  (backs up transcript, extracts
                     │                        artifacts, restates founding goal)
                     ▼
session_compact ────→ pi_bridge reinject  (one-shot budgeted artifact digest
                     │                       delivered as the next turn)
                     │
   transcript_lib.py  (shared signal registry, phase detection, instruction builder)
   stats.py           (local telemetry -> events.jsonl)
   nightly_eval.py    (cron self-evaluation: tests, telemetry health, dated reports)

Why this shape

Compaction cost scales with the context summarized, and every token of bloat is re-paid as input on every subsequent turn. Compacting at a task boundary, at moderate occupancy, is dramatically cheaper than an autocompact firing near the ceiling — and the summary is better, because the instructions are generated from what actually happened in the session (files edited, recent errors, last task statement). Pi is the first harness where we hold an actuator: the bridge can either advise (`autocompactor.advice`) or call `ctx.compact()` itself (the shipped default — see MODE below).

Install

Clone anywhere and run the installer — the extension is copied into `~/.pi/agent/extensions/` with the bridge path baked in (a symlink can't carry the path), the Pi package version observed at install time is pinned, and nothing else under `~/.pi` is touched:

git clone  autocompactor && cd aut