anthropics / anthropics/claude-code

[FEATURE] Let me find and resume Remote Control sessions locally: show them in /resume and add `claude rc list-sessions`

Ouverte
#94,369 0 commentaires 1 réaction 0 personnes assignées Voir sur GitHub
area:cli enhancement
Langage dominant
Python
Étoiles
145k
Forks
23.1k
Métriques de merge des PR
Métriques de PR en attente

Description

## Summary

When I run `claude rc` on my computer and start a session from my phone, I can never find that session again on the computer. `/resume` and `claude --resume` don't list it, and there is no command that does. The transcript is saved locally like any other session — the picker just hides it, and there's no way to look up its ID.

Proposed fix: show these sessions in `/resume` (marked as Remote Control sessions), and add `claude rc list-sessions` (or similar) that prints the local session ID, name, directory and first prompt, so `claude --resume ` / `claude rc --session-id ` become usable.

## Problem Statement

Sessions that the Remote Control server spawns for a phone/web client are written to `~/.claude/projects//.jsonl` with `"entrypoint":"sdk-cli"`. The resume picker filters every such session out. `claude --resume --debug-file …` confirms it:

```
Session ed9f1863-… filtered from /resume: entrypoint=sdk-cli
Session dcf41b86-… filtered from /resume: entrypoint=sdk-cli
Session 5f0da884-… filtered from /resume: entrypoint=sdk-cli
```

Consequences:

- `/resume`, `claude --resume` and Ctrl+A ("all projects") never show them — the same filter runs on every entry.
- `claude rc -c` only works for the last session and only for ~4 h.
- `claude rc --session-id ` and `claude --resume ` work, but nothing prints the ID. claude.ai/code lists the sessions but its URL uses a different id (`session_01K…`), not the local UUID.
- The only mapping is `~/.claude/sessions/.json` (`sessionId` ↔ `bridgeSessionId`), which is deleted when the process exits.

Today the workaround is grepping transcripts for `"entrypoint":"sdk-cli"` — not something a user should have to know.

## Proposed Solution

1. `/resume` and `claude --resume`: include `sdk-cli` sessions that were created by `claude remote-control` (they carry a `bridgeSessionId`), with a marker such as `· remote` in the row. If hiding headless SDK sessions is intentional for other SDK uses, scope the exemption to Remote Control-spawned ones.
2. `claude rc list-sessions` (or `claude rc --list`): print local session ID, session name (e.g. `my-repo-26`), cwd, status (if running), last modified, first prompt — for the current directory by default, `--all` for every project. Output should be usable directly with `claude --resume ` and `claude rc --session-id `.

## Alternative Solutions

- A flag `claude --resume --include-remote` / `--all-entrypoints` if changing the default is undesirable.
- Show the local session UUID somewhere in claude.ai/code / the mobile app.

## Environment

Claude Code 2.1.270 (also seen on 2.1.269), Linux, `claude rc` with default `--spawn same-dir`.

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.