prepare

A read-only command that asks another command-line AI agent to inspect a project and return a compact, structured summary for later work.

In plain words
What is it for?
Use it before a task when the agent needs to understand the project, such as preparing an authentication feature, refactoring a payment API, or investigating a database query.
Why use it?
It gives the main coding agent project context without changing files or filling its memory with every detail.

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/catlog22/claude-code-workflow/prepare
Clone the repo
git clone --depth 1 https://github.com/catlog22/Claude-Code-Workflow

Made for: Claude Code.

Per session 25 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,834 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.00025 $0.01834
Opus 5 $0.00013 $0.00917
Sonnet 5 $0.00005 $0.00367
Haiku 4.5 $0.00003 $0.00183

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

Security

Grade A, and why

prepare 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/memory/prepare.md · 241 lines

How it starts

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

Memory Prepare Command (/memory:prepare)

1. Overview

The memory:prepare command delegates to a universal-executor agent to analyze the project and return a structured "Core Content Pack". This pack is loaded into the main thread's memory, providing essential context for subsequent agent operations while minimizing token consumption.

Core Philosophy:

  • Agent-Driven: Fully delegates execution to universal-executor agent
  • Read-Only Analysis: Does not modify code, only extracts context
  • Structured Output: Returns standardized JSON content package
  • Memory Optimization: Package loaded directly into main thread memory
  • Token Efficiency: CLI analysis executed within agent to save tokens

2. Parameters

  • "task context description" (Required): Task description to guide context extraction

    • Example: "在当前前端基础上开发用户认证功能"
    • Example: "重构支付模块API"
    • Example: "修复数据库查询性能问题"
  • --tool <gemini|qwen> (Optional): Specify CLI tool for agent to use (default: gemini)

    • gemini: Large context window, suitable for complex project analysis
    • qwen: Alternative to Gemini with similar capabilities

3. Agent-Driven Execution Flow

The command fully delegates to universal-executor agent, which autonomously:

  1. Analyzes Project Structure: Executes get_modules_by_depth.sh to understand architecture
  2. Loads Documentation: Reads CLAUDE.md, README.md and other key docs
  3. Extracts Keywords: Derives core keywords from task description
  4. Discovers Files: Uses CodexLens MCP or rg/find to locate relevant files
  5. CLI Deep Analysis: Executes Gemini/Qwen CLI for deep context analysis
  6. Generates Content Package: Returns structured JSON core content package

4. Core Content Package Structure

Output Format - Loaded into main thread memory for subsequent use:

{
  "task_context": "在当前前端基础上开发用户认证功能",
  "keywords": ["前端", "用户", "认证", "auth", "login"],
  "project_summary": {
    "architecture": "TypeScript + React frontend with Vite build system",
    "tech_stack": ["React", "TypeScript", "Vite", "TailwindCSS"],
    "key_patterns": [
      "State management via Context API",
      "Functional components with Hooks pattern",
      "API calls encapsulated in custom hooks"
    ]
  },
  "relevant_files": [
    {
      "path": "src/components/Auth/LoginForm.tsx",
      "relevance": "Existing login form component",
      "priority": "high"
    },
    {
      "path": "src/contexts/AuthContext.tsx",
      "relevance": "Authentication state management context",
      "priority": "high"
    },
    {
      "path": "CLAUDE.md",
      "relevance": "Project development standards",
      "priority": "high"
    }
  ],
  "integration_points": [
    "Must integrate with existing AuthContext",
    "Follow component organization pattern: src/components/[Feature]/",
    "API calls should use src/hooks/useApi.ts wrapper"
  ],
  "constraints": [
    "Maintain backward compatibility",
    "Follow TypeScript strict mode",
    "Use existing UI component library"
  ]
}

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

Subscribe to this mod's changes

prepare is a command published in the GitHub repository catlog22/Claude-Code-Workflow (2,135 stars, last pushed 2mo ago), licensed MIT. It adds 25 tokens to every session and 1,834 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.