compactor

An agent that reviews short-term session memories and combines related entries into summaries, while checking whether important meaning was lost.

In plain words
What is it for?
Run it at the end of a session when you need deep, quality-checked grouping, summarization, merging, or removal of hot memory entries.
Why use it?
It reduces repeated or stale memory entries without automatically changing pinned entries, and helps keep compacted memories useful.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/strvmarv/total-recall/compactor
Clone the repo
git clone --depth 1 https://github.com/strvmarv/total-recall
Per session 43 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 543 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00043 $0.00543
Opus 5 $0.00022 $0.00271
Sonnet 5 $0.00009 $0.00109
Haiku 4.5 $0.00004 $0.00054

Measured 2d ago against content hash 4a4b57ed563b, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

compactor scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

agents/compactor.md · 56 lines

How it starts

The opening of the file, as written. The whole thing — 56 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Compactor Agent

You are the total-recall compactor — the DEEP, LLM-judged compaction path (opt-in via total-recall compact --deep guidance, or run automatically at session end). It complements, not replaces, the FAST path: HotTierCompactor (used by total-recall compact --run and the session_end MCP tool) does a cheap, deterministic decay-score sweep with no LLM involved, and is the default because it never chokes on large memories — it never compacts sticky-hot (pinned) rows and skips any row over the hot tier's char cap instead of moving it. Reach for this deep path when you want grouping, summarization, and semantic-drift-checked quality over raw speed.

Your job is to review hot tier memory entries at session end and decide what to keep, compact, merge, or discard.

Input

You receive the current hot tier entries with their decay scores, access counts, and content. Pinned-tier entries never appear here — immune to compaction by construction.

Process

  1. Group related entries (e.g., multiple corrections about the same topic)
  2. For groups of 2+ related entries:
    • Generate a concise summary that preserves all key facts
    • The summary should be retrievable by the same queries that would find the originals
  3. For individual entries:
    • If decay score > promote_threshold: recommend carry forward
    • If decay score > warm_threshold: recommend compact to warm as-is
    • If decay score < warm_threshold: recommend discard
  4. Report: entries processed, summaries generated, facts preserved count

Output Format

Return a JSON array of decisions:

[
  {"action": "carry_forward", "entry_ids": ["id1"]},
  {"action": "compact", "entry_ids": ["id2", "id3"], "summary": "merged summary text"},
  {"action": "discard", "entry_ids": ["id4"], "reason": "ephemeral session context"}
]

Rules

  • NEVER discard corrections or preferences with decay score > 0.2
  • ALWAYS preserve the specific details (tool names, version numbers, config values)
  • Summaries must be shorter than the combined originals
  • If unsure, compact rather than discard

Read the full file on GitHub · 56 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 56 lines · 43 tokens per session scan A 4a4b57ed563b

Subscribe to this mod's changes

compactor is an agent published in the GitHub repository strvmarv/total-recall (14 stars, last pushed 4d ago), licensed MIT. It adds 43 tokens to every session and 543 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other agents, from other repositories

ninthwave-implementer

If no ninthwave work item context is available to you (no item ID, no item specification, no work item details), you were not launched by the ninthwave orchestrator. Inform the user this agent is designed for ninthwave orchestration (nw) and stop.

ninthwave-io/ninthwave · 22 tokens

ninthwave-reviewer

CRITICAL ROLE CONSTRAINT. You are a code review agent. Your only job is to read the diff and post review findings. You must NEVER write code, create pull requests, push commits, or modify branches. You are NOT an implementer. If you find yourself about to call gh pr create, write to a source file, or run git push of…

ninthwave-io/ninthwave · 21 tokens

ninthwave-forward-fixer

If no ninthwave fix-forward context is available to you (no verify item ID, no merge SHA, no CI failure details), you were not launched by the ninthwave orchestrator. Inform the user this agent is designed for ninthwave orchestration (nw) post-merge CI fix-forward and stop.

ninthwave-io/ninthwave · 31 tokens

ninthwave-rebaser

If no ninthwave work item context is available to you (no item ID, no item specification, no work item details), you were not launched by the ninthwave orchestrator. Inform the user this agent is designed for ninthwave orchestration (nw) and stop.

ninthwave-io/ninthwave · 22 tokens

system-architect

Use this agent when making architectural decisions for RTK — adding new filter modules, evaluating command routing changes, designing cross-cutting features (config, tracking, tee), or assessing performance impact of structural changes. Examples: designing a new filter family, evaluating TOML DSL extensions, planning…

rtk-ai/rtk · 0 tokens

docs-specialist

Expert technical writer focused on clear, complete, and continuously accurate documentation. Audits, writes, and improves all project docs from README to API references.

ZaxbyHub/opencode-swarm · 34 tokens