The map to working in Rex, its gotchas, and the one way to start a Claude Code session in a Rex tab, including workers that report back to your session. Read before every rex command and before starting a Claude Code session in another Rex tab or pane, because a tab started the wrong way stalls at a prompt nobody sees, a worker started without its rules never reports back, and a failed step in a chained command can leave you reading your own pane. Re-invoke each time.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Use Rex?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/ooloth-use-rex)
---
name: use-rex
description: The map to working in Rex, its gotchas, and the one way to start a Claude Code session in a Rex tab, including workers that report back to your session. Read before every rex command and before starting a Claude Code session in another Rex tab or pane, because a tab started the wrong way stalls at a prompt nobody sees, a worker started without its rules never reports back, and a failed step in a chained command can leave you reading your own pane. Re-invoke each time.
allowed-tools: Read Bash(uv run ~/.claude/skills/use-rex/scripts/watch_workers.py *) Bash(uv run ~/.claude/skills/use-rex/scripts/show_workers.py *) Bash(uv run ~/.claude/skills/use-rex/scripts/read_worker_report.py *)
---
Read the `rex` skill's guide for the commands themselves. This skill holds what that guide doesn't
say, and points to the file for each job:
| Job | Read |
| --- | --- |
| Run a `rex` command: tabs, panes, capture, send | The `rex` skill's guide |
| Open a Claude Code tab that is handed to the user, such as a review handoff | This file |
| Read what a Claude Code tab is doing | This file: `program_status`, and the transcript |
| Start Claude Code workers that report back to your session, and hear from them | `references/orchestration.md` |
| Be a worker | Nothing: `start_worker.py` puts `references/workers.md` in a worker's system prompt |
## Start Claude in a tab only through the launcher
```sh
bash ~/Repos/ooloth/dotfiles/tools/rex/claude-tab.bash [-s <session>] '<tab name>' <directory> [claude arguments]
```
It runs Claude through `tools/claude/cc.bash`, which picks this machine's permission mode and adds
the repo's related folders. Never start `claude` in a tab yourself, with or without
`--permission-mode`. The right mode differs between machines, and a session started in the default
mode stops at its first skill prompt, where nobody is watching.
A tab nobody will watch work, such as one `monitor-prs` or `start_worker.py` opens, passes
`--unattended` as its first Claude argument, before the prompt. `cc.bash` then starts it in auto
mode on every machine, never in bypass mode.
The tab opens in the session that holds the pane the launcher runs in, beside the tab that asked
for it, found through `$REX_BLOCK`, and `-s` names another session instead. The launcher
prints Rex's JSON for the new tab: `.block_ids[0]` is its pane and `.session_id` its session. Rex
looks for a pane only in your own session unless `-s` names another, so name both when you ask what
the tab's Claude Code is doing: `rex block call -s <session_id> -b <pane> program_status` returns
the state it reports, such as `working`, `done` at the end of a turn, or `blocked` with a `kind`
of `question` or `permission` and a `msg` such as `trust this folder`.
A session that works for yours and reports back starts through `scripts/start_worker.py` rather
than the launcher alone, as `references/orchestration.md` says. It also chooses the worker's session
ID and `SendMessage` name and gives it the rules to report by, and `scripts/watch_workers.py` tells
you each time a worker's state changes.
A tab's name says what is happening in it: `<subject> (<person>): <activity>`. The subject is what
the tab works on, such as `PR 123`, `Issue 412` or `ENG-45`. The person is the login of whoever
wrote the subject: the PR's or issue's author, or your user's login for a ticket with no PR yet.
An app's login is spelled as GraphQL spells it, such as `dependabot`, not `gh`'s `app/dependabot`
or REST's `dependabot[bot]`, because `monitor-prs` finds a tab by that spelling.
Leave out the parentheses when no person wrote it, as in `CI test-suite: investigate`. The activity
is the skill the tab runs, such as `review-code`, so other skills can tell from the label alone that
a PR is already being handled. A tab that runs no skill names its activity in one plain word, such
as `investigate`, `lazygit` or `diff`.
Tab names start with a word, never an emoji: `PR 123 (alice): review-code`, not
`👀 PR 123 (alice): review-code`.
hub's TUI names and places its own tabs differently: `<project>#<number>: <activity>`, such as
`hub#205: investigate`, in the session that holds the TUI. So the launcher and hub never find each
other's tabs.
## Gotchas
- **Don't chain a close and an open with `&&`.** If the user already closed the tab, `rex window
close` fails and the new tab never opens. List the tabs first, or run the two separately.
- **Read IDs with `jq -e`.** `jq -r` turns a missing ID into an empty string, and
`rex capture -b ""` captures your own pane instead of failing.
- **Build every commit hash in a tab's prompt from git output.** A hash typed from memory can name
a commit that doesn't exist, and the new session spends its start looking for it. Put
`$(git rev-parse --short <ref>)` in the prompt, or check each hash with `git cat-file -t <hash>`
before opening the tab.
- **A Claude Code tab can't be read through its screen.** Claude Code runs full-screen, which keeps
no scrollback, so `rex capture` on its pane returns only what is visible. Ask Rex for its state
with `program_status`, as above, and read what it said from its transcript:
`find ~/.claude/projects -name '<session ID>.jsonl'`. Start the session with
`--session-id <uuid>` when you will want to follow it.
- **Find which session to message from `claude agents --json`.** `ListAgents` names peer sessions
without their session IDs, so it can't say which one owns a transcript, a worktree or a file in
progress. `claude agents --json` lists every running session with its `name` (the address
`SendMessage` takes), `sessionId`, `cwd` and `status`, so a session working in a worktree is the
one whose `cwd` is that worktree. A session that works on a folder outside its `cwd` is found by
searching the transcripts for the folder's unique name, such as `tmp.AbC123`, not its full path,
because macOS writes a temp path both with and without `/private`:
`grep -l 'tmp.AbC123' ~/.claude/projects/*/*.jsonl`. Every transcript that mentions the folder
matches, your own included and any session that was only told about it, so read each match and
keep the one whose own tool calls name it, in a Bash `command` or an Edit or Write `file_path`.
The file's name is the session ID; match it to a `sessionId` in `claude agents --json`.