Multiple bugs: thinking block ordering, settings schema validation, agent frontmatter
Bug Report — Multiple Issues
Environment
- Model: Claude Opus 4.5 (
claude-opus-4-5-20251101) - Platform: macOS (Darwin 25.3.0)
- Date: 2025-01-25
---
Bug 1: Thinking Block Ordering Error
Error:
{
"type": "invalid_request_error",
"message": "messages.29.content.0: If an assistant message contains any thinking blocks, the first block must be thinking or redacted_thinking. Found text."
}
Request ID: req_011CXTCAWtq7XQ1St7ovhfN8
Description: During a normal CLI session, the API returns this error. An assistant message is being constructed where a text block precedes a thinking block. The user has no control over message payload ordering — this appears to be an internal issue in how Claude Code constructs API requests.
Impact: Session becomes unusable. Only workaround is starting a new conversation.
---
Bug 2: Settings Schema Validation Rejects Valid Files
Error:
Settings Error
.claude/settings.json
└ $schema: Invalid value. Expected one of: "https://json.schemastore.org/claude-code-settings.json"
Files with errors are skipped entirely, not just the invalid settings.
Description: Claude Code's settings validator only accepts $schema: "https://json.schemastore.org/claude-code-settings.json". However, if settings.json was generated with a different but valid JSON schema URI (e.g., http://json-schema.org/draft-07/schema#), the entire file is skipped instead of just ignoring the $schema field.
Expected behavior:
- The
$schemafield should either be optional/ignored, or - Claude Code should not skip the entire settings file over a metadata field
- If Claude Code itself generates settings files, it should use the correct schema value
---
Bug 3: Agent Files Created Without Required Frontmatter
Error:
Agent Parse Errors
└ Failed to parse agent file(s):
└ example-agent.md: Missing required "name" field in frontmatter
Description: Multiple agent .md files fail to parse because they lack the required YAML frontmatter with a name field. If these files were generated or scaffolded by Claude Code (or by Claude in a session), the tool should include the required frontmatter automatically.
Expected format:
---
name: Agent Name
---
# Agent content here...
Current behavior: Agent files are created without frontmatter, then Claude Code rejects them on startup.
---
Summary
| Bug | Severity | Workaround |
|-----|----------|------------|
| Thinking block ordering | High | Start new conversation |
| Settings schema validation | Medium | Manually fix $schema value |
| Agent frontmatter missing | Low | Manually add name frontmatter |
All three issues point to Claude Code generating content that it later rejects during validation.
12 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
I'm getting the same very consistently now, it just started in the last 10 minutes or so.
I asked Claude about it, and it said
opps same error
API Error: 400 {"type":"error","error":{"type":"invalid_request_error","me
ssage":"messages.5.content.0: If an assistant message contains any
thinking blocks, the first block must be
thinkingorredacted_thinking. Foundtext."},"request_id":"req_011CXTDJgmF3vTsxLLEUWeVP"}Same error as well.
I have to manually turn thinking off to do anything.
same issue.
Same here, I disabled thinking so I could continue
Additional Finding: EPERM on project-level .claude directories
When working from a different directory than the project root, Claude Code cannot read or write files inside a project's
.claude/directory due toEPERM: operation not permittederrors.Reproduction:
~/~/Documents/GitHub/project/.claude/agents/*.mdand~/Documents/GitHub/project/.claude/settings.jsonEPERMThis means:
.claude/agents/cannot be fixed from outside the project directory.claude/settings.jsoncannot be fixed from outside the project directoryExpected behavior: If Claude Code scans and reports errors from project-level
.claude/directories, it should also have permission to read/fix those files, or at minimum not report errors for files it cannot access.Environment Details
| Component | Version |
|-----------|---------|
| Claude Code CLI | 2.1.19 |
| VS Code | 2.3.10 (arm64) |
| Model | Claude Opus 4.5 (
claude-opus-4-5-20251101) || Node.js | v24.7.0 |
| macOS | 26.3 (Build 25D5101c) |
| Architecture | Apple Silicon (arm64) |
Still happening - February 3, 2026
Platform: Claude Code CLI, Windows
Exact error:
This occurred mid-session during normal task work. Kills the session — cannot recover without restarting.
Still happening constantly - February 5, 2026
Platform: Claude Code CLI v2.1.32, Windows, Opus 4.6
Getting this error repeatedly mid-conversation during normal work:
Happened twice in a row on consecutive messages in the same conversation. The conversation is mid-flow, working on code analysis. Each error kills the request and requires re-sending.
This is happening constantly now with the new v2.1.32 / Opus 4.6 release. Something in the new version is modifying thinking blocks it shouldn't.
+1 on Bug 2 ($schema validation). The
$schemafield is enforced as aconstin the schema itself, which means even a 301 redirect from the canonical URL (e.g.,json.schemastore.org→www.schemastore.org) can't be followed by updating the value — the validator rejects it. A metadata hint for editor autocompletion shouldn't gate whether the entire settings file loads.Adding an upstream signal for Bug 2: VS Code is actively migrating away from the
json.schemastore.orgsubdomain — see microsoft/vscode#254689, which tracks the deprecation. Once the subdomain is fully retired, IDE-side$schemaresolution for.claude/settings*.jsonwill fail to load, and Claude Code'sconst-enforced validator blocks the obvious fix (updating the value to a non-deprecated URL).Confirmed locally on Claude Code 2.1.121 — switching
$schematohttps://www.schemastore.org/claude-code-settings.jsonis rejected withInvalid value. Expected one of: "https://json.schemastore.org/claude-code-settings.json". The current workaround is to omit$schemaentirely from settings files.