# jeayeong-hong/claude-code architecture

> Architecture diagram of the GitHub repository jeayeong-hong/claude-code, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/jeayeong-hong/claude-code
- Repository: https://github.com/jeayeong-hong/claude-code

## Overview

Claude Code is a terminal-based software engineering assistant. The user interacts through the CLI and Ink interface; prompts enter the query engine, which communicates with Claude and coordinates tool execution, then presents results in the terminal. The graph also preserves documented command, integration, session, and configuration capabilities. Relationships are limited to explicit README descriptions or source-index references; several feature implementations were not sampled, so their connections are omitted where evidence is unavailable.

Main entry points: [`src/QueryEngine.ts`](https://github.com/jeayeong-hong/claude-code/blob/main/src/QueryEngine.ts) (Query Engine), [`src/commands.ts`](https://github.com/jeayeong-hong/claude-code/blob/main/src/commands.ts) (Slash Commands), [`src/ink.ts`](https://github.com/jeayeong-hong/claude-code/blob/main/src/ink.ts) (Ink Terminal UI), [`src/utils/config.ts`](https://github.com/jeayeong-hong/claude-code/blob/main/src/utils/config.ts) (Configuration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interaction["CLI Interaction"]
  node_commands["Slash Commands<br/>[commands.ts]"]
  node_terminal["Ink Terminal UI<br/>[ink.ts]"]
end

subgraph group_agent["Agent Runtime"]
  node_query["Query Engine<br/>[QueryEngine.ts]"]
  node_tool_contracts["Tool Contracts<br/>[Tool.ts]"]
  node_messages["Conversation Messages<br/>[messages.ts]"]
end

subgraph group_capabilities["Engineering Capabilities"]
  node_filesystem_tools["File Operations"]
  node_shell_tools["Shell and Git"]
  node_search_tools["Code Search"]
  node_agent_tools["Agents and Tasks"]
  node_memory["Persistent Memory"]
end

subgraph group_integrations["Integrations"]
  node_api["Anthropic API"]
  node_mcp["MCP Servers"]
  node_lsp["Language Servers"]
  node_bridge["IDE Bridge<br/>[bridgeMain.ts]"]
  node_remote["Remote Sessions"]
  node_plugin_manager["Plugin Management"]
end

subgraph group_state["State and Configuration"]
  node_bootstrap["Runtime State<br/>[state.ts]"]
  node_config["Configuration<br/>[config.ts]"]
  node_session_storage[("Session Storage<br/>[sessionStorage.ts]")]
  node_tool_results[("Tool Result Storage")]
  node_growthbook["Feature Flags<br/>[growthbook.ts]"]
  node_debug["Debug Logging<br/>[debug.ts]"]
  node_logging["Application Logging<br/>[log.ts]"]
  node_environment["Environment Utilities<br/>[envUtils.ts]"]
  node_file_history[("File History<br/>[fileHistory.ts]")]
  node_filesystem_ops["Filesystem Utilities<br/>[fsOperations.ts]"]
  node_json_utils["JSON Utilities<br/>[json.ts]"]
  node_slow_ops["Slow Operation Tracking<br/>[slowOperations.ts]"]
end

node_user(("Engineer"))

node_user -->|"enters prompts"| node_terminal
node_user -->|"invokes commands"| node_commands
node_terminal -.->|"submits requests"| node_query
node_query -->|"calls API"| node_api
node_query -->|"uses tool definitions"| node_tool_contracts
node_query -->|"processes messages"| node_messages
node_query -.->|"dispatches tools"| node_filesystem_tools
node_query -.->|"dispatches tools"| node_shell_tools
node_query -.->|"dispatches tools"| node_search_tools
node_query -.->|"dispatches tools"| node_agent_tools
node_query -->|"uses memory"| node_memory
node_commands -->|"manages sessions"| node_session_storage
node_commands -->|"manages servers"| node_mcp
node_commands -->|"manages plugins"| node_plugin_manager
node_commands -.->|"configures LSP"| node_lsp
node_commands -->|"supports handoff"| node_remote
node_bridge -->|"communicates with"| node_terminal
node_remote -.->|"uses remote services"| node_api
node_bootstrap -->|"provides session state"| node_session_storage
node_config -->|"reads runtime state"| node_bootstrap
node_query -->|"stores tool results"| node_tool_results
node_environment -.->|"selects config paths"| node_config
node_debug -->|"writes debug logs"| node_filesystem_ops
node_slow_ops -->|"logs slow operations"| node_debug
node_logging -->|"formats log titles"| node_messages
node_growthbook -.->|"gates features"| node_commands
node_file_history -.->|"tracks file changes"| node_filesystem_ops
node_json_utils -.->|"handles config data"| node_config

click node_commands "https://github.com/jeayeong-hong/claude-code/blob/main/src/commands.ts"
click node_terminal "https://github.com/jeayeong-hong/claude-code/blob/main/src/ink.ts"
click node_query "https://github.com/jeayeong-hong/claude-code/blob/main/src/QueryEngine.ts"
click node_tool_contracts "https://github.com/jeayeong-hong/claude-code/blob/main/src/Tool.ts"
click node_messages "https://github.com/jeayeong-hong/claude-code/blob/main/src/utils/messages.ts"
click node_bootstrap "https://github.com/jeayeong-hong/claude-code/blob/main/src/bootstrap/state.ts"
click node_config "https://github.com/jeayeong-hong/claude-code/blob/main/src/utils/config.ts"
click node_session_storage "https://github.com/jeayeong-hong/claude-code/blob/main/src/utils/sessionStorage.ts"
click node_tool_results "https://github.com/jeayeong-hong/claude-code/blob/main/src/utils/toolResultStorage.ts"
click node_filesystem_tools "https://github.com/jeayeong-hong/claude-code/tree/main/src/tools"
click node_shell_tools "https://github.com/jeayeong-hong/claude-code/tree/main/src/tools"
click node_search_tools "https://github.com/jeayeong-hong/claude-code/tree/main/src/tools"
click node_agent_tools "https://github.com/jeayeong-hong/claude-code/tree/main/src/tools"
click node_memory "https://github.com/jeayeong-hong/claude-code/tree/main/src/memdir"
click node_api "https://github.com/jeayeong-hong/claude-code/tree/main/src/services/api"
click node_mcp "https://github.com/jeayeong-hong/claude-code/blob/main/src/services/mcp/MCPConnectionManager.tsx"
click node_lsp "https://github.com/jeayeong-hong/claude-code/blob/main/src/services/lsp/LSPServerManager.ts"
click node_bridge "https://github.com/jeayeong-hong/claude-code/blob/main/src/bridge/bridgeMain.ts"
click node_remote "https://github.com/jeayeong-hong/claude-code/blob/main/src/remote/RemoteSessionManager.ts"
click node_plugin_manager "https://github.com/jeayeong-hong/claude-code/blob/main/src/services/plugins/PluginInstallationManager.ts"
click node_growthbook "https://github.com/jeayeong-hong/claude-code/blob/main/src/services/analytics/growthbook.ts"
click node_debug "https://github.com/jeayeong-hong/claude-code/blob/main/src/utils/debug.ts"
click node_logging "https://github.com/jeayeong-hong/claude-code/blob/main/src/utils/log.ts"
click node_environment "https://github.com/jeayeong-hong/claude-code/blob/main/src/utils/envUtils.ts"
click node_file_history "https://github.com/jeayeong-hong/claude-code/blob/main/src/utils/fileHistory.ts"
click node_filesystem_ops "https://github.com/jeayeong-hong/claude-code/blob/main/src/utils/fsOperations.ts"
click node_json_utils "https://github.com/jeayeong-hong/claude-code/blob/main/src/utils/json.ts"
click node_slow_ops "https://github.com/jeayeong-hong/claude-code/blob/main/src/utils/slowOperations.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_commands,node_terminal toneBlue
class node_query,node_tool_contracts,node_messages toneAmber
class node_filesystem_tools,node_shell_tools,node_search_tools,node_agent_tools,node_memory toneMint
class node_api,node_mcp,node_lsp,node_bridge,node_remote,node_plugin_manager toneRose
class node_bootstrap,node_config,node_session_storage,node_tool_results,node_growthbook,node_debug,node_logging,node_environment,node_file_history,node_filesystem_ops,node_json_utils,node_slow_ops,node_user toneIndigo
```

## Components

### CLI Interaction

- [Slash Commands](https://github.com/jeayeong-hong/claude-code/blob/main/src/commands.ts): `src/commands.ts`
- [Ink Terminal UI](https://github.com/jeayeong-hong/claude-code/blob/main/src/ink.ts): `src/ink.ts`

### Agent Runtime

- [Query Engine](https://github.com/jeayeong-hong/claude-code/blob/main/src/QueryEngine.ts): `src/QueryEngine.ts`
- [Tool Contracts](https://github.com/jeayeong-hong/claude-code/blob/main/src/Tool.ts): `src/Tool.ts`
- [Conversation Messages](https://github.com/jeayeong-hong/claude-code/blob/main/src/utils/messages.ts): `src/utils/messages.ts`

### Engineering Capabilities

- [File Operations](https://github.com/jeayeong-hong/claude-code/tree/main/src/tools): `src/tools`
- [Shell and Git](https://github.com/jeayeong-hong/claude-code/tree/main/src/tools): `src/tools`
- [Code Search](https://github.com/jeayeong-hong/claude-code/tree/main/src/tools): `src/tools`
- [Agents and Tasks](https://github.com/jeayeong-hong/claude-code/tree/main/src/tools): `src/tools`
- [Persistent Memory](https://github.com/jeayeong-hong/claude-code/tree/main/src/memdir): `src/memdir`

### Integrations

- [Anthropic API](https://github.com/jeayeong-hong/claude-code/tree/main/src/services/api): `src/services/api`
- [MCP Servers](https://github.com/jeayeong-hong/claude-code/blob/main/src/services/mcp/MCPConnectionManager.tsx): `src/services/mcp/MCPConnectionManager.tsx`
- [Language Servers](https://github.com/jeayeong-hong/claude-code/blob/main/src/services/lsp/LSPServerManager.ts): `src/services/lsp/LSPServerManager.ts`
- [IDE Bridge](https://github.com/jeayeong-hong/claude-code/blob/main/src/bridge/bridgeMain.ts): `src/bridge/bridgeMain.ts`
- [Remote Sessions](https://github.com/jeayeong-hong/claude-code/blob/main/src/remote/RemoteSessionManager.ts): `src/remote/RemoteSessionManager.ts`
- [Plugin Management](https://github.com/jeayeong-hong/claude-code/blob/main/src/services/plugins/PluginInstallationManager.ts): `src/services/plugins/PluginInstallationManager.ts`

### State and Configuration

- [Runtime State](https://github.com/jeayeong-hong/claude-code/blob/main/src/bootstrap/state.ts): `src/bootstrap/state.ts`
- [Configuration](https://github.com/jeayeong-hong/claude-code/blob/main/src/utils/config.ts): `src/utils/config.ts`
- [Session Storage](https://github.com/jeayeong-hong/claude-code/blob/main/src/utils/sessionStorage.ts): `src/utils/sessionStorage.ts`
- [Tool Result Storage](https://github.com/jeayeong-hong/claude-code/blob/main/src/utils/toolResultStorage.ts): `src/utils/toolResultStorage.ts`
- [Feature Flags](https://github.com/jeayeong-hong/claude-code/blob/main/src/services/analytics/growthbook.ts): `src/services/analytics/growthbook.ts`
- [Debug Logging](https://github.com/jeayeong-hong/claude-code/blob/main/src/utils/debug.ts): `src/utils/debug.ts`
- [Application Logging](https://github.com/jeayeong-hong/claude-code/blob/main/src/utils/log.ts): `src/utils/log.ts`
- [Environment Utilities](https://github.com/jeayeong-hong/claude-code/blob/main/src/utils/envUtils.ts): `src/utils/envUtils.ts`
- [File History](https://github.com/jeayeong-hong/claude-code/blob/main/src/utils/fileHistory.ts): `src/utils/fileHistory.ts`
- [Filesystem Utilities](https://github.com/jeayeong-hong/claude-code/blob/main/src/utils/fsOperations.ts): `src/utils/fsOperations.ts`
- [JSON Utilities](https://github.com/jeayeong-hong/claude-code/blob/main/src/utils/json.ts): `src/utils/json.ts`
- [Slow Operation Tracking](https://github.com/jeayeong-hong/claude-code/blob/main/src/utils/slowOperations.ts): `src/utils/slowOperations.ts`

### Other components

- **Engineer**

## Connections

- Engineer → Ink Terminal UI: enters prompts
- Engineer → Slash Commands: invokes commands
- Ink Terminal UI → Query Engine: submits requests
- Query Engine → Anthropic API: calls API (evidence: `src/QueryEngine.ts`)
- Query Engine → Tool Contracts: uses tool definitions (evidence: `src/QueryEngine.ts`)
- Query Engine → Conversation Messages: processes messages (evidence: `src/QueryEngine.ts`)
- Query Engine → File Operations: dispatches tools (evidence: `src/QueryEngine.ts`)
- Query Engine → Shell and Git: dispatches tools (evidence: `src/QueryEngine.ts`)
- Query Engine → Code Search: dispatches tools (evidence: `src/QueryEngine.ts`)
- Query Engine → Agents and Tasks: dispatches tools (evidence: `src/QueryEngine.ts`)
- Query Engine → Persistent Memory: uses memory (evidence: `src/QueryEngine.ts`)
- Slash Commands → Session Storage: manages sessions (evidence: `src/utils/sessionStorage.ts`)
- Slash Commands → MCP Servers: manages servers (evidence: `src/services/mcp/MCPConnectionManager.tsx`)
- Slash Commands → Plugin Management: manages plugins (evidence: `src/services/plugins/PluginInstallationManager.ts`)
- Slash Commands → Language Servers: configures LSP
- Slash Commands → Remote Sessions: supports handoff
- IDE Bridge → Ink Terminal UI: communicates with
- Remote Sessions → Anthropic API: uses remote services
- Runtime State → Session Storage: provides session state (evidence: `src/utils/sessionStorage.ts`)
- Configuration → Runtime State: reads runtime state (evidence: `src/utils/config.ts`)
- Query Engine → Tool Result Storage: stores tool results
- Environment Utilities → Configuration: selects config paths (evidence: `src/utils/config.ts`)
- Debug Logging → Filesystem Utilities: writes debug logs (evidence: `src/utils/debug.ts`)
- Slow Operation Tracking → Debug Logging: logs slow operations (evidence: `src/utils/slowOperations.ts`)
- Application Logging → Conversation Messages: formats log titles (evidence: `src/utils/log.ts`)
- Feature Flags → Slash Commands: gates features
- File History → Filesystem Utilities: tracks file changes
- JSON Utilities → Configuration: handles config data (evidence: `src/utils/config.ts`)
