ForkFree

Agent skills and plugins

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.

Worth a lookEstablished, with a few things to check (listed below).

View on GitHub

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.

More in Agent skills and plugins

Worth a look

A skill for coding agents that runs a structured, multi-phase security audit of a codebase. It uses separate agents to find, challenge and verify vulnerabilities, then writes the results as machine-readable records and readable reports.

53.3k stars +1411 a day MIT
ub-mode unclebob
Check the licence

ub-mode is a skill file for AI coding agents that makes them follow strict software engineering habits, such as test-driven development, low complexity and no duplicated code. It works alongside separate checking tools that measure complexity, duplication and test strength.

5k stars +1033 a day Unclear
skills anthropics
Check the licence

This is Anthropic's public collection of example Agent Skills, which are folders of instructions and scripts that Claude loads to handle specialised tasks in a repeatable way. It covers areas such as documents, design, development and communications, and includes a template and the skills specification.

184.6k stars +231 a day Unclear