reflect — Claude Code prompt: what it does, how to install
The reflect Claude Code prompt revises an optimizer package using the trace from a finished task. It turns observed evidence into rules for later tasks instead of carrying over one task’s settings.
no license ★ 99 updated 2026-11-12
.claude/commands/reflect.mdWhat reflect does
reflect edits an optimizer package after each development task. It receives the package and the trace from the task that just ended, with no other context. Its permitted changes cover skill guidance, search policy, role prompts, receipt-analysis scripts, and cross-task memory.
New guidance must connect conditions to observed evidence and account for counterexamples. Advice contradicted by the trace should be removed, and a configuration for one task must not become a general rule. The prompt restricts edits to the listed files and memory, then asks for a JSON response containing changed sections and a rationale.
What it helps with
- revise optimizer rules using evidence from a completed task
- remove advice that conflicts with the task trace
- record lessons and configurations for later tasks
Example prompts for the agent
- Update the optimizer package using the latest task trace, and add only evidence-backed observations.
- Revise the skill rules to account for the trace’s counterexample and remove contradicted advice.
- Save the lesson from the completed task in cross-task memory and return the result as JSON.
How to install reflect
Manually: put the files in place
.claude/commands/reflect.mdHow to use
Paste the text at the start of a chat or into project instructions
Questions about reflect
How do I install reflect in Claude Code?
Place the command file at .claude/commands/reflect.md.
What does reflect do?
It uses an optimizer package and a completed task’s trace to revise allowed rules, prompts, analysis tools, and memory. It returns the changes as JSON.
Which files can reflect edit?
It can change skills, policy.yaml, prompt files, tools/<name>.analysis scripts, and cross-task memory. Other parts of the package are outside its edit scope.