{"version":"2.1.321","anchor":"mcp-serve-code-added-with-no-caller-found-session-end-hooks","canonical_anchor":"mcp-serve-code-added-with-no-caller-found-session-end-hooks","heading":"Changed code for mcp serve covers end-of-session hooks and a log of recent runs","tier":"internal","area":"MCP","scope":"individual","heads_up":false,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.321\/e\/mcp-serve-code-added-with-no-caller-found-session-end-hooks","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.321","markdown":"### Changed code for `mcp serve` covers end-of-session hooks and a log of recent runs\n\nCode that runs end-of-session hooks and keeps a list of recent runs for `mcp serve` has changed, but nothing visibly uses it yet\n\n**Unclear.** It is not shown whether anything in Claude Code calls these functions, so it is unclear whether they have any effect yet.\n\n**What**\n\nThis build changes a group of helper functions related to `mcp serve`, the mode where Claude Code itself acts as an MCP server, an add-on program that offers tools to another app. The functions:\n\n- Run `SessionEnd` hooks, the commands you can set to run when a session terminates, and report how that went.\n\n- Keep a list of recent runs in a file named `tool-container-runs.json`, except when `CLAUDE_CODE_REMOTE_ENVIRONMENT_TYPE` is `self_hosted`.\n\n- Read a piece of extra information attached to a request under the key `anthropic\/startOnlyFilesOfCall`.\n\n**Why**\n\nThis looks like preparation for running `mcp serve` inside a container, a sealed-off environment on another machine. Until something calls these functions, nothing changes in how Claude Code behaves for you.\n\n- Area: MCP\n- Tier: Under the hood\n- Useful: 1\/5\n- Signal: 2\/5\n- Scope: individual\n- Heads-up: no"}