claude-code - 💡(How to fix) Fix [Bug] Invalid environment config values cause runtime error instead of validation [1 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#45494Fetched 2026-04-09 08:04:06
View on GitHub
Comments
0
Participants
1
Timeline
4
Reactions
0
Participants
Timeline (top)
labeled ×3closed ×1

Error Message

wrong values in claude json config throws an error and stops the loop, nice to have would be an error message saying json schema validation failed - values need to be strings.

Code Example

[]
RAW_BUFFERClick to expand / collapse

Bug Description ❯ "env": { "CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING": 1, "MAX_THINKING_TOKENS": 150000 },

is this block correct for your environment config

⏺ H.toLowerCase is not a function. (In 'H.toLowerCase()', 'H.toLowerCase' is undefined)

wrong values in claude json config throws an error and stops the loop, nice to have would be an error message saying json schema validation failed - values need to be strings.

Environment Info

  • Platform: darwin
  • Terminal: ghostty
  • Version: 2.1.94
  • Feedback ID: 902c1239-0d47-40c6-9109-144f0d93a339

Errors

[]

extent analysis

TL;DR

The issue is likely caused by incorrect configuration values in the env block, specifically non-string values, which should be corrected to strings.

Guidance

  • Verify that all values in the env block are strings, as the error message suggests that H.toLowerCase is undefined, implying a type mismatch.
  • Check the CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING and MAX_THINKING_TOKENS values to ensure they are enclosed in quotes, making them strings.
  • Consider adding JSON schema validation to handle incorrect config values and provide informative error messages.
  • Review the code that processes the env block to ensure it handles non-string values correctly.

Example

"env": {
  "CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING": "1",
  "MAX_THINKING_TOKENS": "150000"
}

Notes

The provided error message H.toLowerCase is not a function suggests a type-related issue, but without more context, it's difficult to pinpoint the exact cause. Ensuring all config values are strings is a safe and reasonable first step.

Recommendation

Apply workaround: Correct the config values to strings, as shown in the example, to prevent the error and allow for further debugging or addition of JSON schema validation.

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