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 1mo 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 1mo 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. 1mo 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 2mo 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

Other skills, from other repositories

kayba-ace

This skill ships learnfromtraces.py, a script that reads OpenClaw session transcripts, feeds them through the ACE learning pipeline, and writes an updated skillbook to disk.

kayba-ai/agentic-context-engine · 0 tokens

nornweave-api

Give AI agents their own email inboxes using the NornWeave API. Use when building email agents, sending/receiving emails programmatically, managing inboxes, retrieving threads, searching messages, or integrating with email providers (Mailgun, SES, SendGrid, Resend). NornWeave provides LLM-ready markdown parsing and…

DataCovey/nornweave · 77 tokens

faf-expert

Expert in .faf (Foundational AI-context Format) files for persistent project context. Use when working with .faf files, project DNA, CLAUDE.md bi-sync, faf-cli commands, MCP server configuration, or AI-readiness scoring (0-100%). Updated for v2.8.0 Tool Visibility System.

Wolfe-Jam/grok-faf-mcp · 69 tokens

rekal-init

Bootstrap rekal memory for a project. Scans the codebase for architecture, conventions, dependencies, workflows, and config, then stores durable knowledge as properly typed, tagged, deduplicated memories. Use when starting rekal on a new project, or when user says "init rekal", "bootstrap memory", "populate rekal"…

janbjorge/rekal · 83 tokens

rekal-save

End-of-session memory capture with deduplication. Extracts durable knowledge, checks for duplicates, stores or replaces as appropriate. Use whenever a session wraps up, a task finishes, or the user says goodbye/thanks/done. Also use when significant preferences, decisions, or discoveries emerge mid-session. Make sure…

janbjorge/rekal · 79 tokens

rekal-hygiene

Periodic memory maintenance and cleanup. Finds duplicates, contradictions, and quality issues in the memory database. Proposes fixes for user approval. Never auto-deletes or auto-modifies. Use when user says "clean up memories", "memory maintenance", "check memory health", or invokes /rekal-hygiene. Run monthly or…

janbjorge/rekal · 77 tokens