ClaudeCode Code Walkthrough: From Request to Tool Execution

This chapter gives you a practical map of how ClaudeCode handles a request, so you can read the source code with clear priorities.

1. Main Flow

Think of one request in four steps:

  1. Parse user input and current context
  2. Build the system prompt
  3. Run model inference and decide whether to call tools
  4. Persist session state and produce the final response

2. Core Modules to Read First

3. Recommended Reading Strategy

4. Three Questions to Keep in Mind


Next step: read query.ts first, then tool orchestration and context compaction modules.