Skip to main content
Correction mode implements a producer-reviewer pattern where one model generates output and another reviews it, optionally followed by fixes based on feedback.

Usage

TUI (Interactive)

/correct <producer> <reviewer> "<prompt>"
/settings        # toggle fix mode

CLI

puzldai correct "<prompt>" --producer <agent> --reviewer <agent> [--fix]

Examples

# TUI: Claude produces, Gemini reviews
/correct claude gemini "Write a REST API endpoint"

# CLI: With automatic fix
puzldai correct "Implement binary search" --producer claude --reviewer gemini --fix

How It Works

1

Production

The producer agent generates the initial output for the task.
2

Review

The reviewer agent critiques the output, identifying issues, suggesting improvements, and rating quality (1-10).
3

Fix (Optional)

If --fix is enabled, the producer receives the review feedback and creates an improved version.

Configuration

TUI Settings

Configure fix mode via /settings → Collaboration tab:
SettingDescription
FixEnable automatic fix after review (default: off)

CLI Flags

FlagDescription
--producerAgent that generates the initial output (required)
--reviewerAgent that reviews and critiques (required)
--fix or -fEnable automatic fix based on review

Use Cases

Code Review

# TUI
/correct claude codex "Implement a cache class"

# CLI
puzldai correct "Implement a cache class" --producer claude --reviewer codex --fix
The reviewer checks for:
  • Correctness and edge cases
  • Performance issues
  • Code style and best practices
  • Security concerns

Writing Review

# TUI
/correct gemini claude "Write documentation for the API"

# CLI
puzldai correct "Write documentation for the API" --producer gemini --reviewer claude
The reviewer evaluates:
  • Clarity and completeness
  • Technical accuracy
  • Structure and organization

Fact Checking

# TUI
/correct ollama claude "Explain how SSL/TLS works"

# CLI
puzldai correct "Explain how SSL/TLS works" --producer ollama --reviewer claude
The reviewer verifies:
  • Technical accuracy
  • Completeness of explanation
  • Common misconceptions

Example Output

─── Correction ───

Producer: claude
━━━━━━━━━━━━━━━━
```python
def binary_search(arr, target):
    left, right = 0, len(arr)
    while left < right:
        mid = (left + right) // 2
        if arr[mid] == target:
            return mid
        elif arr[mid] < target:
            left = mid + 1
        else:
            right = mid
    return -1
Reviewer: gemini ━━━━━━━━━━━━━━━━ Rating: 7/10 Issues:
  1. Integer overflow possible with (left + right) // 2 for large arrays
  2. Missing input validation
  3. No docstring
Suggestions:
  • Use left + (right - left) // 2 to prevent overflow
  • Add type hints and docstring
Fixed Output (claude): ━━━━━━━━━━━━━━━━━━━━━━
def binary_search(arr: list, target: int) -> int:
    """Binary search for target in sorted array."""
    if not arr:
        return -1
    left, right = 0, len(arr)
    while left < right:
        mid = left + (right - left) // 2
        ...

Keyboard Shortcuts

KeyAction
EscapeHide view
Ctrl+EReturn to view
Ctrl+CCancel

Tips

Use different model families - Cross-model review catches more issues than same-model review.
Enable —fix for iterative improvement - The producer learns from feedback and creates better output.