Documentation
¶
Overview ¶
Package ide finds the IDEs that Claude Code can connect to, from the lock files that their Claude Code plugins write, and links Claude Code in the VM to one of them.
Index ¶
Constants ¶
const AuthHeader = "X-Claude-Code-Ide-Authorization"
AuthHeader is where Claude Code shows the token of a lock file.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bridge ¶
type Bridge struct {
IDE IDE
Token string
// Project is the folder of the project on the host, which is /project
// in the VM
Project string
// Log gets what the bridge held back and why the link ended, or is nil
Log io.Writer
// contains filtered or unexported fields
}
Bridge links Claude Code in the VM to the IDE on the host. The VM shows Token, a token of its own, and the bridge shows the IDE the token of the IDE, which the VM never sees. Only what the bridge knows to be harmless goes through, since the IDE runs with the rights of the person.
type IDE ¶
IDE is an IDE that serves Claude Code on a WebSocket on the loopback of the host. Token is what a client must show it. It must not get into the VM or into a log.
func Find ¶
Find returns the IDEs of the lock files in dir that have the project open, best first: the one whose folder is closest to the project, then the one that wrote its lock file last. A file that is no lock file of a WebSocket is left out, and so is a missing dir. Whether an IDE still runs shows only when it is connected to, since the process a lock file names may be gone and its number taken by another.