Unexpected high token usage: schema validation error loads massive JSON into context

Resolved 💬 4 comments Opened Feb 27, 2026 by onurdilmen Closed Mar 28, 2026

Problem

During a simple ~/.claude/settings.json edit session, a validation error caused the full JSON schema (~500+ lines) to be loaded into context, resulting in ~8% weekly token consumption for a single file edit operation.

Steps to Reproduce

  1. Edit ~/.claude/settings.json via Claude Code
  2. Make an edit that triggers schema validation (e.g. leaving an empty env object after removing a key)
  3. The full JSON schema is dumped into the error message and loaded into context

Expected Behavior

Validation error should return a short, human-readable message pointing to the specific invalid field.

Actual Behavior

The entire JSON schema (~500 lines) is included in the error response and loaded into the conversation context, consuming a disproportionate amount of tokens for a simple edit operation.

Impact

Two conversations about settings configuration consumed ~16% of the weekly token limit on a Max plan. The schema validation error alone appears to account for a significant portion of this usage.

Environment

  • Plan: Max
  • OS: macOS 25.3.0 (Darwin)
  • Claude Code CLI

View original on GitHub ↗

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