liuye0209

Agent Compaction Preset — Development skill for Claude Code

Development community

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