This sharing starts from model APIs and tool calling, explaining how Code Agent builds and consumes context through multi-round execution, feedback, and error correction. Combining public protocols, source code, and templates, it sorts out the boundaries between history, state, external data, and current context, analyzes long-context issues, and examines the costs of compression, prefix caching, memory, skills, and sub-agents. At runtime, an auditable append-only history should be maintained, constructing context as a finite derived view: stable instructions and tools form a cacheable prefix, compressed old state is placed in the middle, and the current request along with original evidence stays near the end. Through on-demand retrieval and isolated collaboration, it balances accuracy, cost, latency, and recoverability.