codeprakhar25/smartcompact

5 stars · Last commit 2026-07-14

Human-in-the-loop context compaction for Claude Code — you pick which conversation turns survive, a SessionStart hook re-injects them after every compact/resume.

README preview

# smartcompact

**Human-in-the-loop context compaction for Claude Code.** *You* pick which conversation turns survive a compaction — a SessionStart hook re-injects them deterministically after every compact and resume, so they can't be summarized into oblivion.

![Claude Code](https://img.shields.io/badge/Claude%20Code-plugin-d97706)
![version](https://img.shields.io/badge/version-1.1.0-2563eb)
![license](https://img.shields.io/badge/license-MIT-16a34a)
![deps](https://img.shields.io/badge/dependencies-none-64748b)
![node](https://img.shields.io/badge/runtime-Node%20%E2%89%A518-539e43)

---

![smartcompact demo](demo/smartcompact.gif)

---

## The problem

Compaction is lossy, and it compounds. Round 2 summarizes round 1's summary, round 3 summarizes *that* — a summary of a summary of a summary. The one result you actually care about, the reason you abandoned an approach, the instruction you told Claude to keep following — any of it can quietly evaporate, and you only notice when Claude contradicts itself three rounds later.

View full repository on GitHub →