extension-debug

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

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.

agentmods
npx agentmods add commands/extensiondev/mcp/extension-debug
Clone the repo
git clone --depth 1 https://github.com/extensiondev/mcp
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 773 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00013 $0.00773
Opus 5 $0.00006 $0.00387
Sonnet 5 $0.00003 $0.00155
Haiku 4.5 $0.00001 $0.00077

Measured yesterday against content hash f20e5900c6b7, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 yesterday.

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 · 53 lines

How it starts

The opening of the file, as written. The whole thing — 53 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

    • Look for dist/extension-js/chrome/ready.json in the project root
    • If MCP tool extension_wait is available, use it with a short timeout (3s) to check
    • If no session: tell the user to start one with /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 was started with --allow-control, suggest the CLI equivalent: npx extension inspect --tab <id> --include summary,html --with-console 20
    • Otherwise read dist/extension-js/chrome/ready.json 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 was started with --allow-control, 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.

  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 · 53 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. yesterday 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 (1 stars, last pushed 2d ago), licensed Apache-2.0. It adds 13 tokens to every session and 773 once invoked, about $0.0001 per session on Opus 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.