claude code sonnet 4.6
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 modified files I didn't ask it to modify
What You Asked Claude to Do
I asked Claude Code to fix a JSON truncation error. Without my knowledge or consent, it increased the max_tokens parameter across all API agents, which directly affects my API costs.
What Claude Actually Did
Claude Code changed API cost settings without user consent
Body:
During a development session, Claude Code increased the max_tokens parameter across multiple API agents (from 2048 to 4096) without asking for my permission. This directly affects my API costs with Anthropic.
Any change that has financial implications should require explicit user approval before being applied. This did not happen.
my commit:
https://github.com/Shir2001-dot/NeoCortex/commit/6b685c7
Additional context:
The changes were made automatically as part of a "fix" for JSON truncation errors, without explaining that increasing max_tokens has a direct cost impact. The user was not informed before the change was committed and pushed to production.
Please add a safeguard that requires user confirmation before making changes that affect API usage costs.
Expected Behavior
Expected behavior
Claude Code should warn the user and ask for explicit approval before making any changes that affect:
- API token limits (max_tokens)
- Model selection (e.g. switching to more expensive models like Opus)
- API call frequency
- Any other setting with financial implications
Files Affected
@@ -58,7 +58,7 @@ def extract_patient_data(patient_id: str, raw_text: str, source: str) -> Patient try: response = client.messages.create( model=MODEL, max_tokens=2048, max_tokens=4096, system=SYSTEM_PROMPT, messages=[{"role": "user", "content": raw_text[:12000]}], )
Collapse fileapp/agents/interactions_agent.pyCopy file name to clipboardExpand all lines: app/agents/interactions_agent.py+1-1Lines changed: 1 addition & 1 deletionOriginal file line numberDiff line numberDiff line change@@ -55,7 +55,7 @@ def check_interactions(patient_id: str, medications: list[str]) -> InteractionsR response = client.messages.create( model=MODEL, max_tokens=2048, max_tokens=4096, system=SYSTEM_PROMPT, messages=[{"role": "user", "content": user_content}], )
Collapse fileapp/agents/summary_agent.pyCopy file name to clipboardExpand all lines: app/agents/summary_agent.py+1-1Lines changed: 1 addition & 1 deletionOriginal file line numberDiff line numberDiff line change@@ -30,7 +30,7 @@ def generate_session_summary(patient_name: str, notes: str, previous_summary: st response = client.messages.create( model=MODEL, max_tokens=1024, max_tokens=2048, system=SYSTEM_PROMPT, messages=[{"role": "user", "content": context}], )
Permission Mode
Accept Edits was ON (auto-accepting changes)
Can You Reproduce This?
Yes, every time with the same prompt
Steps to Reproduce
_No response_
Claude Model
Sonnet
Relevant Conversation
Impact
Critical - Data loss or corrupted project
Claude Code Version
4.6
Platform
Anthropic API
Additional Context
_No response_