claude-code - 💡(How to fix) Fix MCP plugin tools override explicit CLAUDE.md instructions [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#46994Fetched 2026-04-13 05:44:18
View on GitHub
Comments
1
Participants
2
Timeline
6
Reactions
0
Timeline (top)
labeled ×5commented ×1

When an MCP plugin tool (e.g., Playwright) pattern-matches the user's intent, the model reaches for it instead of following explicit instructions in CLAUDE.md. The tool's presence in the tool list overrides written configuration.

Error Message

The Playwright MCP plugin uses a single shared Chrome profile directory. When multiple Claude Code sessions are running, only one can hold the SingletonLock. The others get an unrecoverable error — even "Close browser" fails because the lock belongs to a different process. There's no --isolated flag exposed through the MCP interface to work around this.

Root Cause

The model appears to weight tool availability (seeing a browser-related MCP tool) over explicit user instructions in CLAUDE.md. CLAUDE.md instructions should take precedence over tool pattern-matching.

RAW_BUFFERClick to expand / collapse

Summary

When an MCP plugin tool (e.g., Playwright) pattern-matches the user's intent, the model reaches for it instead of following explicit instructions in CLAUDE.md. The tool's presence in the tool list overrides written configuration.

Reproduction

  1. Add this instruction to CLAUDE.md:

    After writing files, open them in the browser using open via Bash (e.g., open ~/Desktop/{folder}/index.html).

  2. Have the Playwright MCP plugin enabled.
  3. Ask Claude to generate HTML files and preview them.

Expected: Claude uses open via Bash, as CLAUDE.md specifies.

Actual: Claude reaches for plugin:playwright:playwright - Navigate to a URL instead. This then fails because:

  • Playwright MCP blocks file:// URLs entirely
  • If another Claude Code session has Playwright open, the shared Chrome profile lock (SingletonLock in ~/Library/Caches/ms-playwright/mcp-chrome-408e739/) causes cascading "browser already in use" errors that can't even be resolved via "Close browser"

Root cause

The model appears to weight tool availability (seeing a browser-related MCP tool) over explicit user instructions in CLAUDE.md. CLAUDE.md instructions should take precedence over tool pattern-matching.

Secondary issue: Playwright cross-session conflicts

The Playwright MCP plugin uses a single shared Chrome profile directory. When multiple Claude Code sessions are running, only one can hold the SingletonLock. The others get an unrecoverable error — even "Close browser" fails because the lock belongs to a different process. There's no --isolated flag exposed through the MCP interface to work around this.

Environment

  • Claude Code v2.1.104
  • macOS (Darwin 25.2.0)
  • Playwright plugin: claude-plugins-official/playwright/unknown

extent analysis

TL;DR

Disable the Playwright MCP plugin to ensure Claude follows explicit instructions in CLAUDE.md instead of pattern-matching the user's intent.

Guidance

  • Verify that the issue is resolved by disabling the Playwright MCP plugin and checking if Claude uses the open command via Bash as specified in CLAUDE.md.
  • To mitigate the secondary issue of Playwright cross-session conflicts, consider running Claude Code sessions in isolated environments or exploring alternative browser plugins that do not use a shared profile directory.
  • Check the CLAUDE.md instructions for any inconsistencies or ambiguities that may be contributing to the model's behavior.
  • Investigate the possibility of updating the Playwright MCP plugin to a version that exposes an --isolated flag or provides a similar workaround for cross-session conflicts.

Example

No code snippet is provided as the issue is related to plugin configuration and model behavior rather than code syntax.

Notes

The provided solution assumes that disabling the Playwright MCP plugin is a viable workaround. However, this may not be a suitable long-term solution, and further investigation into the model's behavior and plugin configuration may be necessary.

Recommendation

Apply workaround: Disable the Playwright MCP plugin to ensure Claude follows explicit instructions in CLAUDE.md. This is a temporary solution to mitigate the issue until a more permanent fix can be implemented.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING