Skip to content

feat: add KEEP_MONITOR_AFTER_EXIT option to preserve tmux session after loop exits #213

@DrumRobot

Description

@DrumRobot

Description

After #176 was fixed, the tmux session is automatically terminated when the Ralph loop exits. This is good default behavior, but sometimes users want to keep the monitor panes alive after the loop finishes to review the final status, logs, and Claude output.

Use Case

  • Review the last status dashboard and Claude output after Ralph completes
  • Inspect tail -f live.log output for debugging without re-opening files
  • Keep the tmux session as a reference while working on follow-up tasks

Proposed Solution

Add a KEEP_MONITOR_AFTER_EXIT config option (default: false) that skips the tmux kill-session chain when set to true.

.ralphrc usage:

KEEP_MONITOR_AFTER_EXIT=true

Behavior:

  • false (default): Current behavior — entire tmux session terminates when loop exits
  • true: Ralph pane shows exit message, but tail -f and status monitor panes remain active. User can manually close with tmux kill-session.

Implementation:

  • Add default variable: KEEP_MONITOR_AFTER_EXIT="${KEEP_MONITOR_AFTER_EXIT:-false}"
  • Conditional in setup_tmux_session(): branch on the config value

This is a minimal 2-line change that preserves the #176 fix as the default.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions