memory-processor

memory-processor is a skill for Claude Code, Codex from CraftOS-dev/CraftBot. It costs 16 tokens per session (2,620 once invoked), scanned A, original, MIT.

A batch-processing workflow that turns raw event records into selected long-term memories stored in memory files.

In plain words
What is it for?
Use it to process event batches, append distilled memories, remove processed records, and validate the cleanup.
Why use it?
It reduces a stream of events into a smaller set of important information that can be retained and reused later.

Skill for Claude CodeCodex

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 skills/craftos-dev/craftbot/memory-processor
Any agent
npx skills add CraftOS-dev/CraftBot --skill memory-processor
Clone the repo
git clone --depth 1 https://github.com/CraftOS-dev/CraftBot

Made for: Claude Code, Codex.

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-processor

README.md
[![agentmods](https://agentmods.dev/badge/skills/craftos-dev/craftbot/memory-processor.svg)](https://agentmods.dev/skills/craftos-dev/craftbot/memory-processor)
Your own site
<a href="https://agentmods.dev/skills/craftos-dev/craftbot/memory-processor"><img src="https://agentmods.dev/badge/skills/craftos-dev/craftbot/memory-processor.svg" alt="Measured on agentmods" height="20"></a>
Per session 16 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,620 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.1 $0.00016 $0.02620
Opus 5 $0.00008 $0.01310
Sonnet 5 $0.00003 $0.00524
Haiku 4.5 $0.00002 $0.00262

Measured 2d ago against content hash f24d109a5e2b, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

memory-processor 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.

skills/memory-processor/SKILL.md · 247 lines

How it starts

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

Memory Processor

The only way for agent to save event into long-term memory.

Files

  • agent_file_system/EVENT_UNPROCESSED.md - Source (read & clear batches)
  • agent_file_system/MEMORY.md - Destination (append distilled memories)

Todo Tracking (REQUIRED)

Use update_todos to track progress. Create todos at start, update as you go.

Initial todos (create after reading first batch):

1. [pending] Process and loop for each batch (25~50 lines).
2. [pending] Validate and cleanup
3. [pending] Complete task

After each batch: Mark current as completed, add next batch if more events exist.

Batch Processing Workflow

Process 50 lines at a time to avoid memory issues.

Steps:

  1. Read first batch: read_file EVENT_UNPROCESSED.md, offset=11, limit=50
  2. Create todos: Use update_todos to create initial todo list
  3. Loop for each batch:
    • Distill batch: Apply rules below, extract IMPORTANT memories only
    • Append memories: stream_edit MEMORY.md (append only)
    • Remove batch: stream_edit EVENT_UNPROCESSED.md (delete lines 12-61)
    • Update todos: Mark batch completed, add next batch if more events
  4. Validation (mark todo in_progress):
    • Validate no more unprocessed events in EVENT_UNPROCESSED.md
    • Validate no duplicated memory in MEMORY.md
  5. End task: end_turn when validation passes

Rules

  • Silent background task. NEVER use send_message or interact with user.
  • Immediately discard these event types:
    • [reasoning], [action_start], [gui_action], [screen_description]
    • [agent message] - agent responses are NEVER saved
    • Greetings, small talk, acknowledgments ("hi", "thanks", "ok")
    • Screen descriptions ("The current screen displays...")
    • Truncated text ending in ...
  • [user message] lines are NEVER discarded by type. They are the PRIMARY source of memories: apply the distillation rules to the CONTENT of every [user message] line. A user message that contains a preference, fact, contact, decision, or dated event MUST produce a distilled memory even when it is phrased inside an ordinary request (e.g. "I'm allergic to peanuts, find me a lunch spot" → save the allergy, discard the request).

Read the full file on GitHub · 247 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 · 247 lines · 16 tokens per session scan A f24d109a5e2b

Subscribe to this mod's changes

memory-processor is a skill published in the GitHub repository CraftOS-dev/CraftBot (378 stars, last pushed 2d ago), licensed MIT. It adds 16 tokens to every session and 2,620 once invoked, about $0.0001 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-09-03.