Usage Examples

Real-world scenarios demonstrating effective use of the Reflexion plugin.

Automatic Reflection with Hooks

The simplest way to use reflection is with the automatic hooks. Include the word "reflect" in your prompt and Claude will automatically reflect on its work.

Basic Automatic Reflection

# Automatic reflection - no manual command needed
> claude "implement user authentication, then reflect"

# Claude implements the feature, then automatically:
# 1. Runs /reflexion:reflect
# 2. Reviews its own work
# 3. Fixes any issues found or suggests improvements

Automatic Reflection in Workflows

# Feature implementation with automatic reflection
> claude "add payment processing with Stripe, reflect on security"
# Claude implements payment processing
# Hook triggers automatic reflection focused on security

# Bug fix with automatic verification
> claude "fix the null pointer exception in user service, reflect"
# Claude fixes the bug and automatically verifies the fix

Manual Reflection Examples

Quick Quality Check

Scenario: You've implemented a simple utility function and want to verify it's correct.

Expected Flow:

  1. Reflexion triages as "Quick Path" (simple task)

  2. Performs 5-second verification

  3. Either confirms quality or suggests specific improvements

  4. No memorization needed for trivial utility

When Reflection Finds Issues:

Comprehensive Feature Review

Scenario: Complex authentication feature needs thorough review.

Expected Critique Output:

Implement → Reflect → Memorize

Reflection finds optimization opportunity:

Memorized Knowledge (added to CLAUDE.md):

Design → Critique → Refine

Scenario: Designing a caching strategy.

First Critique:

Second Critique (after refinement):

Continuous Improvement Cycle

Integration with Other Plugins

With Code Review

With SDD

With Kaizen

Last updated