Skip to main content
command CX Codex

replay · rohitg00 — Claude Code command: what it does, how to install

replay finds relevant past learnings and mistakes in a local SQLite database before starting a task. Surfaces project context to reduce repeated edits.

MIT ★ 2,966 updated 2026-09-29

Install into Claude Code · Plugin marketplace All methods and platforms ↓
/plugin marketplace add rohitg00/pro-workflow
/plugin install pro-workflow@pro-workflow
Open on GitHub

What replay does

The /replay command parses your task description and queries ~/.pro-workflow/data.db using SQLite FTS5 BM25 ranking. It pulls up to 8 matched records from the learnings table, showing past mistakes, applied rules, and how often each rule helped.

It also checks the sessions table for projects with matching names. The output summarizes edit counts and correction rates across the five most recent sessions. If nothing matches the keywords, it advises exploring with /scout instead.

This command depends entirely on the local ~/.pro-workflow/data.db database. Without this SQLite store populated by pro-workflow, there is no history to query.

What it helps with

  • recall past mistakes and bug fixes before editing code
  • check session correction rates on similar tasks
  • surface project-specific rules via keyword matching
  • avoid repeating architectural errors across sessions

Example prompts for the agent

  • /replay auth middleware
  • /replay "file path errors"
  • /replay testing react components

How to install replay

1Plugin marketplace

/plugin marketplace add rohitg00/pro-workflow
/plugin install pro-workflow@pro-workflow

2Manually: put the files in place

.claude/commands/replay.md

Call it with /replay. For all projects use ~/.claude/commands/

Questions about replay

How to install replay in Claude Code?

Run /plugin marketplace add rohitg00/pro-workflow in Claude Code, then run /plugin install pro-workflow@pro-workflow.

What does the replay command do?

It searches a local SQLite database for prior learnings and session statistics that match your current task. The output provides a briefing on what to avoid and what rules to apply.

What happens if no relevant learnings are found?

The command reports that no matches exist and suggests running /scout to explore the codebase before implementing changes.

Source text

replay.md · MIT
---
description: Surface relevant past learnings before starting a task.
---

# /replay - Surface Past Learnings for Current Task

Automatically find and surface relevant learnings from your pro-workflow database before you start working. Like muscle memory for your coding sessions.

## Usage

```
/replay auth middleware
/replay "file path errors"
/replay testing react components
```

## How It Works

1. Extract keywords from your current task description
2. Search the learnings database using FTS5 BM25 ranking
3. Check correction history for similar file patterns
4. Surface the top learnings with context

## What You Do

When the user runs `/replay <task description>`:

1. **Search learnings database**:
   ```bash
   sqlite3 ~/.pro-workflow/data.db "
     SELECT l.category, l.rule, l.mistake, l.correction, l.times_applied
     FROM learnings l
     JOIN learnings_fts ON l.id = learnings_fts.rowid
     WHERE learnings_fts MATCH '<keywords>'
     ORDER BY bm25(learnings_fts)
     LIMIT 8
   "
   ```

2. **Check session history for similar work**:
   ```bash
   sqlite3 ~/.pro-workflow/data.db "
     SELECT project, corrections_count, edit_count,
            ROUND(CAST(corrections_count AS FLOAT) / NULLIF(edit_count, 0) * 100, 1) as correction_rate
     FROM sessions
     WHERE project LIKE '%<keyword>%'
     ORDER BY started_at DESC
     LIMIT 5
   "
   ```

3. **Output the replay briefing**:

```
REPLAY BRIEFING: <task>
=======================

Past learnings (ranked by relevance):
  1. [Testing] Always mock external APIs in auth tests (applied 8x)
     Mistake: Called live API in tests, caused flaky failures
  2. [Navigation] Auth middleware is in src/middleware/ not src/auth/ (applied 5x)
  3. [Quality] Add error boundary around auth state changes (applied 3x)

Session history for similar work:
  - 2026-02-01: auth refactor — 23 edits, 2 corrections (8.7% rate)
  - 2026-01-28: auth middleware — 15 edits, 4 corrections (26.7% rate)
    ^ Higher correction rate — review patterns before starting

Suggested approach:
  - [based on learnings, suggest what to watch out for]
```

4. If no learnings found, say so and suggest starting with `/scout` to explore first

## Why This Is Unique

No other workflow tool has persistent FTS5-indexed learnings across sessions. This turns your past mistakes into a personal knowledge base that gets surfaced exactly when relevant.

## Related Commands

- `/search <query>` - Direct search of learnings
- `/scout` - Confidence-gated exploration before implementing
- `/insights` - Analytics on learning patterns

---

**Trigger:** Use when user says "replay", "what do I know about", "past learnings", "before I start", "remind me about", or starts a task that matches previous session patterns.

© Rohit Ghumare · MIT · rohitg00/pro-workflow

Similar slash commands

All slash commands for Agent setup: memory, context, orchestration →

replay by other authors comes first.

From the same set83

The whole set →
improve-architecture improve-architecture audits code structure, identifies tangles in boundaries and dependencies, and proposes a ranked list of minimal moves that relieve the strain—no rewrite, only a plan you approve first. CX Codex +1 ★ 2,966repo stars parallel-worktrees parallel-worktrees — a skill for Claude Code that creates isolated git worktrees for parallel coding sessions. While tests or builds run in one window, start a new task in another without waiting or switching context. CX Codex +1 ★ 2,966repo stars compact-guard compact-guard is a Claude Code skill that records task state before context compaction and helps restore it afterward. Run it before /compact or when an auto-compaction warning appears. CX Codex +1 ★ 2,966repo stars handoff Generates a structured handoff document for passing work to another Claude session or your future self. Records status, decisions, learnings, and a resume point. CX Codex +1 ★ 2,966repo stars insights The insights skill turns project memory and session history into analytics on corrections, saved learnings, and coding activity. Ask for a report to spot recurring patterns. CX Codex +1 ★ 2,966repo stars domain-modeling domain-modeling builds the project's shared vocabulary and context boundaries before code gets written, so the agent stops paraphrasing domain terms. Leaves a CONTEXT.md glossary behind. CX Codex +1 ★ 2,966repo stars llm-gate llm-gate configures prompt and agent hooks in Claude Code to validate commit messages, stop dangerous terminal commands, and catch secret leaks before execution. CX Codex +1 ★ 2,966repo stars cost-tracker The cost-tracker skill helps you review Claude Code session costs, set budget checkpoints, and spot expensive work patterns. Use it when planning work across sessions. CX Codex +1 ★ 2,966repo stars

Project sponsors

Companies that keep this analytics open