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

The transport is the only translator from options to Claude Code CLI flags

risk · medium · verified

Subprocess CLI Transport is used by query(), the Internal Client, ClaudeSDKClient, Package Exports and Control Protocol Query, and is the sole path to the Claude Code CLI. _build_command reads 39 distinct ClaudeAgentOptions fields from Types and maps each to a CLI flag, yet the transport-to-Types dependency is not drawn. The CLI version check only logs a warning below 2.0.0.

Impact: Every new option or renamed CLI flag lands in one 1,228-line file, and a bundled or user-installed CLI that rejects a flag fails only at spawn time, in every entry point at once.

Recommendation (medium effort): Extract command building into a pure options-to-argv function with table-driven contract tests per CLI version, and move flag-only settings into the initialize request where the CLI can report unknown fields.

The trail

  1. Subprocess CLI Transport
  2. Types
  3. Claude Agent SDK (Python package)
  4. Claude Code CLI
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