[Bug] Opus no longer performs validation checks

Status Closed — not planned
Maintainer reply None cached
Activity 9 comments · opened Sep 9, 2025 · closed Feb 5, 2026

I asked claude to install qwen code for me. In the first attempt, it got the binary name wrong qwen-code --version instead of qwen --version. I wanted to reproduce and submit a report but the second time it used qwen correctly - still, it made _no_ effort to first check if that indeed was the correct binary name. The _original_ Opus used to do such simple things: make some effort to first check / confirm before attempting it. Now it no longer does.

This exercise was simply to re-assert what I'm seeing in every single prompt (and have thus stopped using Claude Code entirely).

For comparison codex did the correct thing; first it did only what I asked it to do (i.e. install qwen code), then _asked_ me if I should also add a check to show its version to the installation script. When I said go ahead, it first _checked_ what the binary name is and only _then_ went ahead to update the script. It didn't just guess as Claude Code did both times.

Environment Info

  • Platform: darwin
  • Terminal: iTerm.app
  • Version: 1.0.109
  • Feedback ID: 8e1c8890-7dd5-44b1-9dde-27edad6ff5d1

View original on GitHub ↗

9 Comments

github-actions[bot] · 1 year ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/6894
  2. https://github.com/anthropics/claude-code/issues/6401
  3. https://github.com/anthropics/claude-code/issues/5541

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

Thelastpoet · 1 year ago

Oh the lying is another big thing and always saying, "You are absolutely right!. It starts well but the moment you correct it, it goess off completely.

JuanCS-Dev · 10 months ago

Feature Analysis: MCP Enable/Disable CLI Commands

Excellent, detailed feature request with clear use cases. This would significantly improve context management.

I Already Proposed This in My Plugin PR!

See: https://github.com/anthropics/claude-code/pull/12356

The quick-wins plugin includes a pattern for hook-based MCP management, but native CLI support is better.

Proposed Implementation

Add two new commands:

claude mcp enable <server-name>
claude mcp disable <server-name>
claude mcp status [server-name]

Implementation:

// src/cli/commands/mcp.ts

interface MCPCommand {
  action: 'enable' | 'disable' | 'status';
  serverName?: string;
}

async function handleMCPCommand(cmd: MCPCommand) {
  const session = getCurrentSession();
  
  switch (cmd.action) {
    case 'enable':
      await session.mcp.enable(cmd.serverName);
      console.log(`✓ Enabled ${cmd.serverName}`);
      console.log(`Context freed: ${calculateContextSaved(cmd.serverName)}K tokens`);
      break;
      
    case 'disable':
      await session.mcp.disable(cmd.serverName);
      console.log(`✓ Disabled ${cmd.serverName}`);
      break;
      
    case 'status':
      const servers = await session.mcp.list();
      servers.forEach(s => {
        console.log(`${s.enabled ? '●' : '○'} ${s.name} (${s.tokenUsage}K tokens)`);
      });
      break;
  }
}

Session-level state management:

// src/mcp/SessionMCPManager.ts

class SessionMCPManager {
  private enabledServers: Set<string>;
  
  async enable(serverName: string) {
    // Load server config
    const config = this.loadServerConfig(serverName);
    
    // Initialize MCP client
    const client = new MCPClient(config);
    await client.connect();
    
    // Register tools in session
    this.session.registerTools(await client.listTools());
    
    this.enabledServers.add(serverName);
  }
  
  async disable(serverName: string) {
    // Unregister tools
    const client = this.clients.get(serverName);
    const tools = await client.listTools();
    this.session.unregisterTools(tools);
    
    // Disconnect
    await client.disconnect();
    
    this.enabledServers.delete(serverName);
  }
}

Hook Integration

PreToolUse hook:

# .claude/hooks/pre-tool-use.sh
#!/bin/bash

TOOL_NAME=$1

# Enable Playwright only when browser tools are used
if [[ "$TOOL_NAME" == "browser_navigate" || "$TOOL_NAME" == "browser_click" ]]; then
  claude mcp enable playwright
fi

SubagentStop hook:

# .claude/hooks/subagent-stop.sh
#!/bin/bash

SUBAGENT_NAME=$1

if [[ "$SUBAGENT_NAME" == "accessibility-compliance-expert" ]]; then
  claude mcp disable playwright
  echo "♻️ Freed context: disabled Playwright MCP"
fi

Configuration File

// .claude/mcp.json
{
  "mcpServers": {
    "playwright": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-playwright"],
      "autoEnable": false,  // Don't enable at session start
      "enabledBy": ["hook:pre-tool-use"]  // Enable via hook
    }
  }
}

Context Optimization Logic

Auto-disable idle servers:

class IdleServerMonitor {
  private lastUsed: Map<string, Date>;
  
  startMonitoring() {
    setInterval(() => {
      const now = new Date();
      
      for (const [server, lastUse] of this.lastUsed) {
        const idleMinutes = (now.getTime() - lastUse.getTime()) / 60000;
        
        if (idleMinutes > 30) {  // 30 min idle
          this.session.mcp.disable(server);
          console.log(`♻️ Auto-disabled ${server} (idle 30min)`);
        }
      }
    }, 60000);  // Check every minute
  }
}

UI Integration

Status in prompt:

> /config

MCP Servers:
  ● pieces-mcp (5.2K tokens)
  ○ playwright (15.3K tokens) [DISABLED]
  ● sequential-thinking (2.1K tokens)

Total context used: 7.3K / 200K (3.7%)

Security Considerations

Respect managed-mcp.json:

async function enable(serverName: string) {
  const managed = await loadManagedConfig();
  
  if (managed.blockedServers.includes(serverName)) {
    throw new Error(`Server ${serverName} is blocked by enterprise policy`);
  }
  
  // Continue with enable...
}

Alternative: /mcp Slash Command

For interactive use:

> /mcp enable playwright
✓ Enabled playwright (context +15K tokens)

> /mcp disable playwright  
✓ Disabled playwright (context -15K tokens)

> /mcp status
● pieces-mcp (5.2K)
○ playwright (15.3K) [DISABLED]

Implementation Estimate

Week 1: CLI commands + session-level enable/disable
Week 2: Hook integration + context monitoring
Week 3: Auto-idle detection + UI polish

---

Verdict: HIGH value feature, enables powerful automation workflows.
Recommend: Prioritize for next release (v2.1.0).

For now, see my workaround in https://github.com/anthropics/claude-code/pull/12356

github-actions[bot] · 9 months ago

This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.

guidedways · 9 months ago

Still occurring

github-actions[bot] · 8 months ago

This issue has been automatically closed due to 60 days of inactivity. If you're still experiencing this issue, please open a new issue with updated information.

marcindulak · 8 months ago

This issue was closed incorrectly despite recent human comments. This behavior of the bot is reported at https://github.com/anthropics/claude-code/issues/16497. Please upvote that issue, so maybe it gets noticed.

guidedways · 8 months ago

More reasons to switch to Codex.

github-actions[bot] · 8 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.