lolipopshock/pi-clm/live-context
Claude Code and agent skill by lolipopshock/pi-clm
- community
Checking that the SKILL.md file is still in the repository.
Compact stale conversation history through Pi's private live-context mirror. Use when context pressure is high, tool outputs are large, or old exploration should be replaced by a durable summary.
Install
npx vskill@latest install lolipopshock/pi-clm/live-contextSKILL.md
Live Context Management
Pi's live-context extension places the current model-visible conversation in the mirror path named in the ## Live context management section of the system prompt.
Use the mirror only when a meaningful batch compaction will improve future work. Do not compact after every turn.
Rules
- Do not print or
catthe entire mirror. Its contents are already in context. - Preserve the
[[LIVE_CONTEXT ...]]line and every retained[[CTX_TURN ...]]header. - Never try to rewrite a
protected=trueturn; the extension restores it. - Make one batched mirror write in a turn. This is an atomicity rule, not a request
for one global summary. One write should contain as many independent, localized block replacements or removals as the revision needs. Read-only inspection is never counted.
- Default to a surgical revision: preserve message order and conversational structure,
leave unrelated blocks unchanged, shorten stale bodies in place, and remove only clearly obsolete or redundant blocks. Do not repeatedly collapse the whole effective context into the same summary shape.
- Preserve complete conversational units. If a user request remains relevant, normally
retain its corresponding assistant analysis or replace that analysis with a local, specific summary at the same position. Do not keep only user messages while silently deleting all assistant-side reasoning and results.
- Interpret retention language precisely:
- "keep/preserve these messages" means retain the referenced user and assistant
messages exactly unless the user narrows the roles;
- "preserve the findings/analysis" permits a faithful semantic summary;
- if the boundary or exactness is genuinely ambiguous, ask rather than choosing the
most destructive interpretation.
- Use one global consolidation only when the user explicitly requests deep/aggressive
compression. Context pressure by itself is not permission to flatten every episode.
- The complete result must have a lower Pi-estimated token count. Prefer removing large
tool output and superseded exploration before compressing useful dialogue.
- Preserve decisions, constraints, unresolved questions, file paths, commands still
needed, test results, provenance that explains conclusions, and the next action.
- Wait for the next
[LIVE CONTEXT]notice to confirm whether the edit was accepted.
Expected edit shape
Prefer a sparse patch over the existing conversation:
Avoid flattening independent episodes into one synthetic message:
The concise assistant replacements should remain separate blocks near the requests they answer. Existing good summaries should normally remain untouched in later revisions.
Edit cost
An accepted edit changes the request prefix, so the provider re-processes everything after the edit point on the next call and cached prefix tokens from that point on are recomputed. Consequences:
- One large batched compaction costs less than several small edits.
- Compact stale early turns before a long, still-useful tail accumulates below them.
- Make replacement summaries detailed. The text after the edit is re-processed either
way, so a thorough summary adds little cost and prevents repeated re-investigation.
Recommended method
If exact turn IDs are not already known, print only headers carrying the current document nonce. Do not use a broad grep '^\\[\\[': old tool output or documentation may contain header-shaped examples.
The script reads bodies locally but emits only the active metadata/header lines. Then use a script that locates blocks by their exact header IDs and replaces or removes them without retyping the old body.
For a larger compaction, still prefer several local replacements: summarize each stale investigation or tool-heavy episode in its original block, retain the surrounding user/assistant exchange, and delete only blocks whose value is captured nearby. A single script can perform all of these disjoint edits and write the mirror once. Only replace a whole span with one comprehensive summary when the user explicitly requested global consolidation. Use IDs returned by the nonce-filtered header listing. Do not invent IDs or duplicate blocks.
Durable continuity annotations
Before removing or rewriting an exact source that later work must revisit, call live_context_annotate with the source block ID from its current CTX_TURN header:
pinkeeps a bounded exact textual source visible;continuitykeeps its title, reason, next action, and recall ID visible while allowing
the source to be summarized;
archivekeeps no normal-context pointer and is available only through bounded recall.
Use live_context_recall only when the source is needed. Resolve an annotation once its future action is complete. An annotation complements a surgical edit; it is not a license to collapse unrelated messages.
What a durable summary should contain
Prefer concrete state over narrative. A future model turn should be able to continue from the summary without needing the removed output.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingsrc/skills/live-context/SKILL.md
Popularity
- Repository stars
- 69
- Repository forks
- 9
- 7-day trend score
- 26
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/lolipopshock/pi-clm/live-context)