workflow-context-condenser
Skill1 starsChanged 6 months agoMITView on GitHub
When a long session approaches the context limit (~80% of the model's window), call condense_context to summarize the OLDEST turns while preserving the first few messages and the most recent turns. Use ONLY when genuinely near the limit — condensing rewrites the prompt prefix and lowers prompt-cache hit rate, so it is not a routine optimization. Trigger on long multi-hour sessions, not short tasks.
In this repository33 other files it gives its agents.
- skill-process-gotchasSkill
- workflow-cache-disciplineSkill
- workflow-codegraphSkill
- workflow-conductorSkill
- workflow-context-hygieneSkill
- workflow-criticSkill
- workflow-deadline-disciplineSkill
- workflow-deep-researchSkill
- workflow-done-definitionSkill
- workflow-edit-formatSkill
- workflow-effort-routingSkill
- workflow-escalateSkill
- workflow-execute-from-planSkill
- workflow-filesystem-offloadSkill
- workflow-learn-frameworkSkill
- workflow-long-running-processesSkill
- workflow-lspSkill
- workflow-memory-curationSkill
- workflow-plan-contractSkill
- workflow-plan-firstSkill
- workflow-planSkill
- workflow-quality-barSkill
- workflow-repomapSkill
- workflow-retrieve-before-actSkill
- workflow-spec-drivenSkill
- workflow-stuck-detect-resetSkill
- workflow-stuckSkill
- workflow-subagent-isolationSkill
- workflow-subtask-loopSkill
- workflow-task-finishSkill
- workflow-task-startSkill
- workflow-tool-selectionSkill
- workflow-verify-enhancedSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
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
- Distinctive: line 24
Use it: when a session is genuinely near the limit — long multi-hour work, many tool round-trips, the prompt is dominated by stale early …
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
workflow-context-condenser
<!-- TRIGGERS WHEN: a session has grown long (many turns) and context is ~80%+ full -->On a long-running session the 35B model loses coherence as the window fills. The
condense_context tool (mcp-observability) applies the OpenHands
LLMSummarizingCondenser mechanism: at ≥80% of max_model_len it summarizes the
oldest events into one dense digest, always preserving the first 4 messages
and the most recent turns. OpenHands measured up to ~2× token-cost reduction at
this fill with no quality degradation (arXiv:2511.03690).
When to use it (and when NOT to)
- Use it when a session is genuinely near the limit — long multi-hour work, many tool round-trips, the prompt is dominated by stale early history.
- Do NOT condense routinely or early. Condensing rewrites the prompt prefix, which invalidates the prompt cache — a near-empty context loses more (cache misses) than it gains. Only fire when the window is actually ~80%+ full.
How
condense_context(history) returns {fired, history, tokens_before, tokens_after,
ratio, ...}. If fired is false you were under threshold — keep going. If true,
continue from the returned (shorter) history; a condenser_fired span records the
before/after token counts and ratio so the savings are observable.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
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.

