Perch helps developers park AI coding sessions and resume them later from the CLI, menu bar, or Raycast. Run /perch inside a supported coding agent, and Perch saves the current session into ~/.config/perch/sessions.json.
Install the Perch CLI and supported agent /perch commands:
curl -fsSL https://raw.githubusercontent.com/ReScienceLab/Perch/main/install.sh | shThen:
- Make sure
~/.local/binis in your shellPATH. - Restart your coding agent.
- Type
/perch My task titleinside Claude Code, Codex, Pi, Droid, or OpenCode to save the current session. - Resume from Raycast with Search Sessions, from the menu bar, or by running
perch listand copying the resume command. - Verify setup any time with:
perch doctorPerch stores sessions locally only; no service or account is required.
- One
/perchcommand shared across agents — no per-agent prompt drift. - Fast session detection where the agent exposes a session ID (for example
CLAUDE_CODE_SESSION_IDin Claude Code), with safe fallbacks when needed. - Simple local JSON storage; no service or account required.
- Menu bar UI for viewing pending/completed sessions.
- CLI for scripting, listing, marking done, and reopening sessions.
| Agent | /perch install |
Resume command |
|---|---|---|
| Claude Code | Automatic | claude --resume <id> |
| Codex | Automatic | codex resume <id> |
| Pi | Automatic | pi --session <id> |
| Droid | Automatic | droid --resume <id> |
| OpenCode | Automatic | opencode session resume <id> |
| Goose | Manual CLI add | goose session -r --name <id> |
| Kiro | Manual CLI add | kiro-cli chat --resume-id <id> |
| Windsurf | Manual CLI add | windsurf <working-dir> |
| Cursor | Manual CLI add | cursor <working-dir> |
| Trae | Manual CLI add | trae <working-dir> |
| Amp | Manual CLI add | amp threads continue <id> |
Automatic means
install.shdetects the agent binary and installs/perchinto that agent's command/skill directory. Manual CLI add means Perch supports the resume command, but there is no installed slash-command path yet.
Recommended remote install:
curl -fsSL https://raw.githubusercontent.com/ReScienceLab/Perch/main/install.sh | shLocal repo install for contributors:
git clone https://github.com/ReScienceLab/Perch.git
cd Perch
./install.shThe installer is idempotent. It:
- Installs the
perchCLI to~/.local/bin/perch, using the latest GitHub Release prebuilt binary by default. - Falls back to a local Cargo build only when running from a cloned repo and release download is unavailable.
- Installs the native macOS
PerchAppmenu bar app to~/.local/share/perch/PerchAppby default on macOS. - Installs the same agent-agnostic command from
Commands/perch.mdfor every detected agent. - Creates
~/.config/perch/sessions.jsonif missing. - Creates
~/.config/perch/configif missing.
Installer environment flags:
PERCH_INSTALL_APP=0 # skip native menu bar app installation
PERCH_INSTALL_APP=1 # force native menu bar app installation on macOS
PERCH_APP_INSTALL_DIR=... # override app install directory; default ~/.local/share/perch
PERCH_OPEN_APP=0 # install but do not open PerchApp after installMake sure ~/.local/bin is in your shell PATH and is also visible inside your coding agents. Run perch doctor after installation for actionable diagnostics.
| Agent | Installed file |
|---|---|
| Claude Code | ~/.claude/commands/perch.md |
| Codex | ~/.codex/skills/perch/SKILL.md |
| Pi | ~/.pi/agent/skills/perch/SKILL.md |
| Droid | ~/.factory/skills/perch/SKILL.md |
| OpenCode | ~/.config/opencode/commands/perch.md |
On macOS, the one-line installer installs and opens the native menu bar app by default:
curl -fsSL https://raw.githubusercontent.com/ReScienceLab/Perch/main/install.sh | shThe app is installed to ~/.local/share/perch/PerchApp unless PERCH_APP_INSTALL_DIR is set. The Perch icon appears in the menu bar. Open it to view active and completed sessions.
Control the app from the CLI:
perch menubar start [--app-path <path>]
perch menubar stop
perch menubar status
perch menubar login enable [--app-path <path>]
perch menubar login disable
perch menubar login statusperch menubar login enable writes ~/Library/LaunchAgents/com.resciencelab.perch.plist and uses launchctl bootstrap/enable for the current GUI user. The LaunchAgent runs with your user privileges and only launches the configured PerchApp binary. The installer opens the app after install but does not enable launch-at-login automatically.
If launch-at-login fails with permission errors, check that your terminal has the required macOS privacy permissions for writing ~/Library/LaunchAgents and running launchctl in your GUI session.
Local development still requires macOS 13+ and a Swift toolchain:
cd App
swift build
.build/debug/PerchAppPerch also includes a Raycast extension for searching, resuming, and managing parked sessions from Raycast.
cd raycast-extension
npm install
npm run devAvailable commands:
- Search Sessions — browse
~/.config/perch/sessions.json, copy/paste project-aware resume commands, open working directories, mark sessions done, and reopen sessions. - Add Session — manually add sessions for agents that do not yet have an installed
/perchcommand.
Run npm run lint and npm run build in raycast-extension/ before publishing or submitting changes.
Inside a supported agent:
/perch [optional title]
Examples:
/perch
/perch Backend: add auth endpoint
If you omit the title, the agent generates a short Project: action title.
Inside a supported agent:
/perch done
Or from a terminal:
perch done <perch-id-or-prefix>
perch done --session-id <agent-session-id>Open the Perch menu bar item, open a session's submenu, and choose Delete Session. This removes the saved Perch entry only; it does not delete the underlying agent history from Claude/Codex/Pi/etc.
Open the Perch menu bar item and click a session. Perch copies a project-aware shell command to your clipboard:
cd '/absolute/path/to/project' && claude --resume <id>
cd '/absolute/path/to/project' && pi --session <id>
cd '/absolute/path/to/project' && opencode session resume <id>Paste it into any terminal to resume from the correct working directory.
Use this for agents that do not yet have an installed /perch command:
perch add \
--title "MyApp: fix login" \
--agent claude \
--session-id <id> \
--working-dir "$PWD"For workspace-based agents such as Cursor/Windsurf/Trae, Perch stores the working directory and creates the appropriate resume command:
perch add --title "Site: continue CSS" --agent cursor --session-id unused --working-dir "$PWD"perch add --title "..." --agent <agent> --session-id <id> [--working-dir <dir>] [--note "..."] # create or update
perch list
perch list --all
perch list --all --json
perch done <perch-id-or-prefix>
perch done --session-id <agent-session-id>
perch reopen <perch-id-or-prefix>
perch reopen --session-id <agent-session-id>
perch menubar start [--app-path <path>]
perch menubar stop
perch menubar status
perch menubar login enable [--app-path <path>]
perch menubar login disable
perch menubar login status
perch doctor
perch doctor --jsonperch add is an upsert keyed by agent + session_id:
- First save creates a new pending entry.
- Saving the same resumed session again updates the existing entry instead of creating a duplicate.
- Updates refresh
title,working_dir,note,resume_cmd, setstatusback topending, and writeupdated_at. created_atremains the original first-save timestamp.
Perch uses one shared command file. The agent identifies itself (claude, codex, pi, droid, or opencode) and runs only its own session detector.
Current fast paths and fallbacks:
- Claude Code: prefers
CLAUDE_CODE_SESSION_ID, then older env vars, then the current project's~/.claude/projects/.../sessions-index.json. - Pi: prefers
PI_SESSION_ID, then the current project's~/.pi/agent/sessions/.../*.jsonl. - Codex: prefers
CODEX_SESSION_ID, then the latest file in~/.codex/sessions. - Droid: prefers
DROID_SESSION_ID, thendroid session list --json. - OpenCode: prefers
OPENCODE_SESSION_ID, thenopencode session list.
The command is intentionally strict: it should not try another agent's detector just because that binary exists on your machine.
Sessions are stored locally at:
~/.config/perch/sessions.json
Each entry looks like:
{
"id": "perch-entry-uuid",
"agent": "claude",
"session_id": "agent-native-session-id",
"working_dir": "/path/to/project",
"title": "Project: action",
"note": "",
"priority": "medium",
"status": "pending",
"created_at": "2026-05-18T10:00:00Z",
"updated_at": "2026-05-18T10:30:00Z",
"resume_cmd": "claude --resume agent-native-session-id"
}The schema is documented in schema/session.json.
Open config from the menu bar (Open Config) or edit:
~/.config/perch/config
Default file:
# Perch configuration
terminal = ghostty
sort-by = date
max-sessions = 20
auto-start = true
show-badge = trueshow-badge controls whether the menu bar icon shows the pending session count. Other keys are kept for app behavior and future UI options.
Run the full test suite:
./scripts/test.shRun individual suites:
cargo test --manifest-path cli/Cargo.toml
cd App && swift test
./tests/install.sh
python3 tests/schema.pyBuild release artifacts locally:
cargo build --release --manifest-path cli/Cargo.toml
cd App && swift build -c releaseAdd ~/.local/bin to your PATH, then restart the agent so it inherits the updated environment.
Update the relevant agent and reinstall Perch:
./install.shFor Claude Code, newer versions expose CLAUDE_CODE_SESSION_ID to Bash tools, which is the fastest path.
Check what the CLI sees:
perch list --allAlso verify that ~/.config/perch/sessions.json exists and contains valid JSON.
Check app status:
perch menubar statusRe-run the installer with app installation enabled:
PERCH_INSTALL_APP=1 ./install.shIf a checksum mismatch is reported, the artifact was not installed. Retry later or install from a known-good release asset.
Inspect and reset the LaunchAgent:
perch menubar login status
perch menubar login disable
perch menubar login enablePerch is released under the MIT License. See LICENSE.