coffeecoproject

SmartCompact — Development skill for Claude Code

Development community

Compact long coding-agent sessions earlier, at a pause after a finished piece of work, to cut cost without losing results (Claude Code, pi, Codex).

How to install SmartCompact

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

What SmartCompact does

Compact long coding-agent sessions earlier, at a pause after a finished piece of work, to cut cost without losing results (Claude Code, pi, Codex).

Alternatives in Development

  • Shorten — Cut length without losing content 407 ★
  • The Dev Squad — Give Claude its own dev team: one supervisor, four specialists, and bulletproof plans/builds without losing co 231 ★
  • Cut Video — Claude Code skill: tighten long recordings — remove silences, ums, dead air 92 ★

README

SmartCompact

**English** · [中文](https://github.com/coffeecoproject/SmartCompact/blob/main/README.zh-CN.md)

[![npm](https://img.shields.io/npm/v/smartcompact)](https://www.npmjs.com/package/smartcompact) [![GitHub stars](https://img.shields.io/github/stars/coffeecoproject/SmartCompact?style=social)](https://github.com/coffeecoproject/SmartCompact/stargazers) [![License](https://img.shields.io/badge/license-MIT-blue)](https://github.com/coffeecoproject/SmartCompact/blob/main/LICENSE)

SmartCompact in 90 seconds (video)

▶ Watch the 90-second explainer (click the image to play)

**SmartCompact lets long coding-agent sessions compact earlier, at a pause after a piece of work is finished.** On 18–60 consecutive coding tasks it cut cost by **7–44%** with no loss in hidden acceptance tests; the longer the session, the more it saves. In the longest runs (60 tasks, native sessions reaching 820k–960k tokens) the model missed 6 of 180 recall questions about details mentioned in passing much earlier ([how it was tested](https://github.com/coffeecoproject/SmartCompact/blob/main/docs/EVALUATION.md)).

Every request re-reads the whole context, so a long context makes every step expensive. Native auto-compaction waits until the context is nearly full (close to 1M tokens in Claude Code, up to 800k in Codex if configured), and it ignores timing, so it often lands in the middle of a task. SmartCompact works with Claude Code (CLI and desktop app), [Pi](https://github.com/earendil-works/pi) and the Codex CLI:

  • Compact at a good moment. Once the context passes the allow line (200k tokens by default), it compacts when a turn ends, if a piece of work has been finished since the last compaction (a commi