Adaptive Compaction

Adaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without chang

65 stars 6 forksAI, LLMs & Agents Plugin marketplace

Install

Claude Code plugin
/plugin marketplace add Yrzhe/claude-skills

The repo is a Claude Code plugin marketplace. Run /plugin afterwards to pick the plugin that includes this skill.

skills CLI (Claude Code, Cursor, Codex and more)
npx skills add Yrzhe/claude-skills --skill adaptive-compaction
Manual install
git clone --depth 1 https://github.com/Yrzhe/claude-skills.git /tmp/claude-skills
mkdir -p ~/.claude/skills
cp -r /tmp/claude-skills/plugins/adaptive-compaction ~/.claude/skills/adaptive-compaction

Personal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.

From the SKILL.md

# Adaptive Compaction

Use this skill to install, inspect, or operate the adaptive compaction policy and recovery layer for coding agents. Keep the layer add-on only: decide when to preserve, prune, compact, fork, or ask; never rewrite the host agent core.

## Operating Rules

Follow these rules before taking action:

1. Preserve state before any risky compaction path.
2. Run zero-LLM pruning before any LLM summary recommendation.
3. Treat relevance as advisory. Never use low relevance alone for destructive action.
4. Prefer fork/reset on topic shift when headroom is healthy.
5. Enforce `FORCED_COMPACT` only on hook-rich hosts. Degrade Codex and MCP-only hosts to advise/persist.
6. Keep stable instructions before volatile state to avoid prompt-cache churn.
7. Log every decision with thresholds and host capability tier.
8. Use portable paths such as `<skill-dir>/scripts/decide.py`; do not hardcode install paths.
9. When the per-turn `additionalContext` reports a non-NOOP action, **lead your next reply by surfacing it to the user in their language** (forced compaction needed, fork recommended, decision needs confirmation). Then continue with the user's actual request. Do not silently swallow these signals — that is the only channel by which the skill can ask the user to act.

## Load References Conditionally

Do not read every reference by default. Load only the rows needed for the current request.

| Task | Read |
|---|---|
Read the full skill on GitHub

Details

Skill name
adaptive-compaction
Path
plugins/adaptive-compaction/SKILL.md
License
MIT
Repo updated
27 October 2026

FAQ

What does the Adaptive Compaction skill do?

Adaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without chang

How do I install the Adaptive Compaction skill?

Claude Code plugin: /plugin marketplace add Yrzhe/claude-skills. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.

Is Adaptive Compaction popular?

It lives in Yrzhe/claude-skills, which has 65 GitHub stars and 6 forks.

Related skills

Agentlog

65

Yrzhe/claude-skills

Load when the user wants to view, sync, or analyze multi-agent activity across multiple devices — Claude Code / Codex / Cursor / Maestri / browser-use sessions captured to a shared GitHub-synced pool, OR wants a distilled per-project context document so a fresh agent in a different tool can pick up where another left off. Triggers on "agentlog X" commands, "what did I do today across all my agents", "show me my pool", "sync the pool", "拉一下另一台机器上的 agent 记录", "看看 vps 上跑的", "跨设备 agent log", "跨工具上下文", "switch from Codex to Claude Code", "AGENTS.md / CLAUDE.md", "项目状态文档", "agent context". Do NOT lo

AI, LLMs & Agents

Akshare a Shares

65

Yrzhe/claude-skills

针对中国A股的行情与数据查询(基于本地 akshare 源代码与API映射)。当用户请求获取A股实时行情、历史K线(日/周/月)、分钟级分时(1/5/15/30/60)、复权数据(前复权/后复权)、股东户数(含详情)、以及巨潮资讯公告披露结果时使用本Skill。默认优先使用东方财富(EM)接口;如用户指定新浪(Sina)来源或需要特定接口,则按映射调用对应函数。可使用内置脚本输出CSV/JSON,或内联Python调用。

Software Development

Appsnap

65

Yrzhe/claude-skills

Capture a Mac app window as agent context. Use when the user asks to snap, inspect, read, capture, summarize, or work from the current Mac window, a visible app, a selected window, or an app screenshot. Strongly prefer for Appshot-like requests, "what is on this window", "use this app as context", and "grab the window text". SKIP for remote websites/files that can be fetched directly, for controlling the UI, clicking, typing, automating actions, or extracting hidden Google Docs/Sheets/Slides/Gmail canvas text beyond what macOS Accessibility exposes.

Frontend & Design

System Design

43

ftvision/system-design-skill

Practice system design interviews. Four modes: `mock` (Claude=interviewer, strict, scores at end), `learn` (Claude=interviewee at staff level so user sees what good looks like; `--auto` runs both roles as sub-agents while user observes), `postmortem` (diagnose a past real interview, with --file or free-form Q&A), `generate` (create a fresh question + rubric and write 4 markdown files to ./system-design-questions/<slug>/). Use when the user types the system-design command, asks to practice, mock, or postmortem a system design interview, or wants to generate practice questions.

AI, LLMs & Agents

AI Coding Agents

49

lllyys/vreader

Comprehensive guide for using Codex CLI (OpenAI) and Claude Code CLI (Anthropic) - AI-powered coding agents. Use when orchestrating CLI commands, automating tasks, configuring agents, or troubleshooting issues.

AI, LLMs & Agents21

Solo Founder Gtm

79

LeadMagic/gtm-skills

Build lean GTM as a solo founder or bootstrapper — tool stacks by revenue stage, AI agents replacing headcount, when to make the first hire, bootstrapper economics, and the WbD GTM Index for self-assessment. Use when building GTM as a solo founder, bootstrapper, or small team. Triggers on: "solo founder", "bootstrapper GTM", "lean GTM", "founder sales", "DIY GTM", "when to hire", "founder tools", "bootstrapped stack", "product market fit", "PMF test", "when to scale", "scale too early", or any request about building GTM without a team.

AI, LLMs & AgentsIn 1 list18

Browse the most popular Claude skills, all ai, llms & agents skills, or write your own with the skills generator.