claude-remote
Claude Remote Session Manager
Manage Claude Code --remote-control sessions running in Terminal.app. Designed for remote desktop clients that let users control Claude Code from mobile devices.
State Directory
All session state lives in ~/.claude-remote/. On every skill invocation, always run the cleanup script first to sync state with reality.
Scripts
This skill bundles a session manager script. All paths below are relative to the skill directory:
scripts/session-manager.sh— handles create, list, remove, cleanup, and stop operations
Get the script path:
SKILL_DIR="$(dirname "$(dirname "$(realpath "$0")")")"
# Or just use the known absolute path after reading it from the skill location
Workflow
On Every Invocation
Before doing anything else, run cleanup to remove stale entries:
bash <skill-dir>/scripts/session-manager.sh cleanup
This checks each recorded session's Terminal window still exists and removes dead entries. If any sessions were cleaned up, tell the user (e.g., "2 stale sessions were cleaned up — their Terminal windows were closed outside this tool").
Determine Intent
Parse what the user wants:
| Intent | Triggers |
|---|---|
| start | "start", "open", "launch", "new session", "remote control" |
| stop | "stop", "close", "kill", "shut down", "exit" |
| list | "list", "status", "show", "which sessions", "what's running" |
If ambiguous, ask.
Start Flow
-
Try to infer from context first. If the user's message already contains a directory name or path (e.g., "launch claude in ~/Workspace/my-app"), use it directly — skip the directory picker. Also detect any options mentioned naturally (e.g., "with opus model" →
--model opus). -
Only if the directory is unclear, list directories under
~/Workspace:bash <skill-dir>/scripts/session-manager.sh list-dirsPresent as a numbered list via
AskUserQuestion. Include an option to create a new directory. Note:~/Workspaceis the default root; if it doesn't exist, ask the user for their workspace path. -
If creating new:
mkdir -p ~/Workspace/<new-dir-name> -
Common options (only ask if not already inferred from context):
Option Flag Default Example Permission mode --permission-mode <mode>bypassPermissions--permission-mode autoModel --model <model>(user default) --model sonnetor--model opusSession name -n <name>(auto) -n "mobile-debug"Effort level --effort <level>(user default) --effort highWorktree -w, --worktree [name]— Create a git worktree for the session If the user doesn't specify any, use defaults (no extra flags). -
Launch the session:
RESULT=$(bash <skill-dir>/scripts/session-manager.sh create <directory-path> [extra-flags...])This opens Terminal.app via AppleScript, runs
claude --permission-mode bypassPermissions --remote-control [extra-flags]in the chosen directory, and records the session. -
Report the session ID, directory, and window ID to the user. Mention they can now connect via their remote control client.
Continue (Resume Last Conversation)
When the user wants to pick up where they left off in a directory (triggers: "continue", "resume", "接着上次", "继续上次的对话"), pass the -c flag to the start flow. It tells claude to continue the most recent conversation in that directory instead of starting a fresh one.
bash <skill-dir>/scripts/session-manager.sh create <directory-path> -c [other-flags...]
Notes:
-conly resumes the most recent conversation in the chosen directory. If the user wants a specific older conversation, they'll need to useclaude --resumeinteractively instead.- Combine freely with other flags (
--model,-n,-w, etc.). - If no prior conversation exists in that directory,
claudewill fall back to a new session.
Stop Flow
-
Get active sessions:
bash <skill-dir>/scripts/session-manager.sh list -
If no sessions: tell the user there's nothing to stop.
-
If one session: confirm with user, then stop it.
-
If multiple: present numbered list via
AskUserQuestion, let user pick one or "all". -
Stop the selected session(s):
bash <skill-dir>/scripts/session-manager.sh stop <session-id> # or stop all: bash <skill-dir>/scripts/session-manager.sh stop-all -
Report what was stopped.
List Flow
-
Run:
bash <skill-dir>/scripts/session-manager.sh list -
Present a formatted table:
# Session ID Directory Started Window 1 a1b2c3d4 ~/Workspace/my-app 10:30 today 98905 2 e5f6a7b8 ~/Workspace/api-work 09:15 today 98820 -
If no sessions: "No active remote sessions."
Examples
| User says | Resolved action |
|---|---|
| "start a remote claude in my-app" | create ~/Workspace/my-app |
| "launch claude in ~/code/api with opus" | create ~/code/api --model opus |
| "接着上次的 my-app 继续" | create ~/Workspace/my-app -c |
| "open a remote session in a worktree of api-work" | create ~/Workspace/api-work -w |
| "stop the my-app session" | list → match by directory → stop <id> |
| "kill all remote sessions" | stop-all |
| "what's running?" | list → render as table |
Important Notes
- The script uses
osascript(AppleScript) to control Terminal.app — this only works on macOS. - Each session opens a new Terminal window (not a tab) for isolation.
- Stop uses Terminal's native "terminate process" dialog to shut down Claude Code, then closes the window.
- Session state is stored as individual JSON files in
~/.claude-remote/sessions/— one file per session for atomicity.
More from ben2pc/g-claude-code-plugins
deep-review
Run a formal, multi-dimensional code review of a pull request. Reads the PR diff, classifies change types, dispatches parallel reviewers by dimension (spec-conformance, correctness incl. test quality, docs-sync, plus conditional robustness/UX/performance/structure and code-quality for non-trivial changes), and synthesizes findings into an actionable punch list. Use when the user asks to review a PR, run /deep-review, mark a PR as ready for review, or requests a formal/thorough code review.
25parallel-implementation
Plan how to slice a non-trivial coding task across parallel subagents. Returns a dispatch plan (file assignments, dependencies, output-format contracts) — the main Agent then executes it with the Agent tool + `isolation: \"worktree\"`. Invoke only when work justifies multi-agent overhead: (a) greenfield 0→1 across multiple independent modules, (b) change touches ≥3 modules, or (c) ≥5 files each with >50 lines of diff. Small changes write inline.
25test-designer
Design failing tests for complex features using Independent Evaluation — dispatches a context-free agent that sees only the requirement spec and code paths (not the implementation approach), then returns executable failing tests. Use when starting TDD for a non-trivial feature, when the requirement is ambiguous enough that biased tests are a risk, or when the user asks for independent test design.
24codex-agent
通过 Codex CLI 将编码、审查、诊断、规划、结构化输出和本机浏览器调研任务委派给独立的 Codex 会话。使用场景包括 `codex exec` 新建任务、`codex exec resume` 续接多轮会话、`codex exec review` 做只读审查,以及需要 `--json` 事件流、`-o` 最终消息落盘、图片输入或 Computer Use 浏览器操作时。
22claude-code-agent
通过 Claude Code CLI 的 `claude -p` Agent SDK 入口,将编码、审查、诊断、规划和结构化输出任务委派给独立 Claude Code 会话。使用场景包括 `--resume` / `--continue` 续接多轮会话、`--output-format json` 单结果输出、`stream-json` 事件流,以及需要 `--worktree`、工具白名单、`--bare` 或结构化 JSON 输出的 scripted / CI 调用。
10ip-diagnosis
在 macOS + Chrome 上排查公网 IPv4/IPv6 出口、国家/地区、ASN/组织、DNS、默认路由、utun 状态,以及浏览器侧 Server Response 与 WebRTC 暴露情况。适用于用户要求检查 IP、地区一致性、VPN/代理接管情况、IPv6 问题或浏览器网络暴露,并输出详细运维报告与复查链接。
7