Expand description
Discovery lockfile: ~/.claude/ide/<port>.lock.
An attaching claude CLI discovers a running IDE by scanning
~/.claude/ide/ for <port>.lock files and reading the connection
details (port from the filename, auth token + workspace from the JSON
body). The lockfile is RAII: written on start, unlinked on Drop,
so a crashed or stopped server leaves no stale discovery entry.
NOTE: the exact JSON field set mirrors the VS Code IDE-integration
schema and is provisional — verified against a live claude CLI
before the terminal-launch slice (I5, Risk 1).
Structs§
- Lockfile
- An RAII discovery lockfile. Created by
write; the file is removed when this value is dropped. - Lockfile
Contents - Body of a
<port>.lockdiscovery file.camelCaseon the wire to match the VS Code schema theclaudeCLI expects.
Functions§
- default_
lock_ dir - The default discovery directory,
~/.claude/ide.Nonewhen the home directory can’t be resolved (the caller logs-and-skips).