# Inspecting what the agent sends

> What an agent sends to the model is hidden by default. This topic covers watching how full the context is while working, reading the record a harness keeps of each session, and logging the exact requests the agent sends to the model provider, along with why each of these records holds sensitive data.

Page: https://schubergphilis.github.io/ai-training/topics/customizing-agents/inspecting-the-agent/
License: CC BY-SA 4.0, https://creativecommons.org/licenses/by-sa/4.0/

*Customizing agents* · topic `customizing-agents/inspecting-the-agent`

What an agent sends to the model is hidden by default. This topic covers watching how full the context is while working, reading the record a harness keeps of each session, and logging the exact requests the agent sends to the model provider, along with why each of these records holds sensitive data.

## Concepts

- **Context meter**: A live view of how much of the context window a session uses. A status line can show the share in use and the tokens so far as the session runs, and a context command breaks the use down by category, such as instructions, tools, memory and messages. Watching it shows when a session is getting full and which tools or files are expensive, so the learner can compact or start fresh before the agent starts dropping instructions. [glossary](https://schubergphilis.github.io/ai-training/glossary/#context-meter)
- **Session record**: The file in which a harness saves a session, with every message, tool call and tool result, so the session can be resumed later. It is the most complete account of what the agent saw and did, and the place to find where a run went wrong. It is also plain text on disk, kept for a set number of days, and it holds whatever passed through a tool, including file contents and any secret the agent printed. [glossary](https://schubergphilis.github.io/ai-training/glossary/#session-record)
- **Request logging**: Recording the exact requests an agent sends to the model provider and the responses it gets back. The agent can be pointed at a gateway between it and the provider that logs every request, or a monitoring export can be set to include full request bodies, which it leaves out by default. The log shows what each tool description, file and instruction costs. It holds everything the agent read, so it stays on systems the team controls. [glossary](https://schubergphilis.github.io/ai-training/glossary/#request-logging)

## Links

- **Builds on:** [What an agent is](https://schubergphilis.github.io/ai-training/topics/concepts/what-is-an-agent/), [Running a coding agent](https://schubergphilis.github.io/ai-training/topics/coding-with-agents/first-session/)
- **Leads to:** nothing yet
- **Related:** [Connecting tools with MCP](https://schubergphilis.github.io/ai-training/topics/customizing-agents/mcp/), [Context engineering for code](https://schubergphilis.github.io/ai-training/topics/coding-with-agents/context/)
- **Competencies drawing on it:** [Connects an agent to tools and data safely](https://schubergphilis.github.io/ai-training/competencies/customizing-agents/connects-tools-safely/)

## Lessons

- [Seeing what the agent sends](https://schubergphilis.github.io/ai-training/customizing-agents/seeing-what-the-agent-sends/) (tutorial)

## Sources

- `Claude Code context window` [Explore the context window](https://code.claude.com/docs/en/context-window), Claude Code documentation (reference)
- `Claude Code statusline` [Customize your status line](https://code.claude.com/docs/en/statusline), Claude Code documentation (reference)
- `Claude Code claude directory` [Explore the .claude directory](https://code.claude.com/docs/en/claude-directory), Claude Code documentation (reference)
- `Claude Code monitoring` [Monitoring](https://code.claude.com/docs/en/monitoring-usage), Claude Code documentation (reference)
- `Claude Code llm gateway` [Other LLM gateways](https://code.claude.com/docs/en/llm-gateway), Claude Code documentation (reference)
