extension-debug

extension-debug is a command for Claude Code from extensiondev/mcp. It costs 13 tokens per session (1,033 once invoked), scanned A, original, Apache-2.0.

A command guide for investigating a browser extension while its development version is running.

In plain words
What is it for?
Use it to inspect the live page, query elements with CSS selectors, review logs, and test extension actions or event handlers.
Why use it?
It helps reveal the page structure, console errors, extension files, and injected scripts behind a problem.

Command for Claude Code

Written for Claude Code: argument-hint in frontmatter.

Part of the extension-mcp plugin — 4 commands, 1 MCP server shipped together

Good fit Use it to inspect the live page, query elements with CSS selectors, review logs, and test extension actions or event handlers.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/extensiondev/mcp/extension-debug
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/extensiondev/mcp

Made for: Claude Code.

Or install extension-mcp, the plugin that ships this one along with the rest of its 4 commands, 1 MCP server.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for extension-debug

README.md
[![agentmods](https://agentmods.dev/badge/commands/extensiondev/mcp/extension-debug/github.svg)](https://agentmods.dev/commands/extensiondev/mcp/extension-debug)
Your own site
<a href="https://agentmods.dev/commands/extensiondev/mcp/extension-debug"><img src="https://agentmods.dev/badge/commands/extensiondev/mcp/extension-debug/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for extension-debug

Your own site · 80×15
<a href="https://agentmods.dev/commands/extensiondev/mcp/extension-debug"><img src="https://agentmods.dev/badge/commands/extensiondev/mcp/extension-debug.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 13 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,033 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00013 $0.01033
Opus 5.5 $0.00005 $0.00413
Sonnet 5.5 $0.00003 $0.00207
Haiku 4.5 $0.00001 $0.00103

Measured 7d ago against content hash 6674cc1d967d, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

extension-debug scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 7d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

claude/commands/extension-debug.md · 54 lines

How it starts

The opening of the file, as written. The whole thing — 54 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Debug the currently running extension dev session. The user said: $ARGUMENTS

Steps

  1. Check for a running dev session

    • If MCP tool extension_doctor is available, call it with the project path: it reports whether a session is live, leg by leg (extension_wait with a short timeout is only for a session that is still starting)
    • If no session: start one with extension_dev (it answers when the session is ready) or tell the user to run /extension dev or npm run dev
  2. Inspect the live state If MCP tool extension_inspect is available:

    • Pass include: ["html", "summary", "meta", "console", "extension_roots"]
    • If the user provided a URL in $ARGUMENTS, pass it as url
    • If the user provided CSS selectors (strings starting with #, ., or [), pass them as probe
    • Report the results in a structured way

    If MCP is not available:

    • If the session has the control channel (--allow-control on the CLI; an extension_dev session has it unless started with allowControl: false), suggest the CLI equivalent: npx extension inspect --tab <id> --include summary,html --with-console 20
    • Otherwise read dist/extension-js/<browser>/ready.json with your file tool (not a shell glob; a missing file means no session is running) to get the CDP port and suggest Chrome DevTools inspection
  3. Exercise event handlers (when the bug is in an action / command / shortcut) If the session has the control channel (--allow-control on the CLI; an extension_dev session has it unless started with allowControl: false), fire the events a user would, without clicking:

    • extension_open with surface: "action", triggers the toolbar action (opens its popup, or replays chrome.action.onClicked).
    • extension_open with surface: "command" and name: "<cmd>", replays a chrome.commands.onCommand keyboard shortcut.
    • Then re-inspect or read extension_logs to see what the handler did.

    Caveat: replay carries no user gesture, so activeTab is NOT granted. If the handler depends on activeTab (e.g. chrome.scripting.executeScript on the active tab, captureVisibleTab), the result includes gesture: false and a warning, and behavior differs from a real click. For a genuine-gesture click (activeTab granted), use chrome-devtools-mcp's trigger_extension_action (Chromium only) alongside this server.

    To see what else is loaded in the browser (Chromium): extension_list_extensions.

    Safari sessions (Extension.js 4.1.21+) have no CDP, but the bridge works once the extension is enabled in Safari: extension_logs, extension_storage, extension_reload, extension_open for surfaces, extension_dom_snapshot by tab id, and the assertions (surface-rendered reads the surface through the relay there). extension_eval in content or page needs a tab the user already opened at the url; extension_open with url and extension_eval in background are blocked by Safari's MV3 background CSP. extension_inspect has no Safari path. Apple's safari-mcp can read a page in its own window beside the dev session; neither it nor this server can open the popup or background page, which stay Web Inspector, attended.

  4. Diagnose common issues Based on what you find, check for:

    • "It didn't load": Check extension root count. If 0, content scripts may not be injecting. Check manifest content_scripts matches patterns and the target URL.
    • Console errors: Report top errors. Common ones:
      • Uncaught TypeError, likely a missing import or wrong module format
      • Content Security Policy, extension CSP blocking inline scripts
      • chrome.runtime.lastError, API permission missing
    • Wrong page: Check if the content script matches pattern in manifest covers the target URL
    • Shadow DOM empty: Extension root exists but shadow content is empty, likely a CSS or framework mounting issue
  5. Suggest fixes based on the diagnosis

Read the full file on GitHub · 54 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 7d ago Changed · -1 lines 6674cc1d967d
  2. 9d ago Changed e3f526ee40b2
  3. 13d ago Changed 1a01b840bc91
  4. 24d ago Changed · +2 lines f7accb900b1f
  5. 1mo ago First seen · 53 lines · 13 tokens per session scan A f20e5900c6b7

Subscribe to this mod's changes

extension-debug is a command published in the GitHub repository extensiondev/mcp (0 stars, last pushed today), licensed Apache-2.0. It adds 13 tokens to every session and 1,033 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.