Skip to content

[Bug]: Servers panel lists the Claude CLI's own port when a mod registers a tool #36173

Closed

Description

@sulcer

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/server

Steps to reproduce

  1. Load a Claude Code mod that registers a tool, for example with CLAUDE_CODE_PLUGIN_DIRS or /plugin install. A minimal one:

    // hooks/register.ts
    export const register: Register = (on) => {
      on("session.start", async ($, e, next) => {
        await $.tool.register({ name: "ping", description: "Answers pong.", inputSchema: { type: "object", properties: {} } });
        return next(e);
      });
    };
  2. Start a Claude thread in T3 Code and send any message.

  3. Open the thread details panel.

Expected behavior

The Servers section lists only servers that the thread's agent or terminals started.

Actual behavior

The Servers section lists the Claude CLI itself, for example localhost:62403 · Agent · 2.1.323 (the CLI's version is the process name). The page at that port returns 404 not found. The row shows in every Claude thread.

Cause: Claude Code holds a loopback port when a plugin registers a tool with $.tool.register. ClaudeAdapterV2 launches the CLI with T3CODE_THREAD_ID in its own environment. PortScanner attributes every listener whose process carries that variable to the thread, so the CLI's own port reads as a server it started.

Without such a mod the CLI holds no port. An empty mod, a skills-only plugin, or a mod that adds its tool through a tool.list hook (mcp: false) does not trigger it.

Impact

Cosmetic issue

Version or commit

T3 Code Nightly 0.1.10-nightly.20261113.4630. Reproduced on main at 2d8a843 with vp run dev.

Environment

macOS 27.0.1, Claude Code 2.1.323. The Linux path reads the same environment variable, so it should behave the same. I did not check Linux.

Logs or stack traces

$ lsof -nP -a -p <claude pid> -iTCP -sTCP:LISTEN
2.1.323 <pid> ... TCP 127.0.0.1:62403 (LISTEN)
$ curl -s -o /dev/null -w '%{http_code}' http://127.0.0.1:62403/
404

Screenshots, recordings, or supporting files

Thread details panel on main, after one Claude turn:

Servers section lists localhost:62403, Agent · 2.1.323

Workaround

None in T3 Code. A mod author can avoid it by adding the tool through a tool.list hook instead of $.tool.register.

Activity

  1. jsc2304 commented on Nov 15, 2026

    @jsc2304

    Another reproduction of this. Claude Code 2.1.325 in a Claude thread (T3 Code, macOS) shows localhost:64192 · Agent · 2.1.325 in the Servers section of the thread details panel.

    I checked the port: lsof shows it is held by the session's own claude --output-format stream-json … process, not by anything the agent or a terminal started. A mod in this session registers a tool through $.tool.register, which matches the cause described above.

    Suggested fix: when PortScanner attributes listeners to a thread, skip the thread's own agent process (for example by PID, or by checking the process is the adapter's CLI) and only list descendants it spawned.

  2. juliusmarminge commented on Nov 19, 2026

    @juliusmarminge
    Member

    Fixed by #38916, now on main: With a Claude mod registering a tool, the Servers panel now excludes the Claude CLI's own loopback listener while retaining servers its commands start.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions