Appendix C Source Map: Which Files Ground Each Chapter
This book is not a full source walkthrough, but it is source-grounded. This appendix maps each chapter to its primary supporting files.
This is not a complete index. It lists only files directly relevant to the book's arguments.
One copyright boundary note: this map is for citing analytical basis, not for promising source-text reproduction. It preserves necessary engineering references, module positioning, and structural analysis, without shipping source copies or long implementation excerpts.
C.1 Chapter 1 Why Harness Engineering Matters
Core files:
src/constants/prompts.tssrc/utils/systemPrompt.tssrc/query.tssrc/services/tools/toolOrchestration.tssrc/tools/BashTool/prompt.ts
Primary argument basis:
- prompt as control-plane component rather than personality packaging
- query loop as agent-system skeleton
- tool and Bash risk profiles as proof harness is necessary
C.2 Chapter 2 Prompt Is the Control Plane, Not Persona Decoration
Core files:
src/constants/prompts.tssrc/utils/systemPrompt.tssrc/utils/claudemd.tssrc/memdir/memdir.tssrc/constants/systemPromptSections.tssrc/main.tsx
Primary argument basis:
- layered system-prompt assembly
CLAUDE.mdand memory as control-plane inputs- dynamic reminders and context injection
C.3 Chapter 3 Query Loop: The Heartbeat of an Agent System
Core files:
src/query.tssrc/QueryEngine.ts
Primary argument basis:
- state-machine properties of query loop
- input governance before model invocation
- streaming event consumption and recovery branches
- QueryEngine ownership of conversation lifecycle
C.4 Chapter 4 Tools, Permissions, and Interrupts
Core files:
src/services/tools/toolOrchestration.tssrc/services/tools/toolExecution.tssrc/services/tools/StreamingToolExecutor.tssrc/hooks/useCanUseTool.tsxsrc/utils/permissions/PermissionResult.tssrc/tools/BashTool/prompt.tssrc/tools/BashTool/bashPermissions.ts
Primary argument basis:
- concurrency safety and ordered context replay
- wrapped tool execution stack
allow / deny / askauthorization semantics- streaming-tool interruption and synthetic closure
- special high-pressure governance for Bash
C.5 Chapter 5 Context Governance: Memory, CLAUDE.md, and Compact
Core files:
src/utils/claudemd.tssrc/memdir/memdir.tssrc/services/SessionMemory/prompts.tssrc/services/compact/autoCompact.tssrc/services/compact/compact.tssrc/query.ts
Primary argument basis:
- layered discovery and loading of
CLAUDE.md MEMORY.mdas entry index, not content warehouse- structured continuity in session memory
- autocompact thresholds, buffers, and circuit breaker
- post-compact reconstruction of working semantics
C.6 Chapter 6 Errors and Recovery
Core files:
src/query.tssrc/services/compact/autoCompact.tssrc/services/compact/compact.tssrc/services/api/withRetry.ts
Primary argument basis:
- withheld recoverable errors
- prompt-too-long handling via collapse drain and reactive compact
max_output_tokensescalation and continuation strategy- autocompact failure circuit breaking
- compaction self-recovery under PTL
C.7 Chapter 7 Multi-Agent and Verification
Core files:
src/utils/forkedAgent.tssrc/coordinator/coordinatorMode.tssrc/tasks/LocalAgentTask/LocalAgentTask.tsxsrc/utils/hooks/hooksConfigManager.tssrc/skills/bundled/verify.tssrc/memdir/memoryTypes.ts
Primary argument basis:
- cache-safe fork parameters and state isolation
- coordinator synthesis responsibility
- independent verification stage
- subagent lifecycle hooks
- task cleanup and parent-child abort propagation
- stale-memory verification discipline
C.8 Chapter 8 Team Adoption
Core files:
src/utils/claudemd.tssrc/tools/SkillTool/prompt.tssrc/tools/SkillTool/SkillTool.tssrc/utils/forkedAgent.tssrc/utils/hooks/hooksConfigManager.tssrc/main.tsx
Primary argument basis:
- layered stability in team
CLAUDE.md - skills as institutional slices rather than prompt collections
- approval boundaries and allow-rule scoping
- lifecycle governance through hooks
- session startup behavior around instructions and skill loading
C.9 Chapter 9 Ten Principles
Chapter 9 is not derived from one single file. It compresses cross-chapter structures jointly reflected in:
- prompt assembly
- query loop
- tool orchestration
- permission model
- context governance
- recovery system
- multi-agent orchestration
- team governance hooks