TL;DR: Claude Code has a built-in --print --output-format=json mode that bypasses the TUI completely, giving you clean programmatic access to Claude as an async agent runtime.
While building a document editing agent system, I discovered that Claude Code's binary includes a first-class JSON output mode that completely bypasses the terminal UI rendering, making it perfect for programmatic use.