commit

A memory-capture procedure for a separate session created when the main conversation is shortened. It records useful decisions, bugs, patterns, and other durable facts in the memory system.

In plain words
What is it for?
Saving a small set of high-value project memories and linking them to related topics after context compaction.
Why use it?
It preserves important context that might otherwise be lost when a long conversation is compacted.

Command

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/gazmagik/claude-memory-plugin/commit
Clone the repo
git clone --depth 1 https://github.com/GaZmagik/claude-memory-plugin
Per session 11 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,703 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.00011 $0.01703
Opus 5 $0.00005 $0.00851
Sonnet 5 $0.00002 $0.00341
Haiku 4.5 $0.00001 $0.00170

Measured yesterday against content hash 71dd09def43d, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

commit 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 yesterday.

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.

commands/commit.md · 195 lines

How it starts

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

Memory Commit

Context

You are a FORKED SESSION running the PreCompact memory capture. The main session has already compacted and moved on. You cannot influence it.

Token budget: ~45k total, conversation already loaded. Be efficient.

CRITICAL: Do Not Reason About Main Session State

You will see conversation context that may include incomplete work, mid-task states, or TODOs. This is irrelevant to you. Your job is to:

  1. Extract memories from what was discussed
  2. Store them using memory scripts
  3. Link them to relevant hubs
  4. Exit

You are NOT responsible for:

  • Whether compaction should happen
  • The state of any in-progress work
  • What the main session should do next
  • Whether the codebase is "ready" for anything

The main session handles its own concerns. You are a historian, not an advisor. Just document and exit.


Instructions

Step 1: Scan Conversation (Mental Only)

Review the conversation you have in context. Identify 3-5 high-signal items max:

Worth capturing:

  • Architectural decisions with rationale
  • Gotchas/bugs that cost time to debug
  • Patterns that should be reused
  • Non-obvious insights or surprises

Skip:

  • Routine refactoring
  • Trivial fixes
  • Things already in memory
  • Obvious best practices

Step 1.5: Detect Relevant Hubs

Before creating memories, identify which hubs to link to. Run this once at the start:

# Get current branch and detect hubs
branch=$(git branch --show-current 2>/dev/null || echo "")
feature_hub=""
core_hub=""
HAS_FEATURE_HUB=false
HAS_CORE_HUB=false

# Extract feature number (e.g., feature/008-outstanding-orders-report -> 008)
if [[ "$branch" =~ ^feature/([0-9]+)- ]]; then
  feature_num="${BASH_REMATCH[1]}"
  feature_hub="artifact-feature-${feature_num}-hub"
  # Verify hub exists
  if memory read "$feature_hub" >/dev/null 2>&1; then
    HAS_FEATURE_HUB=true
    echo "Feature hub detected: $feature_hub"
  fi
fi

# Extract feature name for core hub (e.g., outstanding-orders-report -> outstanding-orders)
if [[ "$branch" =~ ^feature/[0-9]+-(.+)$ ]]; then
  feature_name="${BASH_REMATCH[1]}"
  core_name=$(echo "$feature_name" | sed 's/-report$//' | sed 's/-integration$//')
  core_hub="artifact-core-${core_name}-hub"
  # Verify hub exists
  if memory read "$core_hub" >/dev/null 2>&1; then
    HAS_CORE_HUB=true
    echo "Core hub detected: $core_hub"
  fi
fi

# Report hub status
if [[ "$HAS_FEATURE_HUB" == "false" && "$HAS_CORE_HUB" == "false" ]]; then
  echo "No hubs detected - memories will be created without hub links"
fi

Read the full file on GitHub · 195 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. yesterday First seen · 195 lines · 11 tokens per session scan A 71dd09def43d

Subscribe to this mod's changes

commit is a command published in the GitHub repository GaZmagik/claude-memory-plugin (6 stars, last pushed 5mo ago), licensed MIT. It adds 11 tokens to every session and 1,703 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-31.