Debugging
How to debug Ralph TUI issues using logs, verbose mode, session inspection, and diagnostic tools.
Overview
When something goes wrong with Ralph TUI, systematic debugging helps identify the root cause quickly. This guide covers the diagnostic tools and techniques available.
Start with the simplest diagnostic (logs) before moving to more complex debugging. Most issues can be resolved by examining iteration output.
Iteration Logs
Ralph TUI automatically saves output from each iteration to the .ralph-tui/iterations/ directory.
Viewing Logs
Log File Location
Each log file contains:
- Task ID and details
- Full agent stdout/stderr
- Timestamps and duration
- Exit codes and completion status
Searching Logs
Cleaning Up Logs
Old logs can accumulate and consume disk space:
Session Inspection
The session file (.ralph-tui/session.json) contains the complete state of your Ralph TUI session.
Session metadata is stored separately in .ralph-tui/session-meta.json.
Lock information is stored in .ralph-tui/ralph.lock.
Viewing Session State
Session File Structure
Common Session Issues
If the lock file refers to a dead process:
Configuration Debugging
View Effective Configuration
This shows the final configuration after merging:
- Default values
- Global config (
~/.config/ralph-tui/config.toml) - Project config (
.ralph-tui/config.toml) - CLI flags
Validate TOML Syntax
TOML syntax errors can cause configuration issues:
Common TOML mistakes:
- Missing quotes around strings with special characters
- Incorrect table nesting with
[section] - Using
=instead of:(TOML uses=)
Configuration Precedence
Agent Debugging
Verify Agent Installation
Test Agent Execution
Run the agent manually to isolate issues:
View Agent Command
To see what command Ralph TUI executes:
- Check iteration logs for the full command
- Look for the
commandfield in log JSON
Tracker Debugging
prd.json Issues
Beads Issues
Beads-bv Issues
Template Debugging
View Current Template
Test Template Rendering
To see what prompt is actually sent to the agent:
- Check iteration logs - the rendered prompt is included
- Look for
promptorinputfields in the log JSON
Template Variables
Available Handlebars variables:
{{task.id}}- Task identifier{{task.title}}- Task title{{task.description}}- Full description{{task.acceptanceCriteria}}- Acceptance criteria{{recentProgress}}- Cross-iteration context{{epic.title}}- Epic title (if using Beads)
Progress File Debugging
The progress file tracks cross-iteration context.
View Progress History
Reset Progress
If progress context is causing issues:
Common Debug Workflows
Workflow: Task Won't Complete
Check iteration logs
Look for the <promise>COMPLETE</promise> token in output.
Verify template includes completion instruction
Test agent directly
Run the agent manually with the same prompt to see if it completes.
Check acceptance criteria
If criteria are impossible to meet, the agent may never signal completion.
Workflow: Unexpected Behavior
Check configuration
Verify settings match your expectations.
Review session state
Examine recent iterations
Check for dependency issues
Workflow: Agent Errors
Check agent is working
Verify credentials
Check rate limits
Look for rate limit messages in iteration logs.
Review error handling config
Reporting Issues
When reporting issues to GitHub, include:
-
Ralph TUI version:
Bash -
Configuration (sanitized):
Bash -
Relevant iteration logs (remove sensitive data)
-
Session status:
Bash -
Steps to reproduce the issue
Before sharing logs, remove any API keys, passwords, or other sensitive information.
Next Steps
- Common Issues - Solutions for frequent problems
- Configuration Reference - All configuration options
- CLI Commands - Command reference