rft
Integrations

Shell Prompt

Show rft status in your terminal prompt

rft status

The rft status command outputs a compact one-line status string designed for shell prompt integration:

rft status
# Output: rft: 3/5 up

The format is rft: <running>/<total> up, showing how many worktree stacks are currently running out of the total.

Zsh Integration

Add to your ~/.zshrc:

BASE_PS1="$PS1"
precmd() {
  local rft_info
  rft_info=$(rft status 2>/dev/null)
  if [[ -n "$rft_info" ]]; then
    PS1="$rft_info $BASE_PS1"
  else
    PS1="$BASE_PS1"
  fi
}

The precmd hook runs before each prompt, so rft status updates in real-time as you start and stop stacks.

Bash Integration

Add to your ~/.bashrc:

export PS1="\$(rft status 2>/dev/null) $PS1"

Note the escaped \$ — this ensures rft status runs on each prompt, not just once at shell startup.

Behavior Outside Repos

When run outside a git repository or in a repo without worktrees, rft status outputs nothing (empty string) and exits silently. The 2>/dev/null redirect suppresses any error output.

On this page