logs
View and manage iteration output logs from Ralph TUI sessions.
Synopsis
The logs command lets you view, filter, and manage the output logs from Ralph's iterations. Each iteration's agent output is saved to a log file, making it easy to review what happened during execution.
Log files are stored in .ralph-tui/iterations/ by default. Use the --output-dir flag on run to change this location.
Options
Viewing Options
| Option | Description |
|---|---|
--iteration <n> | View specific iteration number |
--task <id> | View logs for a specific task ID |
--verbose | Show full output (not truncated) |
Cleanup Options
| Option | Description |
|---|---|
--clean | Clean up old log files |
--keep <n> | Number of recent logs to keep (with --clean) |
--dry-run | Preview cleanup without deleting |
Examples
View Specific Iteration
View Logs for a Task
List All Logs
Example output:
Clean Up Old Logs
The --clean operation permanently deletes log files. Use --dry-run first to preview what will be removed.
Log File Format
Each iteration creates a log file with the following naming pattern:
The log files contain:
- Timestamp - When the iteration started
- Task details - ID, title, and description
- Prompt sent - The full prompt built from the template
- Agent output - Complete stdout/stderr from the agent
- Completion status - Whether
<promise>COMPLETE</promise>was detected - Duration - How long the iteration took
Debugging Failed Tasks
When a task fails, the logs are essential for debugging:
Find the Failed Iteration
Look for iterations with "failed" status.
View Full Output
Review the complete agent output for error messages.
Check the Prompt
The log includes the prompt that was sent. Verify it contains the expected task details and context.
Fix and Retry
Address the issue (fix code, update task, adjust prompt template) and resume execution.
Storage Considerations
Logs can accumulate over time, especially with verbose agent output:
Consider adding .ralph-tui/iterations/ to your .gitignore to avoid committing large log files.