resume
Resume an interrupted Ralph TUI session from where it left off.
Synopsis
The resume command continues execution from a previously interrupted session. Ralph loads the saved session state and picks up where it left off, automatically resetting any stale "in_progress" tasks.
Session state is automatically saved to .ralph-tui/session.json. You can resume even after crashes or forced exits.
Arguments
| Argument | Description |
|---|---|
session-id | (Optional) Session ID to resume. First 8 characters are usually enough. If not provided, resumes session in current directory. |
Options
| Option | Description |
|---|---|
--list, -l | List all resumable sessions across all directories |
--cleanup | Remove stale entries from the session registry |
--cwd <path> | Working directory (where to find the session file) |
--headless | Run without TUI |
--force | Override stale lock (use if another instance crashed) |
Session Registry
Ralph maintains a global registry of sessions at ~/.config/ralph-tui/sessions.json. This allows you to:
- Resume from any directory - No need to
cdinto the project first - List all active sessions - See what's running across all projects
- Resume by session ID - Use the first 8 characters of the session ID
The session registry is automatically updated when you start, pause, or complete sessions. Use --cleanup to remove entries for sessions that no longer exist.
Examples
Basic Resume
List Available Sessions
Output example:
Resume by Session ID
Resume from Different Directory
Clean Up Stale Registry Entries
Force Override Stale Lock
Only use --force when you're certain no other Ralph instance is running. Using it while another instance is active can cause conflicts.
What Gets Restored
When you resume a session, Ralph restores:
- Iteration number - Continues counting from where you left off
- Task statuses - Completed tasks remain completed
- Progress file - Cross-iteration context is preserved
- Configuration - Uses the same config as the original run
Handling Stale Tasks
If Ralph was interrupted while a task was "in_progress", resume automatically:
- Detects tasks stuck in "in_progress" state
- Resets them to "open" status
- Re-selects the next task based on priority
This ensures no tasks are permanently stuck due to crashes.
Session States
Sessions can be in one of these states:
| State | Icon | Resumable | Description |
|---|---|---|---|
running | ▶ | Yes | Session is (or was) actively running |
paused | ⏸ | Yes | Session was manually paused |
interrupted | ⚠ | Yes | Session was stopped via Ctrl+C or signal |
completed | ✓ | No | All tasks finished successfully |
failed | ✗ | No | Session encountered a fatal error |
Session Lock
Ralph uses a lock mechanism to prevent multiple instances:
- The session file includes a lock timestamp
- If the lock is stale (older than a threshold), resume can proceed
- Use
--forceto override the lock if needed
Example Workflow
Start Execution
Ralph begins processing tasks.
Interrupt
Press q to quit, or the process gets interrupted.
Session state is saved automatically.
Check Sessions (Optional)
View all available sessions.
Resume Later
Ralph continues from where it left off.
Troubleshooting
"Session lock exists"
Another Ralph instance may be running, or a previous instance crashed:
"No session found"
No .ralph-tui/session.json file exists in the working directory:
"Multiple sessions match prefix"
Your session ID prefix matches multiple sessions:
"Session not found in registry"
The session may have been started before the registry feature was added:
"Task stuck in_progress"
Resume handles this automatically, but you can also manually reset: