convez.ai
Skill
fireman333

claude-remote-launcher

fireman333/claude-remote-launcher

Ver no GitHub
InicialPluginScore · de 0 a 100

Claude Code skill: spawn a phone-attachable Remote Control session in any recent project directory, from inside a running session.

Instalação

$npx convez-ai fireman333/claude-remote-launcher

1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.

Métricas

Estrelas
0
Forks
0
Acompanhando
0
Saúde
42%
Último commit
há 1 mês
Versão
—
Issues abertas
0
Contribuidores
1

README

A tradução para o português deste README ainda está na fila.

claude-remote-launcher

A Claude Code Skill that spawns a phone-attachable Remote Control session in any of your recent project directories — launched from inside an already-running Claude Code session.

Built for the case where you're away from your desk, only have your phone, and the desktop Claude Code is alive but you can't reach its terminal to type claude remote-control yourself. Ask the running session to open a new one, get a claude.ai/code URL back, and take it over on your phone.

It is a thin wrapper around the official Remote Control feature — it does not reimplement any remote protocol. Claude keeps running locally on your machine; the phone/browser is just a window into it.

Why

The official feature already lets your phone take over a running session, and Dispatch lets the mobile app spawn a Desktop session. What neither does:

  • start a brand-new CLI Remote Control session from a session you're already in, and
  • let you pick which recent project to open it in.

That's the ~5% gap this skill fills.

What it does

  1. Lists your most recently active project directories — read from the real cwd recorded in ~/.claude/projects/*/ transcripts (not by decoding folder names, which mangle dashes, e.g. study-rpg → study/rpg).
  2. Spawns a detached claude --remote-control daemon in the one you pick — double-fork + setsid + a real PTY, so it survives the launching session exiting and claude gets the TTY it requires.
  3. Returns the claude.ai/code session URL to open or scan on your phone, and tracks a pid file so you can stop it later.

Requirements

  • Claude Code v2.1.51+ (claude --version)
  • Signed in with a claude.ai account (/login) on a Pro / Max / Team / Enterprise plan. Remote Control does not support API keys.
  • The target directory has accepted the workspace-trust dialog once.
  • Python 3.9+ (standard library only — no dependencies).
  • macOS or Linux.

Workspace trust (--auto-trust)

The first time claude opens a directory it can show two one-time confirmation dialogs: workspace trust ("Is this a project you trust?") and, if that dir's CLAUDE.md uses @import, an external-includes approval. A detached session has nobody to click them, so it stalls until timeout.

--auto-trust (or running scripts/ensure_trusted.py <dir> beforehand) declaratively sets hasTrustDialogAccepted and hasClaudeMdExternalIncludesApproved to True for that directory in ~/.claude.json — the equivalent of clicking "trust". It is off by default and only touches those two booleans (atomic write, everything else preserved). Use it only for directories you actually trust.

Install

Clone into your Claude Code skills directory:

git clone https://github.com/<you>/claude-remote-launcher \
  ~/.claude/skills/claude-remote-launcher

Claude Code discovers it automatically. Trigger it with /remote-launch or phrases like "open a session I can pick up on my phone".

Manual use (without the skill layer)

The scripts work standalone too:

# List recent project dirs
python3 scripts/list_recent_projects.py --limit 10

# Open a phone-attachable session in one of them
python3 scripts/launch_remote.py ~/code/my-project "my-project-mobile" --auto-trust
#   -> URL: https://claude.ai/code/session_XXXX

# List / stop running launcher sessions
python3 scripts/stop_remote.py
python3 scripts/stop_remote.py my-project-mobile
python3 scripts/stop_remote.py --all

Connecting from your phone

  • Claude app: open the URL, or go to the Code tab and find the session by name (computer icon + green dot when online).
  • Browser: open the URL on any device.
  • Back at the desktop: claude --resume lists the session locally so you can take it over from the terminal too.

Limits

  • The local process must stay alive. If the machine sleeps with no network, or goes offline for >~10 minutes, Remote Control times out and the daemon exits — relaunch for a new session.
  • One remote session per claude process (each launch = its own daemon).
  • Local-only commands (/resume, /mcp, /plugin) work only from the desktop terminal, not the phone/web window.

How it stays alive

claude refuses to run without a TTY and Remote Control needs the process to persist. launch_remote.py therefore:

  1. forks twice and calls setsid so the daemon detaches from the launching shell and can never reacquire a controlling terminal;
  2. gives claude a PTY via pty.openpty();
  3. drains the PTY master into a log file so the kernel buffer never blocks, and reads the session URL back out of that log.

License

MIT — see LICENSE.

Disclaimer

Not affiliated with Anthropic. "Claude" and "Claude Code" are trademarks of Anthropic. This is an independent helper around a documented, official feature.

Ver o original no GitHub

Bom para

Relacionados