reflect

A session-review command that finds lessons from past work and proposes updates to the project's Learned Rules section in CLAUDE.md.

In plain words
What is it for?
Use it to inspect learning signals, review proposed rules, or add, archive, remove, and list entries in the project rules ledger.
Why use it?
It helps preserve corrections and recurring instructions so they can guide future work. Proposed rules are not applied automatically.

Command

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/adilkalam/orca/reflect
Clone the repo
git clone --depth 1 https://github.com/adilkalam/orca
Per session 23 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 654 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.00023 $0.00654
Opus 5 $0.00012 $0.00327
Sonnet 5 $0.00005 $0.00131
Haiku 4.5 $0.00002 $0.00065

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

Security

Grade A, and why

reflect 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.

commands/reflect.md · 61 lines

How it starts

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

/reflect -- Institutional Learning (Learned Rules curation)

/reflect is the manager for the Learned Rules ledger in CLAUDE.md (the ## Learned Rules (via /reflect) section). It is a thin wrapper over two scripts that already do the work:

  • ~/.claude/scripts/reflect-analyze.py -- mines learning signals (corrections, standing instructions, negative feedback) from session history.
  • ~/.claude/scripts/reflect-apply.py -- reads/writes the Learned Rules section (add / archive / remove / list).

Rules are NEVER applied automatically. /reflect proposes; the owner confirms each addition. This is the one command allowed to edit the Learned Rules section.

Subcommands

/reflect status (default)

Show the current Learned Rules ledger.

python3 ~/.claude/scripts/reflect-apply.py list

/reflect --source recording|jsonl [--days N]

Mine learning signals from session history. Data source auto tries .orca/recording.db first, then falls back to JSONL transcripts; recording / jsonl force one.

python3 ~/.claude/scripts/reflect-analyze.py --days ${N:-30} --source ${SOURCE:-auto} --format summary

Present the ranked signals to the owner. Do NOT write anything in this mode.

/reflect learn [--days N]

The full loop, with a mandatory human gate:

  1. Run reflect-analyze.py (as above) to surface candidate rules.
  2. For each candidate the owner approves (AskUserQuestion), apply it:
    python3 ~/.claude/scripts/reflect-apply.py add --rule "<approved rule text>" --target claude_md
    
    Soft/preference-level learnings go to --target workshop instead.
  3. Show the resulting diff of the Learned Rules section and stop. Never batch-apply without per-rule confirmation.

Curation discipline

  • The ledger is bounded: prefer editing/merging an existing rule over adding a near-duplicate.
  • Archive (don't delete) rules that are superseded: reflect-apply.py archive --rule-id <id> --reason "<why>".
  • Rule text must be a single imperative sentence a future session can act on.

Read the full file on GitHub · 61 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 · 61 lines · 23 tokens per session scan A 3c606b4a12d2

Subscribe to this mod's changes

reflect is a command published in the GitHub repository adilkalam/orca (2 stars, last pushed 1mo ago), licensed MIT. It adds 23 tokens to every session and 654 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-31.