hmem-write

A procedure for saving lessons, errors, decisions, and project notes in Hmem, a local long-term memory system for AI agents.

In plain words
What is it for?
It is for deciding how a memory entry should be labelled and nested before sending it to the memory-writing tool.
Why use it?
It prevents duplicate or misplaced memory entries and avoids directly changing the memory database in a way that could damage its structure.

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/bumblebiber/hmem/hmem-write
Any agent
npx skills add Bumblebiber/hmem --skill hmem-write
Clone the repo
git clone --depth 1 https://github.com/Bumblebiber/hmem

Made for: Claude Code, Codex.

Per session 77 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 7,461 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.00077 $0.07461
Opus 5 $0.00039 $0.03730
Sonnet 5 $0.00015 $0.01492
Haiku 4.5 $0.00008 $0.00746

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

Security

Grade A, and why

hmem-write 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/hmem-write/SKILL.md · 614 lines

How it starts

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

How to use write_memory

Call the MCP tool write_memory to save lessons, errors, decisions, or project insights to long-term memory.

If write_memory is not available:

  1. Tell the user: "write_memory tool not found. Please reconnect the MCP server (in Claude Code: /mcp, in other tools: restart the tool)."
  2. NEVER write directly to the .hmem SQLite file via shell commands. The database has WAL journaling, integrity checks, and tree-structure logic that raw SQL INSERT will bypass — causing corruption or data loss.

Syntax

write_memory(
  prefix: "E",
  content: "Short Title (~50 chars)\n\nL1 body — detailed explanation, can span multiple lines\nsecond body line with more context\n\tL2 node title\n\n\tL2 body text (supports newlines)\n\tmore L2 body\n\t\tL3 detail (2 tabs)\n\t\t\tL4 raw data (3 tabs — rarely needed)"
)

Title + Body convention (git-commit style): Every node has a title (short navigation label) and an optional body (detailed content loaded on drill-down). Separate them with a blank line — just like a git commit message.

  • Title: The first line (L1) or first line at a given indent level (L2+). ~50 chars, like a chapter title.
  • Body: Everything after the blank line at the same indent level. Freetext, no special prefix needed. Shown only when the node is drilled into, not in listings.
  • Legacy > prefix: Still works for backward compatibility, but blank-line separation is preferred.
  • Without body: The full text is stored as content and the title is auto-extracted from the first maxTitleChars characters.

L1 example with body:

Short Error Title

SQLite connection failed because .mcp.json used a relative path.
The fix was to use an absolute path in the HMEM_PATH env var.
	Details about reproduction

	Steps: 1. Set HMEM_PATH=./hmem  2. Run hmem serve  3. Observe SQLITE_CANTOPEN

L1 example without body (still works):

SQLite connection failed due to wrong path in .mcp.json
	Fix: use absolute path in env var

Read the full file on GitHub · 614 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 · 614 lines · 77 tokens per session scan A 531295803fab

Subscribe to this mod's changes

hmem-write is a skill published in the GitHub repository Bumblebiber/hmem (24 stars, last pushed 1mo ago), licensed MIT. It adds 77 tokens to every session and 7,461 once invoked, about $0.0004 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 skills, from other repositories

omh-jit-learn

This is a Hermes-native jit-learn workflow skill.

rlaope/oh-my-hermes · 78 tokens

omh-curriculum-design

This is a Hermes-native curriculum-design workflow skill.

rlaope/oh-my-hermes · 57 tokens

story-long-analyze

长篇网文拆文。深度拆解爆款长篇小说的黄金三章、人设架构、爽点设计、节奏控制。 单一深度拆解管道:跑完黄金三章(Stage 1)后产出快速预览报告并询问是否继续全量拆解, 确认后从 Stage 2 续跑逐章摘要、聚合分析、设定关系、汇总报告,全程产物落盘 拆文库/{书名}/。 触发方式:/story-long-analyze、/长篇拆文、「帮我拆这本书」「拆这本书」「分析黄金三章」 「深度拆解」「完整拆解」「系统拆解」或提供小说文本文件路径——全部进入同一管道。.

uu201/character-arc · 175 tokens

learn

Guided, hands-on course teaching architects how to use Codex or Claude Code — six short modules, each built around an exercise on a bundled sandbox project (a fictional Brooklyn art museum expansion). Resumable across sessions via PROGRESS.md. Use when the user runs $learn or /as:learn, says they're new to AI-assisted…

AlpacaLabsLLC/skills-for-architects · 80 tokens

pneuma-bansho

Explain something by writing it on a board. Use for ANY task in this workspace — writing or extending board.md, correcting or re-explaining a stretch of the lecture, giving it a voice, exporting subtitles, restyling theme.css. Trigger whenever the user wants a thing explained rather than documented: 板书, 讲一讲, 白板上讲…

pandazki/pneuma-skills · 150 tokens

beamer-academic

Generate high-quality academic Beamer slides from a thesis/paper (PDF, Word, or LaTeX source). Compatible with Claude Code and Codex. Supports thesis defense, proposal presentations, and conference talks. Built-in layout library with 13 professional page types, 5 color schemes, and interactive editing loop. Use when…

Faust-Donf/beamer-academic · 148 tokens