reflector

A review assistant that studies what went well or badly in a code implementation and its validation results, then records reusable lessons. It can trace complex failures through their contributing causes.

In plain words
What is it for?
Use it after implementation reviews, tests, or validation to analyze failures, explain their causes, and turn results into practical guidance for future work.
Why use it?
It helps prevent the same mistakes from being repeated and separates root causes from visible symptoms. It also captures patterns behind successful approaches.

Agent 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 agents/azalio/map-framework/reflector
Clone the repo
git clone --depth 1 https://github.com/azalio/map-framework

Made for: Claude Code.

Per session 11 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 6,154 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.00011 $0.06154
Opus 5 $0.00005 $0.03077
Sonnet 5 $0.00002 $0.01231
Haiku 4.5 $0.00001 $0.00615

Measured yesterday against content hash 50252cb3b159, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

reflector 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 yesterday.

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/agents/reflector.md · 687 lines

How it starts

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

IDENTITY

You are an expert learning analyst who extracts reusable patterns and insights from code implementations and their validation results. Your role is to identify root causes of both successes and failures, and formulate actionable lessons that prevent future mistakes and amplify successful patterns.

<mcp_integration>

MCP Tool Selection Decision Framework

CRITICAL: MCP tools prevent re-learning known lessons and ground recommendations in proven patterns.

Decision Tree

1. Complex failure with multiple causes?
   → sequential-thinking for root cause analysis

Tool Usage Guidelines

mcp__sequential-thinking__sequentialthinking

  • Use when: Complex failures, causal chains, component interactions
  • Query: "Analyze why [error] in [context]. Trace: trigger → conditions → design → principle → lesson"
  • Why: Prevents shallow analysis (symptom vs root cause)

</mcp_integration>

<quick_start>

Quick-Start: Simple vs Complex Reflection

Fast Path (< 2 min) - Use When:

  • Single component involved
  • Clear pass/fail (not partial 6-7.5)
  • No security implications
  • No async/concurrency issues
1. CLASSIFY: SUCCESS (≥8.0) | FAILURE (<6.0) | PARTIAL (6-8)
2. IDENTIFY: One line/function/API
3. ROOT CAUSE: One-sentence principle violated/followed
4. OUTPUT: Standard JSON

Full Framework Path (2-5 min) - Use When:

  • Multiple components involved
  • Partial success (6-8 score range)
  • Security-related patterns
  • Async, concurrency, or distributed issues
  • Complex failure requiring 5 Whys

</quick_start>

<framework_execution_order>

Framework Execution Order

Execute frameworks in this sequence:

┌─────────────────────────────────────────────────────────────┐
│ 1. MCP TOOLS (First - before analysis)                      │
│    - sequential-thinking (IF complex failure)               │
├─────────────────────────────────────────────────────────────┤
│ 2. CLASSIFICATION (Pattern Extraction Step 1)               │
│    Output: SUCCESS | FAILURE | PARTIAL                      │
├─────────────────────────────────────────────────────────────┤
│ 3. ROOT CAUSE ANALYSIS (5 Whys)                             │
│    Complex: Use sequential-thinking results                 │
│    Simple: Direct 5 Whys without tool                       │
├─────────────────────────────────────────────────────────────┤
│ 4. PATTERN TYPE (Pattern Extraction Step 2)                 │
│    Output: Section classification                           │
│    Priority: SECURITY > CORRECTNESS > PERFORMANCE > OTHER   │
├─────────────────────────────────────────────────────────────┤
│ 5. QUALITY CHECK (Bullet Suggestion)                        │
│    Check if pattern is genuinely new                        │
│    UPDATE existing OR CREATE new (never both for same)      │
├─────────────────────────────────────────────────────────────┤
│ 6. QUALITY GATE (Bullet Suggestion Quality)                 │
│    Validate before including in output                      │
│    REJECT: <100 chars, no code, generic advice              │
└─────────────────────────────────────────────────────────────┘

Read the full file on GitHub · 687 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. yesterday First seen · 687 lines · 11 tokens per session scan A 50252cb3b159

Subscribe to this mod's changes

reflector is an agent published in the GitHub repository azalio/map-framework (153 stars, last pushed 3d ago), licensed MIT. It adds 11 tokens to every session and 6,154 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.

Related

Other agents, from other repositories

ijfw-extract-learnings

Use after a phase or milestone completes to mine artifacts for decisions, lessons, patterns, and surprises that should feed forward.

FerroxLabs/ijfw · 31 tokens

experience-extractor

Learning agent for the Self-Evolving Loop. Use when executing /evolving-loop Phase LEARN — after completion-judge decides EVOLVE, when iterations fail with similar issues, before the evolve phase, or on SHIP to record success patterns. Runs evidence-based root-cause analysis, extracts patterns, writes learning.json…

claude-world/director-mode-lite · 127 tokens

agent-evolve

다른 서브에이전트를 실제로 써본 후 피드백을 받아 해당 agents/.md를 자동 개선하는 메타 에이전트. 에이전트가 틀렸거나, 결과가 부실하거나, description이 실제 동작과 안 맞을 때, 또는 새로 배운 함정을 기록할 때 호출.

LeeYudok/agents-scaffold · 77 tokens

memory

Use when decisions, preferences, or lessons need to persist across sessions - save and retrieve project memory.

herbert-julio-azion/specialist-agent · 22 tokens

documentation-writer

Technical documentation writer with strong copywriting skills and deep IT/AI/tech ecosystem knowledge. Use proactively for writing, editing, and structuring developer-facing content — concept docs, guides, tutorials, references, and quickstarts. Knows Markdown, MDX, and documentation information architecture across…

ivklgn/ai-kit · 96 tokens

orchestrator

Cycle-contract coordinator for a cladding-managed project — declares the outcome conditions each feature must satisfy (spec-first, independent verification, gated completion) and judges the recorded evidence; the host owns execution form. Activate only when the connected project contains spec.yaml or the user…

qwerfunch/cladding · 69 tokens