memory

memory is a skill for Claude Code, Codex from HKUDS/nanobot. It costs 14 tokens per session (445 once invoked), scanned A, original, MIT.

A skill for searching past conversations and reading profile and memory files managed by Dream. It covers both long-term notes and an append-only history log.

In plain words
What is it for?
Finding relevant past events, checking saved user or project information, and using conversation history during a task.
Why use it?
It helps recover earlier decisions, events, and user preferences instead of relying only on the current conversation.

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

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/hkuds/nanobot/memory.svg)](https://agentmods.dev/skills/hkuds/nanobot/memory)
Your own site
<a href="https://agentmods.dev/skills/hkuds/nanobot/memory"><img src="https://agentmods.dev/badge/skills/hkuds/nanobot/memory.svg" alt="Measured on agentmods" height="20"></a>
Per session 14 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 445 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.00014 $0.00445
Opus 5 $0.00007 $0.00222
Sonnet 5 $0.00003 $0.00089
Haiku 4.5 $0.00001 $0.00044

Measured 4d ago against content hash 0946a34d4519, 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 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.

nanobot/skills/memory/SKILL.md · 39 lines

What it actually says

Memory

Structure

  • SOUL.md — Bot personality and communication style. Managed by Dream. Do NOT edit.
  • USER.md — User profile and preferences. Managed by Dream. Do NOT edit.
  • memory/MEMORY.md — Long-term facts (project context, important events). Managed by Dream. Do NOT edit.
  • memory/history.jsonl — append-only JSONL, not loaded into context. Prefer the built-in grep tool to search it.

Search Past Events

Use the History log path shown in the system prompt. Always pass it to grep; never substitute a different project-relative memory/history.jsonl, which may belong to the selected project. Each JSONL line contains cursor, timestamp, and content.

  • For broad searches, start with output_mode="count" or the default files_with_matches mode before expanding to full content
  • Use output_mode="content" plus context_before / context_after when you need the exact matching lines
  • Use fixed_strings=true for literal timestamps or JSON fragments
  • Use head_limit / offset to page through long histories

Examples (replace <history-log-path> with the path from the system prompt):

  • grep(pattern="keyword", path="<history-log-path>", case_insensitive=true)
  • grep(pattern="2026-04-02 10:00", path="<history-log-path>", fixed_strings=true)
  • grep(pattern="keyword", path="<history-log-path>", output_mode="count", case_insensitive=true)
  • grep(pattern="oauth|token", path="<history-log-path>", output_mode="content", case_insensitive=true)

Important

  • Do NOT edit SOUL.md, USER.md, or MEMORY.md. They are automatically managed by Dream.
  • If you notice outdated information, it will be corrected when Dream runs next.
  • Users can view Dream's activity with the /dream-log command.
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 · 39 lines · 14 tokens per session scan A 0946a34d4519

Subscribe to this mod's changes

memory is a skill published in the GitHub repository HKUDS/nanobot (47,620 stars, last pushed 2d ago), licensed MIT. It adds 14 tokens to every session and 445 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.