Agent Compaction Preset — Development skill for Claude Code
Cross-agent context compaction presets for OpenCode, DSH, Codex CLI, Claude Code, Gemini CLI, and Qwen Code.
How to install Agent Compaction Preset
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open liuye0209/agent-compaction-preset and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
What Agent Compaction Preset does
Cross-agent context compaction presets for OpenCode, DSH, Codex CLI, Claude Code, Gemini CLI, and Qwen Code.
Alternatives in Development
- Petdex — A public gallery of animated pets for Codex, Claude Code, DeepSeek Harness, Hermes, OpenCode, Gemini CLI, and 4k ★
- Agent Of Empires — Manage multiple Claude Code, OpenCode agents from either TUI or Web for easy access on mobile 3.1k ★
- Ralphy — My Ralph Wiggum setup, an autonomous bash script that runs Claude Code, Codex, OpenCode, Cursor agent, Qwen & 2.8k ★
README
agent-compaction-preset
`agent-compaction-preset` writes native context-compaction settings for several CLI coding agents from one shared policy. It does not proxy model requests, install a runtime plugin, or manage provider accounts or API keys. It edits only the targeted compaction keys and never prints unrelated configuration values. It is a zero-runtime-dependency Node.js CLI (Node.js 20 or newer) that edits the configuration files the agents already use.
The default policy targets a 200,000-token model window with a 190,000-token automatic compaction trigger and 50,000 tokens of retained raw context after compaction. OpenCode and DSH can apply both the trigger and retention; for them, the context window is an input used to derive native settings. Codex CLI also writes the window as `model_context_window`. Claude Code, Gemini CLI, and Qwen Code expose no user-configurable retention setting, so they are supported as partial: the tool sets their trigger and reports retention as `N/A` instead of pretending a 50K retention value exists.
1. Capability matrix
| Agent | Support | Trigger | Retention | Config file |
|---|---|---|---|---|
| OpenCode | full |
compaction.auto: true, compaction.buffer: 10000 (190K effective on a 200K window) |
compaction.keep.tokens: 50000 |
~/.config/opencode/opencode.json |
| DSH | full |
auto: true, thresholdRatio: 0.95, headroomTokens: 0, maxTokens: 8192 (190K effective on a 200K window) |
retainTokens: 50000 |
~/.dsh/profiles//cordis.patch.yml |
| Codex CLI | partial |
model_context_window = 200000, model_auto_compact_token_limit = 190000 |
N/A |
~/.codex/config.toml |
| Claude Code | partial |
autoCompactEnabled: true, autoCompactWindow: 190000 (v2.1.288+) |
N/A |
~/.claude/settings.json |
| Gemini CLI | partial |
model.compressionThreshold: 0.95 |
N/A |
~/.gemini/settings.json |
| Qwen Code | partial |
context.autoCompactThreshold: 0.95 |
N/A |
`~/.qwen/setti |
Related Skills
Fast Jev Agents
High-performance verbatim context compaction for coding agents (Claude, Codex, Antigravity, Gemini, OpenCode)
Inception Mercury Compaction
Universal context compaction tool for CLI coding agents (Claude Code, Codex CLI, OpenCode, Mistral Vibe). Dete
AgEnD
Multi-agent fleet daemon — run Claude Code, Gemini CLI, Codex, and OpenCode from Telegram with cross-instance
Cc Switch Remote
A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Gemini CLI & Hermes
Cc Switch
A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Gemini CLI & Hermes
Modstage
A Claude Code mod that runs Codex, Grok, Muse, Antigravity (Gemini), Kimi, Qwen Code, OpenCode, Hermes and Cla
Related Agents
Agent Of Empires
Claude Code, OpenCode, Mistral Vibe, Codex CLI, Gemini CLI Coding Agent Terminal Session manager via tmux and
Developer Overview
code-container (container) creates isolated Docker environments for AI coding harnesses (Claude Code, OpenCode
Protocol Researcher
Verifies facts about vendor agent CLIs, SDKs, protocols and terms (Claude Code, Codex, Gemini CLI, OpenCode, A