whatisgithub

What is smartcompact?

codeprakhar25/smartcompact — explained in plain English

Analysis updated 2026-05-18

5JavaScriptAudience · developerComplexity · 2/5LicenseSetup · easy

In one sentence

A Claude Code plugin that lets you manually pick which conversation moments survive automatic summarization, then reinserts them every time the conversation compacts.

Mindmap

mindmap
  root((smartcompact))
    What it does
      Manual context pinning
      Deterministic reinjection
      Compaction recovery
    Tech stack
      Claude Code plugin
      Node.js hooks
      SessionStart hook
    Use cases
      Preserve key decisions
      Long coding sessions
      Recover lost details
    How it works
      Pin file per session
      Ledger and narrative split
      Single command call
    Audience
      Claude Code users
      Developers

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Prevent important decisions or results from being lost during long Claude Code sessions.

USE CASE 2

Manually pin key conversation moments instead of trusting automatic AI summarization.

USE CASE 3

Recover specific details from a conversation's full history after they were dropped by compaction.

What is it built with?

JavaScriptNode.jsClaude Code plugin

How does it compare?

codeprakhar25/smartcompact00kaku/wp-rest-playgroundbotpress/documentation-v12
Stars555
LanguageJavaScriptJavaScriptJavaScript
Last pushed2023-02-07
MaintenanceDormant
Setup difficultyeasyhardeasy
Complexity2/53/52/5
Audiencedeveloperdeveloperwriter

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min

Requires Claude Code already installed, the plugin adds itself with no manual settings.json edits.

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

So what is it?

smartcompact is a plugin for Claude Code, an AI coding assistant that works in a terminal. Long AI coding conversations eventually get too big to keep in the assistant's memory, so the tool periodically "compacts" the conversation, shrinking it down into a summary. The problem this project addresses is that each round of compacting summarizes an already shortened summary, so important details, like why an approach was abandoned or an instruction the user gave earlier, can quietly disappear a few rounds later. Other tools try to solve this automatically, letting the AI itself decide what to keep. smartcompact takes a different approach: it lets the person using the assistant choose. Before compacting happens, it shows the user specific moments from the current conversation, such as a result reached, a decision that was made and why, or a rule the user asked the assistant to follow, and asks which of those to save. Whatever the user picks gets written to a file and is automatically reinserted into the conversation every time it gets compacted or resumed, regardless of what the automatic summarizer decides to keep or drop. Installing it uses Claude Code's own plugin system with two commands, and no manual configuration file editing is required. Once installed, a user runs a command to trigger the pinning process, gets asked which pieces of the conversation to keep, and is handed a ready-made compaction command to paste in. There is also a way to search back through the full, untouched conversation history to recover details that were not pinned or kept. Behind the scenes, the tool keeps pinned notes in a small file tied to the current conversation session, and separately encourages the summarizer to keep an ongoing list of firm decisions apart from the parts of the conversation that can be freely re-summarized. It runs with a single command call to keep things fast at the exact moment when the conversation is largest and slowest to process. Nothing is sent over the network or to any outside service, everything stays on the user's own machine. This tool is meant for developers who use Claude Code regularly for long, complex coding sessions and want more control over what the assistant remembers.

Copy-paste prompts

Prompt 1
Show me how to install the smartcompact plugin for Claude Code using its plugin marketplace commands.
Prompt 2
Explain how smartcompact's SessionStart hook reinjects pinned context after a compaction.
Prompt 3
Walk me through a typical /smartcompact workflow for pinning conversation turns before compacting.
Prompt 4
Help me understand the difference between smartcompact's manual pinning and automatic state-capture plugins.

Frequently asked questions

What is smartcompact?

A Claude Code plugin that lets you manually pick which conversation moments survive automatic summarization, then reinserts them every time the conversation compacts.

What language is smartcompact written in?

Mainly JavaScript. The stack also includes JavaScript, Node.js, Claude Code plugin.

What license does smartcompact use?

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

How hard is smartcompact to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is smartcompact for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.