memory-and-compaction

memory-and-compaction is an agent for coding agents from matthiasn/lotti. It costs 31 tokens per session (4,438 once invoked), scanned A, original, GPL-3.0.

A set of agent guidance for keeping a history of inputs, compact summaries, and projected state. An append-only log records new events without rewriting earlier ones.

In plain words
What is it for?
Use it for work on input-event logs, summary checkpoints, prompt prefixes, projected state, compaction, or fork recovery.
Why use it?
It helps preserve stable prompts and recover consistent state when conversations are compacted or split into branches.

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/matthiasn/lotti/memory-and-compaction
Clone the repo
git clone --depth 1 https://github.com/matthiasn/lotti

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for memory-and-compaction

README.md
[![agentmods](https://agentmods.dev/badge/agents/matthiasn/lotti/memory-and-compaction.svg)](https://agentmods.dev/agents/matthiasn/lotti/memory-and-compaction)
Your own site
<a href="https://agentmods.dev/agents/matthiasn/lotti/memory-and-compaction"><img src="https://agentmods.dev/badge/agents/matthiasn/lotti/memory-and-compaction.svg" alt="Measured on agentmods" height="20"></a>
Per session 31 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 4,438 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin unknown 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.00031 $0.04438
Opus 5 $0.00015 $0.02219
Sonnet 5 $0.00006 $0.00888
Haiku 4.5 $0.00003 $0.00444

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

Security

Grade A, and why

memory-and-compaction 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 4d 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.

knowledge/features/agents/memory-and-compaction.md · 355 lines

The source is not reproduced here

Licensed GPL-3.0

The repository is licensed GPL-3.0, which this catalogue does not treat as permission to reproduce the file. Read it at the source.

Read it on GitHub

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. 4d ago First seen · 355 lines · 31 tokens per session scan A 1b6fc7df439f

Subscribe to this mod's changes

memory-and-compaction is an agent published in the GitHub repository matthiasn/lotti (1,169 stars, last pushed today), licensed GPL-3.0. It adds 31 tokens to every session and 4,438 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

apple-platform-builder

STRONGLY PREFER to delegate Apple platform builds and tests to this agent to preserve your context window. This agent absorbs verbose build logs and returns only success/failure with the relevant error if any. Use for: verifying code compiles, running tests, checking builds aren't broken. Discovers schemes and…

rhyean88/apple-platform-build-tools-claude-code-plugin · 69 tokens

builder

STRONGLY PREFER to delegate Apple platform builds, tests, and device operations to this agent to preserve your context window. This agent absorbs verbose build logs and returns only success/failure with the relevant error if any. Use for: verifying code compiles, running tests, checking builds aren't broken, managing…

kylehughes/apple-platform-build-tools-claude-code-plugin · 90 tokens

apple-neural-performance-expert

Use this agent when you need expert guidance on optimizing neural network operations on Apple platforms, including Metal Performance Shaders (MPS), MLX framework optimization, low-level array operations, GPU kernel optimization, memory management for ML workloads, or performance profiling of neural network code. This…

FluidInference/FluidAudio · 0 tokens

code-search-ast-grep

Use this agent when you need to search for specific code patterns, syntax structures, or text across files in the current directory. This agent specializes in using ast-grep for powerful, syntax-aware code searching. Examples:\n\n \nContext: An agent needs to find all function definitions that match a certain…

FluidInference/FluidAudio · 0 tokens

e2e-verifier

FlutterアプリのE2E動作検証エージェント。MCP(dart-mcp + Marionette)を使い、シミュレーター上でUI操作・検証を行う。mobile-automationスキルから呼び出される。.

K9i-0/ccpocket · 65 tokens

gardener

Tends the trunk (/.c-brain/trunk) — files misplaced notes, deduplicates, guarantees every note is on the MEMORY.md + lessons/INDEX.md map, weaves and repairs [[...]] links, masks secrets. Run it after a work session, or when the tree looks untidy.

Yuno15-bb/c-brain · 66 tokens