Show Ralph Wiggum loop session history and statistics
View Ralph Wiggum loop session history and statistics with filtering options for project, outcome, and active sessions.
/plugin marketplace add teknologist/claude-ralph-wiggum-pro/plugin install ralph-wiggum-pro@teknologist-plugins[--last N] [--project NAME] [--outcome TYPE] [--active] [--all]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.