Skillquality 0.47

session-memory-first-compaction

Attempt session-memory compaction before full conversation compaction so lightweight summaries win when available.

Price
free
Protocol
skill
Verified
no

What it does

SKILL: Session Memory First Compaction

Domain: context-management
Trigger: Apply when an auto-compact flow can query a session-memory summary before running the heavier legacy compaction path. Source Pattern: Distilled from reviewed lightweight summary-first and fallback compaction implementations.

Core Method

When auto-compaction fires, try the lightweight session-memory summary path first. If it returns a usable summary, treat that as a successful compaction and skip the heavier full-conversation compaction path. Only fall back to the heavyweight path when the lightweight summary is unavailable. This keeps cached or precomputed summaries in charge whenever possible and reserves the costly path for true misses.

Key Rules

  • Try the lightweight session-memory compaction path before the heavyweight full-conversation path every time auto-compaction triggers.
  • On success, reset last summarized IDs and run any post-compact cleanup to keep boundary metadata in sync.
  • Notify prompt-cache break detection so repeated compactions don’t misreport context flushes.
  • Return early with wasCompacted: true so callers skip the fallback path.
  • Only fall through to compactConversation when session memory compaction returns null.

Example Application

Auto-compaction finds a fresh session-memory summary, accepts it as the compaction result, records success, and avoids calling the heavyweight compaction path at all.

Anti-Patterns (What NOT to do)

  • Don’t always run the heavyweight compaction first; you waste CPU and risk prompt-too-long errors that session memory could avoid.
  • Don’t skip the cleanup steps that reset lastSummarizedMessageId and notify cache detectors when the lightweight path wins.

Capabilities

skillsource-ychampionskill-session-memory-first-compactiontopic-agent-skillstopic-ai-agentstopic-clitopic-coding-agentstopic-context-engineeringtopic-developer-toolstopic-mcptopic-multi-agenttopic-terminal-ui

Install

Quality

0.47/ 1.00

deterministic score 0.47 from registry signals: · indexed on github topic:agent-skills · 34 github stars · SKILL.md body (1,747 chars)

Provenance

Indexed fromgithub
Enriched2026-04-22 00:56:56Z · deterministic:skill-github:v1 · v1
First seen2026-04-18
Last seen2026-04-22

Agent access