speckit.memory-md.prepare-context

speckit.memory-md.prepare-context is a command for Claude Code from DyanGalih/spec-kit-memory-hub. It costs 19 tokens per session (365 once invoked), scanned A, original, MIT.

A context-preparation command that refreshes a project’s memory cache, optionally searches it, and creates summaries for a feature. The cache stores project information so the agent can retrieve relevant context without reading everything.

In plain words
What is it for?
Use it before working on a feature, especially when you need prior decisions, project constraints, or related documentation.
Why use it?
It reduces the manual work of gathering technical and historical context before a task. It also produces focused summaries for the feature and its documentation.

Command for Claude Code

Written for Claude Code: a Claude Code command (commands/*.md).

Good fit Use it before working on a feature, especially when you need prior decisions, project constraints, or related documentation.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/dyangalih/spec-kit-memory-hub/speckit.memory-md.prepare-context
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.

Clone the repo
git clone --depth 1 https://github.com/DyanGalih/spec-kit-memory-hub

Made for: Claude Code.

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 speckit.memory-md.prepare-context

README.md
[![agentmods](https://agentmods.dev/badge/commands/dyangalih/spec-kit-memory-hub/speckit.memory-md.prepare-context/github.svg)](https://agentmods.dev/commands/dyangalih/spec-kit-memory-hub/speckit.memory-md.prepare-context)
Your own site
<a href="https://agentmods.dev/commands/dyangalih/spec-kit-memory-hub/speckit.memory-md.prepare-context"><img src="https://agentmods.dev/badge/commands/dyangalih/spec-kit-memory-hub/speckit.memory-md.prepare-context/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 speckit.memory-md.prepare-context

Your own site · 80×15
<a href="https://agentmods.dev/commands/dyangalih/spec-kit-memory-hub/speckit.memory-md.prepare-context"><img src="https://agentmods.dev/badge/commands/dyangalih/spec-kit-memory-hub/speckit.memory-md.prepare-context.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 19 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 365 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.00019 $0.00365
Opus 5 $0.00010 $0.00182
Sonnet 5 $0.00004 $0.00073
Haiku 4.5 $0.00002 $0.00036

Measured 9d ago against content hash 6fb3ff589fae, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

speckit.memory-md.prepare-context 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 9d 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.

commands/speckit.memory-md.prepare-context.md · 36 lines

What it actually says

Prepare Context

Use this command to prepare the technical and historical context for the current task. It handles first-time setup, incremental refresh, and post-upgrade scenarios automatically through MCP cache tools.

Usage

Run this command by providing the feature directory and an optional search query.

/speckit.memory-md.prepare-context --feature specs/<feature> --query "<optional_search_terms>"

MCP-Managed Flow

Use MCP tools for the full cache lifecycle:

  1. Refresh Cache: Call speckit_memory_refresh_cache(scope="all").
  2. Search Memory (Optional): If a custom query is provided, call speckit_memory_search(query="<query>").
  3. Memory Synthesis: Call speckit_memory_synthesize(feature="specs/<feature>", query="<optional query>").
  4. Doc Synthesis: Call speckit_memory_synthesize_docs(feature="specs/<feature>").
  5. Read Results: Read the returned memory-synthesis.md and doc-synthesis.md output paths.

Token Banner: Show the baseline / cached / saved token summary after the synthesis step so the savings stay visible during normal runs.

Orchestration Note

This command is automatically executed by spec-kit-architecture-guard as part of its governed-* workflows. Manual execution is optional and typically only necessary if you need to refresh context or synthesis results outside of a formal governed turn.

Goal

Ensure the agent has the latest "Why" and "How" from durable memory before proposing any changes or review findings.

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. 9d ago First seen · 36 lines · 19 tokens per session scan A 6fb3ff589fae

Subscribe to this mod's changes

speckit.memory-md.prepare-context is a command published in the GitHub repository DyanGalih/spec-kit-memory-hub (15 stars, last pushed 3mo ago), licensed MIT. It adds 19 tokens to every session and 365 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-30.