Skip to content

Reference rebridge skill

/rebridge <session-name-fragment> re-publishes a Claude Code tmux session to the Remote Control bridge. Use when a session is alive on Console (still in tmux, claude process running) but disappeared from the desktop UI's Active list — usually caused by idle bridge expiry.

Files

  • forge/scripts/forge_rebridge_session.py — implementation
  • forge/.claude/skills/rebridge/SKILL.md — skill definition

How it works

  1. Scans all sockets in /tmp/tmux-1000/ for a tmux session whose name contains the fragment (case-insensitive).
  2. Finds the claude PID inside the pane via pgrep -P <pane_pid>.
  3. Sends Ctrl-U then /remote-control + Enter into the pane.
  4. Polls ~/.claude/sessions/<pid>.json up to 20s for an updated bridgeSessionId.
  5. Prints the new https://claude.ai/code/<bridge> URL.

Why this exists

bridgeSessionId going null is normal — bridge tokens expire. The reaper protects home-base* sessions from being killed in this state, but the UI still won't show them until they're republished. Before this skill, manual fix was: tmux -S /tmp/tmux-1000/<sock> send-keys -t <sess> "/remote-control" Enter — a 30-character incantation no one remembered.

  • reference_orphan_claude_reaper.md — the reaper that DOES kill non-protected sessions in this state after 2h grace.
  • reference_home_base_session.md — the canonical persistent anchor.