[MODEL] Opus model doesn't request blocked file content from user before pursuing code-level investigation

Resolved 💬 3 comments Opened Apr 5, 2026 by adrianocaldeira Closed Apr 9, 2026

Preflight Checklist

  • [x] I have searched existing issues for similar behavior reports
  • [x] This report does NOT contain sensitive information (API keys, passwords, etc.)

Type of Behavior Issue

Claude made incorrect assumptions about my project

What You Asked Claude to Do

Debug why Serilog logs appeared in CloudWatch for staging (HML) but not production (PRD) in an AWS ECS Fargate deployment (.NET 10 Worker Service with embedded Kestrel API).

What Claude Actually Did

  1. Attempted to Read appsettings.Production.json, got permission denied by .claude/settings.json deny rule
  2. Instead of asking the user to paste the file content, silently moved on
  3. Spent ~2 hours making 8 production deployments testing code-level hypotheses:
  • ClearProviders() → broke all logs
  • SetMinimumLevel(Warning) → broke all logs
  • CreateSlimBuilder() + AddSerilog() → broke all logs
  • Host.UseSerilog() → broke all logs
  • CreateEmptyBuilder() → broke all logs
  • AddFilter() → no effect
  • Diagnostic Console.WriteLine → confirmed stdout works
  • Task definition recreation (removed ASPNETCORE_HTTP_PORTS, changed capacity provider)
  1. None of these addressed the root cause
  2. User found the issue themselves: appsettings.Production.json had Serilog MinimumLevel "Warning" (vs "Information" in staging)

Expected Behavior

  1. When Read(appsettings.Production.json) was denied, Claude should have asked: "I can't read this file due to permissions. Can you paste its content? Since behavior differs between HML and PRD, the environment-specific config is likely relevant."
  2. Compare appsettings.Production.json vs appsettings.Staging.json side by side
  3. Spot "Default": "Warning" vs "Default": "Information" — fix in 1 minute
  4. Never make repeated production deployments to test hypotheses that could be verified by reading config

Files Affected

Modified (unnecessarily, all reverted later):
- main/owner/Jobs/Configurations/JobsApiConfiguration.cs (8 times)

Should have been read but was permission-denied:
- main/owner/Jobs/appsettings.Production.json (the actual root cause)

The actual fix was one line:
- main/owner/Jobs/appsettings.Production.json: Serilog.MinimumLevel.Default "Warning" → "Information"

Permission Mode

Accept Edits was ON (auto-accepting changes)

Can You Reproduce This?

Yes, every time with the same prompt

Steps to Reproduce

  1. Have a .NET project with appsettings.json + appsettings.Staging.json + appsettings.Production.json
  2. Add a deny rule in .claude/settings.json: "Read(**/appsettings.Production.json)"
  3. Configure different Serilog MinimumLevel between Staging (Information) and Production (Warning)
  4. Ask Claude to debug why logs appear in staging but not production
  5. Claude will attempt code-level fixes instead of asking for the blocked file content

Claude Model

Opus

Relevant Conversation

Claude attempted Read(appsettings.Production.json) and got:
"File is in a directory that is denied by your permission settings."

Instead of asking the user for the content, Claude said:
"Vou investigar a causa raiz — como o Serilog está configurado no host."

Then proceeded to modify JobsApiConfiguration.cs 8 times with various approaches (ClearProviders, CreateSlimBuilder, CreateEmptyBuilder, UseSerilog, AddFilter), deploying each to production.

After ~2 hours, the user manually compared the appsettings files and found the one-line difference.

Impact

High - Significant unwanted changes

Claude Code Version

2.1.92

Platform

Anthropic API

Additional Context

Key failure pattern: When a permission-denied file could explain an environment-specific behavior difference, Claude should treat it as critical information and ask the user to provide it — not silently proceed with increasingly complex code-level hypotheses.

This is especially important because:

  • The model was running at "max" effort level
  • The model was Opus (most capable)
  • The user explicitly asked Claude to investigate staging vs production differences
  • Environment-specific config files are the #1 cause of "works in staging, not in production"

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗