
What happened
The developer of tanacode, an unofficial macOS app, documented driving Claude Code via stream-json: sending user lines, answering can_use_tool permission requests, replying to AskUserQuestion prompts, and interrupting turns with control_request.
Why it matters
Unlike one-shot claude -p, which ends after one answer and needs --resume, stream-json keeps one process alive for many turns, making it usable for in-house chatbots, editor extensions, and CI scripts.
Summaries like this, in your inbox every morning.
Stream-json is framed as a middle path between two other ways of running Claude Code: the interactive terminal screen and the one-shot claude -p command. In one-shot mode, the process ends after a single answer, so continuing a conversation requires restarting with --resume and gives no way to answer permission checks mid-turn. Stream-json instead keeps the CLI process open until standard input is closed, so a program can send successive user lines and receive assistant, result, and control_request lines as the turn progresses.
The developer's own app, tanacode, illustrates why this matters in practice. Version 1.x ran the interactive screen in the background and read its text to build chat and permission cards, a design that broke whenever Claude Code's screen changed slightly. Version 2.0.0 rebuilt the chat on stream-json and removed the screen-reading code, so permission prompts and questions become cards built from can_use_tool requests and answers flow back as control_response lines.
Operational caveats are also flagged: programs should reply to every CLI request even if unused, interrupted messages remain in the conversation, and stream-json sessions do not show up in the claude --resume list, requiring the session_id from the init line to resume. The developer notes that stream-json line formats may change with Claude Code updates, and says tanacode runs the latest Claude Code against a mock API daily to detect new line types.
Pick your industry and the AI tools you use, and get news related to your work every day.
Free · 30 seconds with Google · unsubscribe anytimeWhat is AIToday? →
Ask AI anything about this article. The AI reads this article, earlier AIToday articles, and Wikipedia, and cites its sources. Q&As are published on this page for other readers too.
Docker published an analysis of major AI coding agent incidents from October 2024 to February 2026, including…

Using ClickCapture screenshots of Robocopy Scheduler, Gemini 2.0 Flash-Lite produced a structured parameter ta…

After two ✓-marked items turned out wrong post-publication — a nonexistent "創業枠(200万円)" and a 3-month photo ru…

A weekend solo engineer asked Claude Code to move a skill that triggers CodeRabbit reviews every 65–70 minutes…

Drawing on 11 years as a 臨床工学技士, the author proposes six fields for AI agent approval logs: when, who, what ta…

A non-engineer built an AI receptionist app for the 5th Agentic AI Hackathon with Google Cloud by vibe coding…
