reflect

reflect is a command for coding agents from BayramAnnakov/claude-reflect. It costs 15 tokens per session (13,724 once invoked), scanned B, original, MIT.

A command for reviewing corrections made during assistant sessions and updating CLAUDE.md guidance files after human review.

In plain words
What is it for?
Use it to inspect the learning queue, scan past sessions, review stale entries, remove duplicates, and synchronise lessons to project or global guidance files.
Why use it?
It turns repeated corrections into stored project instructions, while offering previews, history scans, duplicate checks, and organisation suggestions.

Command

Part of the claude-reflect plugin — 1 skill, 4 commands, 4 hooks shipped together

About the project

claude-reflect is a self-learning system for Claude Code that records corrections, positive feedback, preferences, and recurring workflows as persistent instructions or reusable skills. It helps Claude Code users retain lessons across sessions and improve repeated tasks, with catalogue add-ons providing its hooks, commands, instructions, plugin, and skill.

BayramAnnakov/claude-reflect · 1,427 stars · on GitHub

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/bayramannakov/claude-reflect/reflect
Clone the repo
git clone --depth 1 https://github.com/BayramAnnakov/claude-reflect

Or install claude-reflect, the plugin that ships this one along with the rest of its 1 skill, 4 commands, 4 hooks.

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/bayramannakov/claude-reflect/reflect.svg)](https://agentmods.dev/commands/bayramannakov/claude-reflect/reflect)
Your own site
<a href="https://agentmods.dev/commands/bayramannakov/claude-reflect/reflect"><img src="https://agentmods.dev/badge/commands/bayramannakov/claude-reflect/reflect.svg" alt="Measured on agentmods" height="20"></a>
Per session 15 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 13,724 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. 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.00015 $0.13724
Opus 5 $0.00008 $0.06862
Sonnet 5 $0.00003 $0.02745
Haiku 4.5 $0.00002 $0.01372

Measured 5d ago against content hash a7b585bba8e9, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 5d 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 ~/.claude/learnings-queue.json | jq -r '.[] | "\(.timestamp) | conf:\(.confidence // 0.5) | decay:\(.decay_days // 90)d | \(.message | .[0:60])"'
commands/reflect.md · 1,513 lines

How it starts

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

Arguments

  • --dry-run: Preview all changes without prompting or writing.
  • --scan-history: Scan ALL past sessions for corrections (useful for first-time setup or cold start).
  • --days N: Limit history scan to last N days (default: 30). Only used with --scan-history.
  • --targets: Show detected AI assistant config files and exit.
  • --review: Show learnings with stale/decayed entries for review.
  • --dedupe: Scan CLAUDE.md for similar entries and propose consolidations.
  • --organize: Analyze memory hierarchy and suggest reorganization across tiers.
  • --include-tool-errors: Include project-specific tool execution errors in scan (auto-enabled with --scan-history).
  • --model MODEL: Model for semantic analysis (default: sonnet). Use haiku for faster/cheaper runs or opus for maximum accuracy.

Context

  • Project CLAUDE.md: @CLAUDE.md
  • Global CLAUDE.md: @~/.claude/CLAUDE.md
  • Learnings queue (per-project): !python3 "$(dirname "$(dirname "$(readlink -f "$0")")")/scripts/read_queue.py" 2>/dev/null || echo "[]"
  • Current project: !pwd

Multi-Target Export

Claude-reflect syncs learnings to CLAUDE.md files (including subdirectories), skill files, and AGENTS.md.

Supported Targets:

Target File Path Format Notes
Global CLAUDE.md ~/.claude/CLAUDE.md Markdown Always enabled
Project CLAUDE.md ./CLAUDE.md Markdown If exists
CLAUDE.local.md ./CLAUDE.local.md Markdown Personal, gitignored
Subdirectory CLAUDE.md ./**/CLAUDE.md Markdown Auto-discovered
Project Rules ./.claude/rules/*.md Markdown Modular rules, optional path-scoping
User Rules ~/.claude/rules/*.md Markdown Global modular rules
Skill Files ./commands/*.md Markdown When correction relates to skill
Auto Memory ~/.claude/projects/<project>/memory/*.md Markdown Low-confidence, exploratory learnings
AGENTS.md ./AGENTS.md Markdown Industry standard (Codex, Cursor, Aider, Jules, Zed, Factory)

Read the full file on GitHub · 1,513 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. 5d ago First seen · 1,513 lines · 15 tokens per session scan B a7b585bba8e9

Subscribe to this mod's changes

reflect is a command published in the GitHub repository BayramAnnakov/claude-reflect (1,427 stars, last pushed 5mo ago), licensed MIT. It adds 15 tokens to every session and 13,724 once invoked, about $0.0001 per session on Opus 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-30.