agentleFS
RhythmMittal19RhythmMittal19/claude-config/skills/strategic-compact/SKILL.md

strategic-compact

Skill0 starsChanged 8 months agoMITView on GitHub

Intelligent context compaction advisor. Use when context exceeds 50% or when switching between major tasks. Guides when and how to compact for maximum context preservation.

68 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use configure-ecc, ralphinho-rfc-pipeline and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • royaluniondesign-sysSkill

    configure-ecc

    Interactive installer for Everything Claude Code — guides users through selecting and installing skills and rules to user-level or project-level directories, verifies paths, and optionally optimizes installed files.

    Also in 11 projects that use this

  • junimnjwSkill

    ralphinho-rfc-pipeline

    RFC-driven multi-agent DAG execution pattern with quality gates, merge queues, and work unit orchestration.

    Also in 11 projects that use this

  • InfopibeSkill

    everything-claude-code

    Also in 11 projects that use this

  • TironFoxSkill

    openclaw-persona-forge

    为 OpenClaw AI Agent 锻造完整的龙虾灵魂方案。根据用户偏好或随机抽卡, 输出身份定位、灵魂描述(SOUL.md)、角色化底线规则、名字和头像生图提示词。 如当前环境提供已审核的生图 skill,可自动生成统一风格头像图片。 当用户需要创建、设计或定制 OpenClaw 龙虾灵魂时使用。 不适用于:微调已有 SOUL.md、非 OpenClaw 平台的角色设计、纯工具型无性格 Agent。 触发词:龙虾灵魂、虾魂、OpenClaw 灵魂、养虾灵魂、龙虾角色、龙虾定位、 龙虾剧本杀角色、龙虾游戏角色、龙虾 NPC、龙虾性格、龙虾背景故事、 lobster soul、lobster character、抽卡、随机龙虾、龙虾 SOUL、gacha。

    Also in 5 projects that use this

  • royaluniondesign-sysSkill

    content-hash-cache-pattern

    Cache expensive file processing results using SHA-256 content hashes — path-independent, auto-invalidating, with service layer separation.

    Also in 15 projects that use this

  • loulanyueSkill

    nuxt4-patterns

    Nuxt 4 app patterns for hydration safety, performance, route rules, lazy loading, and SSR-safe data fetching with useFetch and useAsyncData.

    Also in 9 projects that use this

The file

We split this skill into the rules it gives an agent

10 rules. 0 are common, 10 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 64 edited versions we read keep these.

  • 10

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    After completing a major milestone

    line 12
  2. Distinctive:

    Before starting a complex new investigation

    line 13
  3. Distinctive:

    If current task is nearly done → finish first, then compact

    line 18
  4. Distinctive:

    If starting new task → compact NOW with summary of completed work

    line 19
  5. Distinctive:

    If in middle of debugging → save current hypotheses, then compact

    line 20
  6. Distinctive:

    Before compacting, dump current state to a TODO or scratchpad file

    line 24
  7. Distinctive:

    Use session handoff file for continuity

    line 28
  8. Distinctive:

    When running /compact, use this format:

    line 31
  9. Distinctive:

    Check git status to see what was changed

    line 40
  10. Distinctive:

    Run tests to confirm current state

    line 41

“Common” is measured: kept by at least 6 in 10 of the 64 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Strategic Compact Skill

When This Activates

You should consider compaction when:

  • Context usage exceeds 50% (check /cost)
  • Switching between unrelated tasks
  • After completing a major milestone
  • Before starting a complex new investigation

Decision Tree

At 50% context:

  • If current task is nearly done → finish first, then compact
  • If starting new task → compact NOW with summary of completed work
  • If in middle of debugging → save current hypotheses, then compact

At 70% context:

  • MANDATORY compact. No exceptions.
  • Before compacting, dump current state to a TODO or scratchpad file

At 85%+ context:

  • /clear and restart. Compaction at this point loses too much.
  • Use session handoff file for continuity

Compact Instructions Template

When running /compact, use this format:

/compact Preserve: [list key files modified], [current task and progress], [decisions made], [test commands used], [any error messages being investigated]. Discard: [exploration tangents], [rejected approaches], [file contents already committed].

Recovery After Compact

After compaction, immediately:

  1. Re-read the 2-3 most important files for current task
  2. Check git status to see what was changed
  3. Run tests to confirm current state
  4. Resume from where compaction happened

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.