[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-14bd60d9-0fd3-419e-aa35-a53d8c748ac0":3,"$fr_2gYsEEVOdk-9c5uDViw5E3bQjguCG2Hr9MAcSomy4":42},{"id":4,"title":5,"description":6,"categoryId":7,"moduleId":8,"tags":9,"prompt":10,"icon":11,"source":12,"sourceUrl":13,"authorId":14,"authorName":15,"isPublic":16,"stars":17,"runs":18,"createdAt":19,"updatedAt":19,"module":20,"category":27,"packages":33},"14bd60d9-0fd3-419e-aa35-a53d8c748ac0","claude-in-chrome-troubleshooting","诊断并修复Chrome MCP扩展中Claude的连接问题。当mcp__claude-in-chrome__*工具失败、返回“浏览器扩展未连接”或行为异常时使用。","cat_coding_backend","mod_coding","sickn33,coding","---\nname: claude-in-chrome-troubleshooting\ndescription: Diagnose and fix Claude in Chrome MCP extension connectivity issues. Use when mcp__claude-in-chrome__* tools fail, return \"Browser extension is not connected\", or behave erratically.\nrisk: critical\nsource: community\n---\n\n# Claude in Chrome MCP Troubleshooting\n\nUse this skill when Claude in Chrome MCP tools fail to connect or work unreliably.\n\n## When to Use\n- `mcp__claude-in-chrome__*` tools fail with \"Browser extension is not connected\"\n- Browser automation works erratically or times out\n- After updating Claude Code or Claude.app\n- When switching between Claude Code CLI and Claude.app (Cowork)\n- Native host process is running but MCP tools still fail\n\n## When NOT to Use\n\n- **Linux or Windows users** - This skill covers macOS-specific paths and tools (`~\u002FLibrary\u002FApplication Support\u002F`, `osascript`)\n- General Chrome automation issues unrelated to the Claude extension\n- Claude.app desktop issues (not browser-related)\n- Network connectivity problems\n- Chrome extension installation issues (use Chrome Web Store support)\n\n## The Claude.app vs Claude Code Conflict (Primary Issue)\n\n**Background:** When Claude.app added Cowork support (browser automation from the desktop app), it introduced a competing native messaging host that conflicts with Claude Code CLI.\n\n### Two Native Hosts, Two Socket Formats\n\n| Component | Native Host Binary | Socket Location |\n|-----------|-------------------|-----------------|\n| **Claude.app (Cowork)** | `\u002FApplications\u002FClaude.app\u002FContents\u002FHelpers\u002Fchrome-native-host` | `\u002Ftmp\u002Fclaude-mcp-browser-bridge-$USER\u002F\u003CPID>.sock` |\n| **Claude Code CLI** | `~\u002F.local\u002Fshare\u002Fclaude\u002Fversions\u002F\u003Cversion> --chrome-native-host` | `$TMPDIR\u002Fclaude-mcp-browser-bridge-$USER` (single file) |\n\n### Why They Conflict\n\n1. Both register native messaging configs in Chrome:\n   - `com.anthropic.claude_browser_extension.json` → Claude.app helper\n   - `com.anthropic.claude_code_browser_extension.json` → Claude Code wrapper\n\n2. Chrome extension requests a native host by name\n3. If the wrong config is active, the wrong binary runs\n4. The wrong binary creates sockets in a format\u002Flocation the MCP client doesn't expect\n5. Result: \"Browser extension is not connected\" even though everything appears to be running\n\n### The Fix: Disable Claude.app's Native Host\n\n**If you use Claude Code CLI for browser automation (not Cowork):**\n\n```bash\n# Disable the Claude.app native messaging config\nmv ~\u002FLibrary\u002FApplication\\ Support\u002FGoogle\u002FChrome\u002FNativeMessagingHosts\u002Fcom.anthropic.claude_browser_extension.json \\\n   ~\u002FLibrary\u002FApplication\\ Support\u002FGoogle\u002FChrome\u002FNativeMessagingHosts\u002Fcom.anthropic.claude_browser_extension.json.disabled\n\n# Ensure the Claude Code config exists and points to the wrapper\ncat ~\u002FLibrary\u002FApplication\\ Support\u002FGoogle\u002FChrome\u002FNativeMessagingHosts\u002Fcom.anthropic.claude_code_browser_extension.json\n```\n\n**If you use Cowork (Claude.app) for browser automation:**\n\n```bash\n# Disable the Claude Code native messaging config\nmv ~\u002FLibrary\u002FApplication\\ Support\u002FGoogle\u002FChrome\u002FNativeMessagingHosts\u002Fcom.anthropic.claude_code_browser_extension.json \\\n   ~\u002FLibrary\u002FApplication\\ Support\u002FGoogle\u002FChrome\u002FNativeMessagingHosts\u002Fcom.anthropic.claude_code_browser_extension.json.disabled\n```\n\n**You cannot use both simultaneously.** Pick one and disable the other.\n\n### Toggle Script\n\nAdd this to `~\u002F.zshrc` or run directly:\n\n```bash\nchrome-mcp-toggle() {\n    local CONFIG_DIR=~\u002FLibrary\u002FApplication\\ Support\u002FGoogle\u002FChrome\u002FNativeMessagingHosts\n    local CLAUDE_APP=\"$CONFIG_DIR\u002Fcom.anthropic.claude_browser_extension.json\"\n    local CLAUDE_CODE=\"$CONFIG_DIR\u002Fcom.anthropic.claude_code_browser_extension.json\"\n\n    if [[ -f \"$CLAUDE_APP\" && ! -f \"$CLAUDE_APP.disabled\" ]]; then\n        # Currently using Claude.app, switch to Claude Code\n        mv \"$CLAUDE_APP\" \"$CLAUDE_APP.disabled\"\n        [[ -f \"$CLAUDE_CODE.disabled\" ]] && mv \"$CLAUDE_CODE.disabled\" \"$CLAUDE_CODE\"\n        echo \"Switched to Claude Code CLI\"\n        echo \"Restart Chrome and Claude Code to apply\"\n    elif [[ -f \"$CLAUDE_CODE\" && ! -f \"$CLAUDE_CODE.disabled\" ]]; then\n        # Currently using Claude Code, switch to Claude.app\n        mv \"$CLAUDE_CODE\" \"$CLAUDE_CODE.disabled\"\n        [[ -f \"$CLAUDE_APP.disabled\" ]] && mv \"$CLAUDE_APP.disabled\" \"$CLAUDE_APP\"\n        echo \"Switched to Claude.app (Cowork)\"\n        echo \"Restart Chrome to apply\"\n    else\n        echo \"Current state unclear. Check configs:\"\n        ls -la \"$CONFIG_DIR\"\u002Fcom.anthropic*.json* 2>\u002Fdev\u002Fnull\n    fi\n}\n```\n\nUsage: `chrome-mcp-toggle` then restart Chrome (and Claude Code if switching to CLI).\n\n## Quick Diagnosis\n\n```bash\n# 1. Which native host binary is running?\nps aux | grep chrome-native-host | grep -v grep\n# Claude.app: \u002FApplications\u002FClaude.app\u002FContents\u002FHelpers\u002Fchrome-native-host\n# Claude Code: ~\u002F.local\u002Fshare\u002Fclaude\u002Fversions\u002FX.X.X --chrome-native-host\n\n# 2. Where is the socket?\n# For Claude Code (single file in TMPDIR):\nls -la \"$(getconf DARWIN_USER_TEMP_DIR)\u002Fclaude-mcp-browser-bridge-$USER\" 2>&1\n\n# For Claude.app (directory with PID files):\nls -la \u002Ftmp\u002Fclaude-mcp-browser-bridge-$USER\u002F 2>&1\n\n# 3. What's the native host connected to?\nlsof -U 2>&1 | grep claude-mcp-browser-bridge\n\n# 4. Which configs are active?\nls ~\u002FLibrary\u002FApplication\\ Support\u002FGoogle\u002FChrome\u002FNativeMessagingHosts\u002Fcom.anthropic*.json\n```\n\n## Critical Insight\n\n**MCP connects at startup.** If the browser bridge wasn't ready when Claude Code started, the connection will fail for the entire session. The fix is usually: ensure Chrome + extension are running with correct config, THEN restart Claude Code.\n\n## Full Reset Procedure (Claude Code CLI)\n\n```bash\n# 1. Ensure correct config is active\nmv ~\u002FLibrary\u002FApplication\\ Support\u002FGoogle\u002FChrome\u002FNativeMessagingHosts\u002Fcom.anthropic.claude_browser_extension.json \\\n   ~\u002FLibrary\u002FApplication\\ Support\u002FGoogle\u002FChrome\u002FNativeMessagingHosts\u002Fcom.anthropic.claude_browser_extension.json.disabled 2>\u002Fdev\u002Fnull\n\n# 2. Update the wrapper to use latest Claude Code version\ncat > ~\u002F.claude\u002Fchrome\u002Fchrome-native-host \u003C\u003C 'EOF'\n#!\u002Fbin\u002Fbash\nLATEST=$(ls -t ~\u002F.local\u002Fshare\u002Fclaude\u002Fversions\u002F 2>\u002Fdev\u002Fnull | head -1)\nexec \"$HOME\u002F.local\u002Fshare\u002Fclaude\u002Fversions\u002F$LATEST\" --chrome-native-host\nEOF\nchmod +x ~\u002F.claude\u002Fchrome\u002Fchrome-native-host\n\n# 3. Kill existing native host and clean sockets\npkill -f chrome-native-host\nrm -rf \u002Ftmp\u002Fclaude-mcp-browser-bridge-$USER\u002F\nrm -f \"$(getconf DARWIN_USER_TEMP_DIR)\u002Fclaude-mcp-browser-bridge-$USER\"\n\n# 4. Restart Chrome\nosascript -e 'quit app \"Google Chrome\"' && sleep 2 && open -a \"Google Chrome\"\n\n# 5. Wait for Chrome, click Claude extension icon\n\n# 6. Verify correct native host is running\nps aux | grep chrome-native-host | grep -v grep\n# Should show: ~\u002F.local\u002Fshare\u002Fclaude\u002Fversions\u002FX.X.X --chrome-native-host\n\n# 7. Verify socket exists\nls -la \"$(getconf DARWIN_USER_TEMP_DIR)\u002Fclaude-mcp-browser-bridge-$USER\"\n\n# 8. Restart Claude Code\n```\n\n## Other Common Causes\n\n### Multiple Chrome Profiles\n\nIf you have the Claude extension installed in multiple Chrome profiles, each spawns its own native host and socket. This can cause confusion.\n\n**Fix:** Only enable the Claude extension in ONE Chrome profile.\n\n### Multiple Claude Code Sessions\n\nRunning multiple Claude Code instances can cause socket conflicts.\n\n**Fix:** Only run one Claude Code session at a time, or use `\u002Fmcp` to reconnect after closing other sessions.\n\n### Hardcoded Version in Wrapper\n\nThe wrapper at `~\u002F.claude\u002Fchrome\u002Fchrome-native-host` may have a hardcoded version that becomes stale after updates.\n\n**Diagnosis:**\n```bash\ncat ~\u002F.claude\u002Fchrome\u002Fchrome-native-host\n# Bad: exec \"\u002FUsers\u002F...\u002F.local\u002Fshare\u002Fclaude\u002Fversions\u002F2.0.76\" --chrome-native-host\n# Good: Uses $(ls -t ...) to find latest\n```\n\n**Fix:** Use the dynamic version wrapper shown in the Full Reset Procedure above.\n\n### TMPDIR Not Set\n\nClaude Code expects `TMPDIR` to be set to find the socket.\n\n```bash\n# Check\necho $TMPDIR\n# Should show: \u002Fvar\u002Ffolders\u002FXX\u002F...\u002FT\u002F\n\n# Fix: Add to ~\u002F.zshrc\nexport TMPDIR=\"${TMPDIR:-$(getconf DARWIN_USER_TEMP_DIR)}\"\n```\n\n## Diagnostic Deep Dive\n\n```bash\necho \"=== Native Host Binary ===\"\nps aux | grep chrome-native-host | grep -v grep\n\necho -e \"\\n=== Socket (Claude Code location) ===\"\nls -la \"$(getconf DARWIN_USER_TEMP_DIR)\u002Fclaude-mcp-browser-bridge-$USER\" 2>&1\n\necho -e \"\\n=== Socket (Claude.app location) ===\"\nls -la \u002Ftmp\u002Fclaude-mcp-browser-bridge-$USER\u002F 2>&1\n\necho -e \"\\n=== Native Host Open Files ===\"\npgrep -f chrome-native-host | xargs -I {} lsof -p {} 2>\u002Fdev\u002Fnull | grep -E \"(sock|claude-mcp)\"\n\necho -e \"\\n=== Active Native Messaging Configs ===\"\nls ~\u002FLibrary\u002FApplication\\ Support\u002FGoogle\u002FChrome\u002FNativeMessagingHosts\u002Fcom.anthropic*.json 2>\u002Fdev\u002Fnull\n\necho -e \"\\n=== Custom Wrapper Contents ===\"\ncat ~\u002F.claude\u002Fchrome\u002Fchrome-native-host 2>\u002Fdev\u002Fnull || echo \"No custom wrapper\"\n\necho -e \"\\n=== TMPDIR ===\"\necho \"TMPDIR=$TMPDIR\"\necho \"Expected: $(getconf DARWIN_USER_TEMP_DIR)\"\n```\n\n## File Reference\n\n| File | Purpose |\n|------|---------|\n| `~\u002F.claude\u002Fchrome\u002Fchrome-native-host` | Custom wrapper script for Claude Code |\n| `\u002FApplications\u002FClaude.app\u002FContents\u002FHelpers\u002Fchrome-native-host` | Claude.app (Cowork) native host |\n| `~\u002F.local\u002Fshare\u002Fclaude\u002Fversions\u002F\u003Cversion>` | Claude Code binary (run with `--chrome-native-host`) |\n| `~\u002FLibrary\u002FApplication Support\u002FGoogle\u002FChrome\u002FNativeMessagingHosts\u002Fcom.anthropic.claude_browser_extension.json` | Config for Claude.app native host |\n| `~\u002FLibrary\u002FApplication Support\u002FGoogle\u002FChrome\u002FNativeMessagingHosts\u002Fcom.anthropic.claude_code_browser_extension.json` | Config for Claude Code native host |\n| `$TMPDIR\u002Fclaude-mcp-browser-bridge-$USER` | Socket file (Claude Code) |\n| `\u002Ftmp\u002Fclaude-mcp-browser-bridge-$USER\u002F\u003CPID>.sock` | Socket files (Claude.app) |\n\n## Summary\n\n1. **Primary issue:** Claude.app (Cowork) and Claude Code use different native hosts with incompatible socket formats\n2. **Fix:** Disable the native messaging config for whichever one you're NOT using\n3. **After any fix:** Must restart Chrome AND Claude Code (MCP connects at startup)\n4. **One profile:** Only have Claude extension in one Chrome profile\n5. **One session:** Only run one Claude Code instance\n\n---\n\n*Original skill by [@jeffzwang](https:\u002F\u002Fgithub.com\u002Fjeffzwang) from [@ExaAILabs](https:\u002F\u002Fgithub.com\u002FExaAILabs). Enhanced and updated for current versions of Claude Desktop and Claude Code.*\n\n## Limitations\n- Use this skill only when the task clearly matches the scope described above.\n- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.\n- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.\n","","imported","https:\u002F\u002Fgithub.com\u002Fsickn33\u002Fantigravity-awesome-skills","user_system_seed","SkillOPIC",true,210,975,"2026-05-16 13:11:01",{"id":8,"name":21,"slug":22,"icon":23,"description":24,"sort":25,"createdAt":26},"编程开发","coding","mdi-code-braces","代码生成、调试、审查，提升开发效率",2,"2026-05-16 12:53:40",{"id":7,"name":28,"slug":29,"icon":30,"description":31,"moduleId":8,"sort":25,"skillCount":32,"createdAt":26},"后端开发","backend","mdi-server","API、数据库、服务端架构",296,[34],{"id":35,"skillId":4,"version":36,"fileName":37,"fileSize":38,"filePath":39,"fileHash":40,"manifest":41,"createdAt":19},"a8b9bf16-b2ac-4c26-ae07-c8362acff706","1.0.0","claude-in-chrome-troubleshooting.zip",3481,"uploads\u002Fskills\u002F14bd60d9-0fd3-419e-aa35-a53d8c748ac0\u002Fclaude-in-chrome-troubleshooting.zip","76d2a3840bc55f4c5aab70650776ded825f7112a8a5c0718c025e9912b518983","[{\"path\":\"SKILL.md\",\"isDirectory\":false,\"size\":10631}]",{"code":43,"message":44,"data":45},200,"success",{"items":46,"stats":47,"page":50},[],{"averageRating":48,"totalRatings":48,"ratingCounts":49},0,[48,48,48,48,48],{"limit":51,"offset":48,"hasMore":52,"nextOffset":51,"ratedOnly":16},15,false]