magic-compact
by aerovato
Magic Compact is a plugin for Claude Code and OpenCode that shrinks a long coding conversation by summarising each old assistant turn separately, rather than replacing everything with one summary. Pruned tool output is cached so the AI can fetch it again when needed.
- Stars
- 176
- Licence
- BSD-3-Clause
- Runs on
- Your computer
- Setup
- Easy
- Language
- TypeScript
- Age
- 118 days
What you can do with it
- Compact a long coding session with /magic-compact while keeping your messages and the AI's reasoning summaries
- Trim bulky tool output from an OpenCode session with /magic-trim without summarising anything
- Check how many tokens and how much money you saved with /magic-stats in OpenCode
Ways a business could use it
- Cut token use and cost on long AI-assisted coding sessions for client projects
- Keep an AI coding assistant on track across big tasks, so fewer hours are lost re-explaining context
Can you use it commercially?
Free to use, change and sell, including in paid products. Keep the copyright notice.
Not legal advice. Read the project's licence file before building a product on it.
Getting it running
In Claude Code, add the repository as a plugin marketplace and install it with two slash commands; in OpenCode, run "opencode plugin magic-compact --global".
Follow the official instructions in the project README.
Things to check
- Development is paused in favour of a successor project, Operator Memory
- On Claude Code it creates a new session you must resume, rather than compacting in place
- /magic-stats is not available on Claude Code, and /magic-trim is experimental and OpenCode only
- Summaries are produced by an AI model, so they use tokens and may miss details
Who's talking about it
Checked 29 Oct 2026. Summary drafted by AI from the project's README.