memory-save

A command that saves an important idea or decision from the current conversation as a small, organized memory in Forgetful.

In plain words
What is it for?
Use it to capture decisions, insights, or recurring patterns for later retrieval and linking.
Why use it?
It helps prevent useful context from being lost and checks related memories before adding a duplicate or outdated one.

Command

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 commands/scottrbk/forgetful/memory-save
Clone the repo
git clone --depth 1 https://github.com/ScottRBK/forgetful
Per session 10 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 977 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.00010 $0.00977
Opus 5 $0.00005 $0.00489
Sonnet 5 $0.00002 $0.00195
Haiku 4.5 $0.00001 $0.00098

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

Security

Grade A, and why

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

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

docs/opencode/commands/memory-save.md · 121 lines

How it starts

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

Save Memory

Create an atomic memory from the current conversation context.

Your Task

  1. Analyze the conversation for the key insight/decision/pattern to capture
  2. Check for existing related memories that might be affected
  3. Create the memory with proper curation

User guidance: $ARGUMENTS

Pre-Creation: Check for Existing Memories

Before creating, query for related memories:

execute_forgetful_tool("query_memory", {
  "query": "<topic of new memory>",
  "query_context": "Checking for existing memories before creating new one",
  "k": 5,
  "include_links": true
})

Analyze results to determine if the new memory would:

  • Invalidate an existing memory (mark it obsolete with mark_memory_obsolete)
  • Update an existing memory (use update_memory instead of creating new)
  • Supersede an existing memory (create new, then mark old as obsolete with superseded_by)
  • Complement existing memories (create new and potentially link_memories)

Atomic Memory Principles (Zettelkasten)

Before creating, verify the memory passes the atomicity test:

  • Can you understand the idea at first glance?
  • Can you easily title it in 5-50 words?
  • Does it represent ONE concept/fact/decision?

Memory Constraints

  • Title: Max 200 characters - short, searchable phrase
  • Content: Max 2000 characters (~300-400 words) - single concept
  • Context: Max 500 characters - WHY this matters
  • Keywords: Max 10 - for semantic clustering
  • Tags: Max 10 - for categorization

Importance Scoring Guide

  • 9-10: Personal facts, foundational architectural patterns
  • 8-9: Critical technical solutions, major architectural decisions
  • 7-8: Useful patterns, strong preferences, tool choices
  • 6-7: Project milestones, specific solutions
  • 5-6: Minor context (use sparingly)

Process

  1. Query existing memories on the topic
  2. Analyze if this is new knowledge, an update, or supersedes existing
  3. Draft a memory following atomic principles
  4. Present the draft with curation plan:
    Existing memories found:
    - Memory #42: "Previous auth decision" - will be marked obsolete (superseded)
    
    Ready to save this memory:
    
    Title: [proposed title]
    Content: [proposed content]
    Context: [why this matters]
    Keywords: [keyword1, keyword2, ...]
    Tags: [tag1, tag2, ...]
    Importance: [score with reasoning]
    Project: [if applicable]
    
    Curation actions:
    - Mark #42 obsolete (superseded by new memory)
    - Link to #38 (related pattern)
    
    Confirm? (y/n/edit)
    
  5. Execute the curation plan after user confirms
  6. Report the result including any auto-linked memories

Read the full file on GitHub · 121 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 · 121 lines · 10 tokens per session scan A ed865c0a5493

Subscribe to this mod's changes

memory-save is a command published in the GitHub repository ScottRBK/forgetful (296 stars, last pushed 7d ago), licensed MIT. It adds 10 tokens to every session and 977 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-08-30.