Replay an AI Coding Session and Inspect Its Requests
- Source
- ishamf.dev
- Author
- ifz
- Date
Context
In the author's walkthrough of one coding-agent session, each step is a separate request to the model. The software sends instructions, tool definitions and the user's prompt, the model replies with a tool call, and the software runs that call locally and adds the result to the next request. This repeats until no tool call comes back.
The whole is sent again with every request. According to the same article, caching makes that affordable because earlier computation is reused and priced lower, but the author notes cheaper is not free. In this session, which added several mostly unrelated features, cached input grew to a significant part of each request's cost. Smaller prompts near the end needed fewer requests, yet the author reports they cost more than the first prompt because of the context being carried. In this session, then, the size of a follow-up message did not predict its cost.
- AI agent — An AI system that doesn't just answer once but works toward a goal in a loop — taking actions, reading the results, and deciding what to do next.
- context window — The maximum amount of text a model can consider at once — its working memory for the current conversation or task.
- system prompt — The standing instructions a model receives before any user input — defining its role, rules, tools, and tone for the whole conversation.
- prompt caching — Reusing the model's processed form of a repeated prompt prefix so subsequent calls skip re-reading it, cutting cost and latency substantially.
Checking sign-in…
Loading comments…


