Skip to content

The Claude Code MCP header helper takes its code scope from the plugin root, not the session's checkout #337

Closed

Description

@zlareb1

What happens

The Claude Code plugin's MCP header helper (integrations/claude-code-plugin/bin/loom-mcp-headers.mjs) derives X-Loom-Code-Scope from the git checkout of its working directory (checkoutScope(process.cwd())). Claude Code starts a plugin's headersHelper from the plugin root, not from the project directory (MCP docs, "Where the helper runs"). So the header names:

  • no checkout, when the plugin is installed from a git marketplace into ~/.claude/plugins/cache/... (the code scope then comes only from LOOM_CODE_REPO / code_repo);
  • the wrong checkout, when the plugin root sits inside one: a local-path marketplace (claude plugin marketplace add <path to a Loom clone>), or a home directory under a dotfiles repository.

Expected

The header names the namespace of the checkout the session works in, as the hooks do (they read payload.cwd).

Reproduce

Install the plugin from a local clone (claude plugin marketplace add /path/to/loom && claude plugin install loom@loom), start a session in another indexed checkout, and look at the X-Loom-Code-Scope the server receives on /mcp: it is the Loom clone's.

Versions

Claude Code 2.1.319, plugin 1.2.8 (also 1.2.7).

Found while adding the platform matrix in #313.

Activity

  1. added
    bug
    on Nov 7, 2026
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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions