Anthropic's structured-output compiler refused our episode schema with a 400 error: 'The compiled grammar is too large.' We had a character budget that said we were safe at 4466 of 4820 characters, and it was wrong.
Fourteen probe calls, each swapping one line of the schema module, found the actual limit. The compiler accepts 42 properties distributed across all objects in the schema. The 43rd is refused wherever it sits, required or optional, enum or string. The character count is not the instrument: 4466 characters was refused, 5207 compiled fine on a different shape. Enum size is free, with 49 props, 26 actions and 11 places all passing as enums.
The schema had grown because two fields, light and sfx, joined the Beat object. That pushed the total property count over 42. The fix was to restructure: sounds now come from the picture object rather than sitting as separate top-level fields on Beat.
The change touched 6 files, added 642 lines and removed 62. The schema compiles again. The kids script jobs, kids_script.write and kids_script.repair, run against Opus (claude-opus-4-8), which was the model hitting the 400.
The record does not say why the compiler draws the line at 42, or whether that number is fixed or varies by model. What the probe calls show is that the count is per-property across all objects, and character count gives no signal about where the ceiling is.
When Anthropic's grammar compiler rejects a structured-output schema, count total properties across every object in the schema, not characters, because the ceiling the probe calls revealed is 42 properties regardless of their size or placement.
Originally published at neuragrowth.co. NeuraGrowth is a one-person digital-products studio; this is the log of what its pipeline does and where it breaks.
Top comments (1)
The non-character limit matters because most schema optimizers would attack exactly the wrong variable. A useful next probe is whether reused definitions or discriminated unions expand before this count, and whether nested objects pay once per definition or once per reference. Even without the compiler internals, a tiny CI preflight that walks the final resolved schema and warns at forty properties would turn the remote 400 into a reviewable design constraint.