engineering / skill
Magic Compact
A Claude Code and OpenCode plugin for session compaction, assistant-turn summaries and tool input/output pruning.
At a glance
- Purpose
- A Claude Code and OpenCode plugin for session compaction, assistant-turn summaries and tool input/output pruning.
- Runs in
- Local agent with shell
- Operating systems
- Not stated
- Needs
- Runtime: Not stated; Needs internet: Not stated; Needs accounts or API keys beyond your agent: Not stated
- Files and data
- Reads files: Not stated; Writes files: Not stated; Sends data to other services: Not stated
- Tool type
- Skill
- Delivery
- From GitHub
- Version
- Latest on the main branch
- Access
- Code on GitHub
- Compatibility
- According to the README, it works with Claude Code, installed from the repository's first-party plugin marketplace, and with OpenCode, installed with opencode plugin magic-compact --global.
- External costs
- The repository is BSD-3-Clause licensed and the README states no pricing. The README says the conversation is summarized with one request and /magic-trim does not call an LLM. Your coding agent or model provider may charge for usage.
- Permissions
- The README describes the plugin processing conversation content in Claude Code or OpenCode. The README's OpenCode installation first deletes matching magic-compact packages from ~/.cache/opencode/packages, then installs the package and adds it to global OpenCode configuration. The README gives a plugin marketplace route for Claude Code. The README says compaction summarizes old assistant turns, prunes eligible tool input and output and creates a backup session. The README describes cached content retrieval through read_omitted_content, while its tool-specific rules discard some outputs without caching. The README says Claude Code compaction creates a new session instead of modifying the current transcript. The top-level entries include scripts/, whose access the README does not detail.
- Usage terms
- BSD 3-Clause "New" or "Revised" License, as stated in the repository. See its LICENSE.md file for the exact terms.
Code on GitHub
aerovato/magic-compact
BSD-3-ClauseLossless context compression plugin for Claude Code & OpenCode.
Topics: anthropic chatgpt claude claude-code claude-code-plugin claude-skills codex gemini
Public GitHub data fetched · 0 days old
Skill folders in this repository (1)
Folders that contain a SKILL.md file, from GitHub's file list on .
What it does
Magic Compact is a plugin for Claude Code and OpenCode. The README says it replaces old assistant turns with per-turn summaries while retaining user messages and tool-call structure. The README says bulky completed tool input and output can be replaced with omission notices and cached for read_omitted_content, but its tool-specific rules discard some outputs without caching.The README gives /magic-compact with an optional number of recent assistant turns to preserve and says a backup session is created first. The README marks /magic-trim as experimental and OpenCode-exclusive and describes it as tool input/output pruning without summarization. The README also lists /magic-stats for OpenCode. For Claude Code, the README says compaction creates a new session and prints a /resume command.
The README says development is paused in favor of Operator Memory and describes Magic Compact as remaining functional.
Who it is for
Claude Code and OpenCode users who want to reduce a long session's context on demand.Example tasks
Run /magic-compact to summarize all old assistant turns.Run /magic-compact 3 to keep the 3 most recent assistant turns and summarize the rest.
In OpenCode, run /magic-trim to prune eligible tool input and output without summarizing.
In OpenCode, run /magic-stats to see token savings for the conversation.
In Claude Code, run the /resume command the plugin prints to enter the compacted session.