memory

A long-term memory skill that selects important events from the agent’s work and stores them in a JSONL file, which is a text file containing one JSON record per line. Older memories gradually become less prominent unless they are used again.

In plain words
What is it for?
It helps review workspace context, identify high-value events, append them to state/memory.jsonl, and maintain memory using forgetting and reinforcement rules.
Why use it?
It helps the agent retain important outcomes across separate tasks without treating every detail as equally important. Repeatedly accessed information receives more reinforcement.

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/xiaoluolyg/god/memory
Any agent
npx skills add XiaoLuoLYG/GOD --skill memory
Clone the repo
git clone --depth 1 https://github.com/XiaoLuoLYG/GOD

Made for: Claude Code, Codex.

Per session 17 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,999 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.00017 $0.01999
Opus 5 $0.00009 $0.01000
Sonnet 5 $0.00003 $0.00400
Haiku 4.5 $0.00002 $0.00200

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

Security

Grade A, and why

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

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/memory_maintenance.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

agentsociety/packages/agentsociety2/agentsociety2/agent/skills/memory/SKILL.md · 215 lines

How it starts

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

Memory

You are the agent's long-term memory system with automatic forgetting and retrieval reinforcement. When you run this skill, decide what's worth remembering and append it to state/memory.jsonl.

Internal Logic (One Sentence)

Select a small set of high-signal events from this tick, append them to state/memory.jsonl, then rely on a maintenance script to combine Ebbinghaus-style retention decay with ACT-R base-level activation from repeated presentation or retrieval.

Architecture (conceptual)

Three layers:

1. Working context (implicit)

  • What: Recent tool-loop messages plus any workspace files you choose to read in this step.
  • Purpose: Immediate reasoning; there is no separate hidden memory buffer beyond workspace + thread.
  • Usage: Read only files that exist; skip missing paths.

2. Long-term store (state/memory.jsonl)

  • What: JSONL in the agent workspace with automatic forgetting.
  • Purpose: Persist what should survive across ticks (events, decisions, plan outcomes).
  • Forgetting: Old memories fade and are eventually removed (see Forgetting and Activation below).
  • Reinforcement: Frequently accessed or repeated memories are reinforced and last longer.

3. Optional "step bundle" (convention)

  • If you want one rich JSONL line per tick, you may bundle highlights into summary from whatever files you read in this step-purely optional.

Forgetting and Activation

Memories naturally decay over time, but repeated experience and retrieval should make a memory easier to recover. This skill therefore uses two complementary signals:

  • Ebbinghaus-style retention for simple time decay.
  • ACT-R base-level activation for repeated presentation/retrieval.

Research basis: references/research_basis.md.

Retention Formula

retention = e^(-t / (S x importance_multiplier))

Where:

  • t = ticks since memory creation
  • S = memory strength coefficient (default: 100 ticks, configurable via AGENT_MEMORY_STRENGTH env var)
  • importance_multiplier = high: 1.5, medium: 1.0, low: 0.5

Read the full file on GitHub · 215 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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 · 215 lines · 17 tokens per session scan A d27c4d982727

Subscribe to this mod's changes

memory is a skill published in the GitHub repository XiaoLuoLYG/GOD (1,091 stars, last pushed 5d ago), licensed Apache-2.0. It adds 17 tokens to every session and 1,999 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.