hmem-write

hmem-write is a skill for Claude Code, Codex from Bumblebiber/hmem. It costs 77 tokens per session (7,461 once invoked), scanned A, original, MIT.

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

Written for no agent in particular: nothing here depends on one. Also seen: mentions CLAUDE.md; mentions subagents; mentions Claude Code.

Good fit It is for deciding how a memory entry should be labelled and nested before sending it to the memory-writing tool.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/bumblebiber/hmem/hmem-write
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.

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.

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 hmem-write

README.md
[![agentmods](https://agentmods.dev/badge/skills/bumblebiber/hmem/hmem-write/github.svg)](https://agentmods.dev/skills/bumblebiber/hmem/hmem-write)
Your own site
<a href="https://agentmods.dev/skills/bumblebiber/hmem/hmem-write"><img src="https://agentmods.dev/badge/skills/bumblebiber/hmem/hmem-write/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for hmem-write

Your own site · 80×15
<a href="https://agentmods.dev/skills/bumblebiber/hmem/hmem-write"><img src="https://agentmods.dev/badge/skills/bumblebiber/hmem/hmem-write.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
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. A grade says what 26 rules found in the file — not that it is safe.
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.00077 $0.07461
Opus 5.5 $0.00031 $0.02984
Sonnet 5.5 $0.00015 $0.01492
Haiku 4.5 $0.00008 $0.00746

Measured 3mo ago against content hash 531295803fab, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 3mo 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. 3mo 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.0003 per session on Opus 5.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

hmem-write compared with skills from other repositories

hmem-write next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
hmem-writeBumblebiber/hmemSkill241mo agoMITA77Claude Code, Codex
kayba-acekayba-ai/agentic-context-engineSkill2.6k2mo agoApache-2.0A0Claude Code, Codex
nornweave-apiDataCovey/nornweaveSkill312d agoApache-2.0A77Claude Code, Codex
post-cortex-memoryjulymetodiev/post-cortexSkill233d agoMITA194Claude Code
faf-expertWolfe-Jam/grok-faf-mcpSkill19todayMITA95Claude Code, Codex
alice-memorysamrusani/AliceMemorySkill7todayMITA28Claude Code, Codex
alice-project-memorysamrusani/AliceMemorySkill7todayMITA33Claude Code, Codex