Help us shape the future of Go! Take the 2026 Go Developer Survey

ide

package
v1.6.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 12, 2026 License: Apache-2.0 Imports: 22 Imported by: 0

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

View Source
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.

func (*Bridge) ServeHTTP

func (b *Bridge) ServeHTTP(w http.ResponseWriter, r *http.Request)

type IDE

type IDE struct {
	Name  string
	Port  uint16
	Token string
}

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

func Find(dir, project string) ([]IDE, error)

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.

func (IDE) String

func (i IDE) String() string

String names the IDE without its token.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL