hf.memory

A command that extracts important decisions, bug causes, configuration choices, code patterns, and workflow preferences from a coding conversation. It saves them as entries in a local JSONL file, a text format with one JSON record per line.

In plain words
What is it for?
Use it after a discussion to record decisions, explanations of fixes, repository conventions, or team workflow preferences for later memory synchronization.
Why use it?
It preserves useful context between sessions and checks existing entries first to reduce duplicates. This avoids having to rediscover the same project knowledge later.

Command for Claude Code

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 commands/t-rav/hydraflow/hf.memory
Clone the repo
git clone --depth 1 https://github.com/T-rav/hydraflow

Made for: Claude Code.

Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 896 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.00000 $0.00896
Opus 5 $0.00000 $0.00448
Sonnet 5 $0.00000 $0.00179
Haiku 4.5 $0.00000 $0.00090

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

Security

Grade A, and why

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

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.

.claude/commands/hf.memory.md · 89 lines

How it starts

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

Capture Session Learnings as Memory Suggestions

Scan the current conversation for architectural decisions, bug root causes, configuration choices, codebase patterns, and workflow preferences. Write each as a memory item to the local JSONL store for ingestion by the memory sync worker.

Usage

/hf.memory
/hf.memory review model decisions

$ARGUMENTS optionally filters extraction to a specific topic. If empty, scan the full conversation.

Instructions

Phase 0: Resolve Configuration

Before doing anything else, resolve these values:

  1. REPO: Run echo "$HYDRAFLOW_GITHUB_REPO". If empty, run git remote get-url origin and extract the owner/repo slug (strip https://github.com/ prefix and .git suffix).
  2. DATA_ROOT: The HydraFlow data directory. Check echo "$HYDRAFLOW_DATA_ROOT". If empty, default to .hydraflow/<repo_slug>/ relative to repo root (where / in the slug is replaced with -).

Phase 1: Fetch Existing Memories for Dedup

Load existing memory items from the local JSONL store to avoid duplicates:

cat "$DATA_ROOT/memory/items.jsonl" 2>/dev/null | jq -r '.title' | sort -u

Keep these titles in mind — skip any learning that substantially overlaps with an existing item.

Phase 2: Extract Learnings from Conversation

Scan the full conversation history (or filter to $ARGUMENTS topic if provided). Look for these categories:

  1. Architectural decisions — choices about how the system is structured
  2. Bug root causes and fixes — what broke, why, and how it was fixed
  3. Configuration insights — what settings mean and why they're set that way
  4. Codebase patterns — recurring patterns that future agents should follow
  5. Workflow preferences — how the developer wants things done

For each learning, formulate:

  • title: Short description (under 60 chars)
  • learning: What was learned and why it matters (1-3 sentences)
  • context: How it was discovered — reference specific issues, PRs, files, or conversation topics
  • memory_type: One of knowledge, config, instruction, code

Read the full file on GitHub · 89 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 · 89 lines · 0 tokens per session scan A a652cc591b77

Subscribe to this mod's changes

hf.memory is a command published in the GitHub repository T-rav/hydraflow (5 stars, last pushed 2d ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 896 tokens. 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-31.