How strawberryforme/claude_code_cli works
Claude Code is a terminal-based assistant for working with code: users submit prompts and invoke slash commands, while the query engine coordinates model interaction and session persistence. The repository also includes IDE/remote bridge capabilities, MCP and other service integrations, permission handling, and an MCP server for exploring the source tree. The graph focuses on runtime product components; some major subsystems are documented in the README but lack sampled implementation excerpts, so their unverified connections are omitted.
Main entry points: QueryEngine.ts Query engine · server.ts Explorer server · Tool.ts Tool contracts · commands.ts Command registry
Components 17
CLI interaction
- Command registry
src/commands.ts - Terminal UI
src/ink/components/App.tsx - Slash commands
src/commands
Assistant execution
- Query engine
src/QueryEngine.ts - Query pipeline
src/query.ts - Tool contracts
src/Tool.ts - Runtime state
src/bootstrap/state.ts - Session storage
src/utils/sessionStorage.ts - Portable session I/O
src/utils/sessionStoragePortable.ts - Permission handling
src/components/permissions/FilePermissionDialog/usePermissionHandler.ts
Integrations
- MCP connections
src/services/mcp/MCPConnectionManager.tsx - Plugin manager
src/services/plugins/PluginInstallationManager.ts - IDE bridge
src/bridge - Remote sessions
src/remote/RemoteSessionManager.ts
Source explorer
- MCP client
- Explorer server
mcp-server/src/server.ts
Other components
- Terminal user
Connections 11
- Terminal user → Terminal UI: uses
README.md - Command registry → Slash commands: registers
src/commands.ts - Query engine → Query pipeline: calls
src/QueryEngine.ts - Query engine → Session storage: flushes
src/QueryEngine.ts - Query engine → Tool contracts: uses
src/QueryEngine.ts - Terminal UI → Runtime state: reads
src/ink/components/App.tsx - Session storage → Portable session I/O: reads transcripts
src/utils/sessionStorage.ts - Permission handling → Tool contracts: handles tool permissions
src/components/permissions/FilePermissionDialog/usePermissionHandler.ts - MCP client → Explorer server: requests source exploration
README.md - Explorer server → Command registry: lists commands
README.md - Explorer server → Tool contracts: lists tools
README.md