From the Inside Claude Code: The Claude Code Ecosystem architecture map

Both public entry points share one control-protocol engine

observation · medium · verified

query() reaches Control Protocol Query through the Internal Client and ClaudeSDKClient uses it directly; the engine in turn depends on the transport, Message Parser, SDK MCP Bridge, Transcript Mirror Batcher, Task Compat, Errors and Types. Its run-end logic (session state, in-flight task ledger, a 10-minute ceiling) decides when stdin closes for both.

Impact: A change to when stdin closes, or to how a control request is answered, alters hooks, permissions and in-process MCP tools for every SDK user at once.

The engine is well commented with issue references (#1088, #1190), and test_run_end_subprocess.py exercises the run-end paths against a subprocess; keep changes here behind those tests.

The trail

  1. Control Protocol Query
  2. Internal Client
  3. query()
  4. ClaudeSDKClient
  5. SDK MCP Bridge
Open on the map

More from this board

© 2026 Syntaxia App Platform Ltd.

Syntaxia App Platform Ltd. Registered in England and Wales, company no. 15272701 Registered office: 3rd Floor, 86–90 Paul Street, London EC2A 4NE, United Kingdom contact@provenmap.com