memory: Command for Claude Code

.claude/commands/reflect.md

reflect is a command for Claude Code from spideynolove/memory. It costs 13 tokens per session (1,335 once invoked), scanned B, original, MIT.

A command that reviews diary entries to find recurring patterns and suggest changes to CLAUDE.md, a project file containing instructions for the coding assistant.

In plain words
What is it for?
Use it to review recent or date-filtered diary entries, identify patterns, and prepare proposed updates to project rules.
Why use it?
It turns repeated experiences into documented project guidance instead of relying on the assistant to remember them informally.

Command for Claude Code

Written for Claude Code: installed under .claude/. Also seen: mentions CLAUDE.md.

This is spideynolove/memory's own configuration. It tells Claude Code how to work on memory itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything memory configures →

Not installable: its command points at a path on the author’s own machine, so it runs nowhere else. The line is /home/hung/MCPs/memory.

Reuse

Borrowing it

Nothing to install: this file belongs to spideynolove/memory. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/spideynolove/memory/main/.claude/commands/reflect.md
Clone the repo
git clone --depth 1 https://github.com/spideynolove/memory

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 reflect

README.md
[![agentmods](https://agentmods.dev/badge/commands/spideynolove/memory/reflect/github.svg)](https://agentmods.dev/commands/spideynolove/memory/reflect)
Your own site
<a href="https://agentmods.dev/commands/spideynolove/memory/reflect"><img src="https://agentmods.dev/badge/commands/spideynolove/memory/reflect/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 reflect

Your own site · 80×15
<a href="https://agentmods.dev/commands/spideynolove/memory/reflect"><img src="https://agentmods.dev/badge/commands/spideynolove/memory/reflect.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 13 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,335 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. 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.00013 $0.01335
Opus 5.5 $0.00005 $0.00534
Sonnet 5.5 $0.00003 $0.00267
Haiku 4.5 $0.00001 $0.00134

Measured 2mo ago against content hash 925340b16139, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade B, and why

reflect scanned grade B with 1 finding 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 2mo 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.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

cat /home/hung/MCPs/memory/.claude/reflections/processed.log 2>/dev/null || echo "(empty)"
.claude/commands/reflect.md · 176 lines

How it starts

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

Reflect on Diary Entries and Synthesize Insights

Analyze diary entries from .claude/diary/ to identify recurring patterns, synthesize insights, and propose updates to the project's CLAUDE.md.

Storage

  • Diary entries: <project-root>/.claude/diary/
  • Reflection outputs: <project-root>/.claude/reflections/
  • Processed log: <project-root>/.claude/reflections/processed.log
  • Target config: <project-root>/CLAUDE.md (project-specific rules)

Project root: /home/hung/MCPs/memory

Parameters

  • Entry count: "last N entries" (default: last 10)
  • Date range: "from YYYY-MM-DD to YYYY-MM-DD"
  • Pattern filter: "related to [keyword]"

Steps

1. Check processed entries log

cat /home/hung/MCPs/memory/.claude/reflections/processed.log 2>/dev/null || echo "(empty)"

Format: [diary-filename] | [reflection-date] | [reflection-filename]

2. Locate unprocessed diary entries

ls -t /home/hung/MCPs/memory/.claude/diary/*.md 2>/dev/null | head -20

Exclude entries already listed in processed.log unless user says "include all".

3. Read and parse diary entries

Read each entry. Pay special attention to:

  • User Preferences Observed
  • Code Patterns and Decisions
  • Solutions Applied
  • Challenges Encountered
  • Code Review & PR Feedback

4. Optional: query Memory Bank MCP for additional signal

If the Memory Bank MCP server is running, also pull structured patterns:

  • Call get_analysis resource (memory://analysis) to get detected patterns from SQLite
  • Call get_memory_tree resource (memory://tree) for structured session memories

This hybrid approach combines narrative signal (diary markdown) with structured signal (SQLite patterns). Skip gracefully if MCP is unavailable.

5. Read current CLAUDE.md

cat /home/hung/MCPs/memory/CLAUDE.md 2>/dev/null || echo "(no CLAUDE.md yet)"

This is critical — check for existing rules before proposing additions or strengthening.

6. Flag correction-priority entries

Read the full file on GitHub · 176 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. 2mo ago First seen · 176 lines · 13 tokens per session scan B 925340b16139

Subscribe to this mod's changes

reflect is a command published in the GitHub repository spideynolove/memory (3 stars, last pushed 7mo ago), licensed MIT. It adds 13 tokens to every session and 1,335 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.