Skip to main content

Module lockfile

Module lockfile 

Source
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.
LockfileContents
Body of a <port>.lock discovery file. camelCase on the wire to match the VS Code schema the claude CLI expects.

Functions§

default_lock_dir
The default discovery directory, ~/.claude/ide. None when the home directory can’t be resolved (the caller logs-and-skips).