From ralph-wiggum-pro
Shows Ralph Wiggum loop session history and statistics from logs, filtered by last N, project, outcome, active status, or all.
How this command is triggered — by the user, by Claude, or both
Slash command
/ralph-wiggum-pro:ralph-stats [--last N] [--project NAME] [--outcome TYPE] [--active] [--all]This command is limited to the following tools:
The summary Claude sees in its command listing — used to decide when to auto-load this command
# Ralph Stats Show historical Ralph loop session data from `~/.claude/ralph-wiggum-pro/logs/sessions.jsonl`. ## Parse Arguments The user may provide arguments. Parse them: - `--last N` or `-n N`: Show last N sessions (default: 10) - `--project NAME` or `-p NAME`: Filter by project name (partial match) - `--outcome TYPE` or `-o TYPE`: Filter by outcome (success, max_iterations, cancelled, error) - `--active` or `-a`: Show only active (running) loops - `--all`: Show all sessions (overrides --last) ## Execute Query ## Format and Display Results Based on the output above: ### If NO_LOG...
Show historical Ralph loop session data from ~/.claude/ralph-wiggum-pro/logs/sessions.jsonl.
The user may provide arguments. Parse them:
--last N or -n N: Show last N sessions (default: 10)--project NAME or -p NAME: Filter by project name (partial match)--outcome TYPE or -o TYPE: Filter by outcome (success, max_iterations, cancelled, error)--active or -a: Show only active (running) loops--all: Show all sessions (overrides --last)LOG_FILE="$HOME/.claude/ralph-wiggum-pro/logs/sessions.jsonl"
if [[ ! -f "$LOG_FILE" ]]; then
echo "NO_LOG_FILE"
exit 0
fi
if [[ ! -s "$LOG_FILE" ]]; then
echo "EMPTY_LOG_FILE"
exit 0
fi
# Output raw JSONL for parsing
echo "LOG_DATA_START"
cat "$LOG_FILE"
echo ""
echo "LOG_DATA_END"
Based on the output above:
Say: "No Ralph loop history found. Run some loops first!"
Parse the JSONL data between LOG_DATA_START and LOG_DATA_END. Each line is a JSON object.
Important: The log now uses a two-entry format:
status: "active" with fields: session_id, project, project_name, state_file_path, task, started_at, max_iterations, completion_promisestatus: "completed" with fields: session_id, outcome, ended_at, duration_seconds, iterations, error_reasonMerging logic:
loop_id (unique per loop invocation)status: "active") to get project, task, started_at, max_iterations, completion_promisestatus: "completed") to get outcome, ended_at, duration_seconds, iterationsHandling active sessions:
🔄 active instead of an outcome? (unknown until completion)Apply any filters the user requested:
--active specified, show ONLY sessions that have no completion entry (still running)--project specified, filter entries where project_name contains the value (case-insensitive)--outcome specified, filter completed entries where outcome equals the value--all NOT specified, limit to the last N entries (default 10)Sort by started_at descending (most recent first), with active sessions at the top.
Important: The log now includes checklist data. Each session entry may include:
has_checklist: boolean - whether a checklist exists for this loopchecklist_progress: string or null - format "X/Y tasks • A/B criteria"When merging entries, include these fields from the start entry.
Display in this format:
📊 Ralph Loop Session History
═════════════════════════════════════════════════════════════════════════════════════════════════════════
Project Task Iters/Max Checklist Promise Status Started
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
my-api Working on feature X... ?/50 3/5 • 1/2 DONE 🔄 active 2024-01-15 10:30
my-api Build REST API for todos... 15/50 - COMPLETE ✅ success 2024-01-15 10:30
my-api Fix auth bug 20/20 2/2 • 1/1 FIXED ⏹ max 2024-01-14 14:00
frontend Refactor cache layer 8/∞ - - 🚫 cancel 2024-01-13 09:15
my-api Add rate limiting 3/10 - DONE ❌ error 2024-01-12 16:20
═════════════════════════════════════════════════════════════════════════════════════════════════════════
Total: 5 sessions | 🔄 1 | ✅ 1 | ⏹ 1 | 🚫 1 | ❌ 1
Formatting rules:
... if longer... if longer (reduced to make room for Checklist column)X/Y where Y is max_iterations, or X/∞ if max_iterations is 0 (unlimited); for active loops show ?/Ychecklist_progress value (first 18 chars), or - if null/empty
has_checklist is true, otherwise show -completion_promise value (first 12 chars), or - if null/empty🔄 activesuccess → ✅ successmax_iterations → ⏹ maxcancelled → 🚫 cancelerror → ❌ errorstarted_at as YYYY-MM-DD HH:MM in local timeSummary line: Count total sessions and breakdown by status type (including active count).
Say: "No sessions found matching your filters."
If user runs /ralph-wiggum-pro:ralph-stats --help or /ralph-wiggum-pro:ralph-stats -h, show:
📊 Ralph Stats - View loop session history
USAGE:
/ralph-wiggum-pro:ralph-stats [OPTIONS]
OPTIONS:
--last N, -n N Show last N sessions (default: 10)
--project NAME, -p NAME Filter by project name
--outcome TYPE, -o TYPE Filter by outcome (success, max_iterations, cancelled, error)
--active, -a Show only active (running) loops
--all Show all sessions
-h, --help Show this help
EXAMPLES:
/ralph-wiggum-pro:ralph-stats # Show last 10 sessions
/ralph-wiggum-pro:ralph-stats --active # Show only running loops
/ralph-wiggum-pro:ralph-stats --last 20 # Show last 20 sessions
/ralph-wiggum-pro:ralph-stats --project my-api # Filter by project
/ralph-wiggum-pro:ralph-stats --outcome success # Show only successful loops
/ralph-wiggum-pro:ralph-stats --all --outcome error # Show all error sessions
LOG LOCATION:
~/.claude/ralph-wiggum-pro/logs/sessions.jsonl
NOTE:
The log uses a two-entry format:
- Start entry: logged when loop begins (status: "active")
- Completion entry: logged when loop ends (status: "completed")
Sessions with only a start entry are currently running.
npx claudepluginhub teknologist/claude-ralph-wiggum-pro --plugin ralph-wiggum-pro/buidl-traceDisplays agent execution trace for the current loop session from trace.jsonl, rendering table of timestamps, events, agents, phases, cycles, details, plus summary of events, agents, and errors.
/agent-historyDisplays a table of agents spawned in the current Claude Code session with line numbers, relative timestamps, agent types, task descriptions, and triggering user messages.
/loop-statusChecks active loop status, progress, failure signals, and suggests interventions. Supports --watch flag and a cross-session CLI.