From 36d464f82fac9b0c7900171322dbb82f5023f6c1 Mon Sep 17 00:00:00 2001 From: Ed_ Date: Sun, 1 Mar 2026 14:18:57 -0500 Subject: [PATCH] fix(mma-exec): strip ANTHROPIC_API_KEY from subprocess env to use subscription login When ANTHROPIC_API_KEY is set in the shell environment, claude --print routes through the API key instead of subscription auth. Stripping it forces the CLI to use subscription login for all Tier 3/4 delegation. Co-Authored-By: Claude Sonnet 4.6 --- scripts/claude_mma_exec.py | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/claude_mma_exec.py b/scripts/claude_mma_exec.py index 18fe8cf..6528aa2 100644 --- a/scripts/claude_mma_exec.py +++ b/scripts/claude_mma_exec.py @@ -197,6 +197,7 @@ def execute_agent(role: str, prompt: str, docs: list[str]) -> str: try: env = os.environ.copy() env['CLAUDE_CLI_HOOK_CONTEXT'] = 'mma_headless' + env.pop('ANTHROPIC_API_KEY', None) # Force CLI to use subscription login, not API key process = subprocess.run( cmd, input=command_text,