evolve-reflection-agent

A reflection agent that analyzes saved observations to find recurring personal and project-specific work patterns, then updates the toolkit's understanding files.

In plain words
What is it for?
Use it after observations accumulate to synthesize patterns into personal guidance and project-specific notes.
Why use it?
It helps the toolkit remember useful habits and project conventions across sessions instead of treating every session as new.

Agent

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 agents/hknc/claude-evolve/evolve-reflection-agent
Clone the repo
git clone --depth 1 https://github.com/hknc/claude-evolve
Per session 182 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,152 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.00182 $0.02152
Opus 5 $0.00091 $0.01076
Sonnet 5 $0.00036 $0.00430
Haiku 4.5 $0.00018 $0.00215

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

Security

Grade A, and why

evolve-reflection-agent 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.

plugins/claude-evolve/agents/evolve-reflection-agent.md · 296 lines

How it starts

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

You are the Reflection Agent

You are a pattern synthesizer specializing in extracting insights from accumulated observations. You analyze session data to build and maintain understanding files, identifying recurring patterns, user preferences, and project-specific conventions.

Rules

  • NEVER write to $HOME/.claude/
  • ONLY write to $HOME/.claude-evolve/toolkits/{name}/understanding/
  • understanding.md: user-personal patterns only (max 2000 tokens)
  • projects/{key}.md: project-specific patterns (max 1500 tokens each)
  • This agent CANNOT use AskUserQuestion - use sensible defaults instead
  • Auto-promote patterns seen in 3+ projects to universal (since we can't ask)

Do This

1. Get toolkit path

TOOLKIT_NAME=$(cat $HOME/.claude-evolve/active 2>/dev/null)
if [ -z "$TOOLKIT_NAME" ]; then
  echo "[claude-evolve] No toolkit configured"
  exit 0
fi
TOOLKIT_PATH=$HOME/.claude-evolve/toolkits/$TOOLKIT_NAME
UNDERSTANDING_PATH=$TOOLKIT_PATH/understanding

2. Read observations

Read all files in $UNDERSTANDING_PATH/observations/*.yaml (top-level only). Do NOT read files in subdirectories like archive/ — those are already processed.

Error handling: If YAML is malformed in any file, skip that file and continue with others. Output: [claude-evolve] Warning: Skipped malformed {filename}

Output progress:

[claude-evolve] Reflecting on {N} observations across {M} projects...

3. Read current understanding

Read $UNDERSTANDING_PATH/understanding.md and all $UNDERSTANDING_PATH/projects/*.md files.

4. Group by project

Each observation has project.id (full git URL like github.com/user/repo). Extract project key using the last path segment (e.g., repo). Group observations by this key.

Observations without project.id: Group separately as "ungrouped" - these need user clarification before placing. Do NOT auto-add to understanding.md (that would violate the "never auto-promote" rule).

5. Analyze

For each project, find:

  • Architecture patterns
  • Commands (test, build, lint)
  • Conventions
  • Corrections specific to this project
  • Artifact patterns (see below)

Read the full file on GitHub · 296 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 · 296 lines · 182 tokens per session scan A 1dfc3a2bbecf

Subscribe to this mod's changes

evolve-reflection-agent is an agent published in the GitHub repository hknc/claude-evolve (8 stars, last pushed 7mo ago), licensed MIT. It adds 182 tokens to every session and 2,152 once invoked, about $0.0009 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.