Why JSON.parse Fails on Claude API Streaming tool_use Arguments — and How to Fix It
When you stream a Claude API response with tool_use, calling JSON.parse on each input_json_delta throws SyntaxError. Here is the correct way to assemble partial_json fragments, plus disconnect handling.
Bulletproof JSON Output with Claude API Prefill: A Four-Layer Defense Pattern from Indie SaaS
How I went from late-night JSON parse failures to a 100% parse success rate across thousands of monthly Claude API requests. Working code in TypeScript and Python, plus production numbers from an indie SaaS.
Automating CI/CD Pipelines with Claude Code's --print and --output-format json
A practical guide to using Claude Code's --print flag and --output-format json in CI/CD pipelines. Covers automated code review in GitHub Actions, PR comment generation, and test failure analysis — with working code throughout.
Claude API JSON Output Fails: 5 Root Causes and Fixes
Fix Claude API JSON parsing errors with these 5 common root causes: markdown code block wrapping, truncated output, injected commentary, Unicode escaping, and streaming parse failures. Includes copy-paste ready Python utility code.