{"version":"2.1.248","anchor":"retaining-tool-definitions-across-context-loss-and-credentia","canonical_anchor":"retaining-tool-definitions-across-context-loss-and-credentia","heading":"Retaining tool definitions across context loss and credential changes, off by default","tier":"soon","area":"Tools","scope":null,"heads_up":null,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.248\/e\/retaining-tool-definitions-across-context-loss-and-credentia","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.248","markdown":"### Retaining tool definitions across context loss and credential changes, off by default\n\nTool definitions could survive context loss and credential changes, but both halves are off.\n\n**What**\n\nNew machinery keeps dynamically loaded tool definitions usable after the messages that first declared them scroll out of the conversation window, and separately preserves already-built tool descriptions when your credentials or access token change rather than rebuilding them all. Both halves are behind server-controlled gates that fall back to off, so this build behaves exactly as before unless the server turns them on.\n\n**Details**\n\n- Deferred tool retention is gated on `tengu_plucky_orchard`; if no server value comes back the feature resolves to off for the whole session and that decision is cached.\n- Retention is forced off when the environment variable `CLAUDE_CODE_SIMPLE` or `CLAUDE_CODE_DISABLE_ATTACHMENTS` is set.\n- Retained tools are tracked per tool-use id and tool name in a bounded map with a generation counter and a fail-closed latch, then spliced back into the tool list sent with the request.\n- The `strict` property is stripped from retained schemas when the request does not use structured outputs.\n- Logs `Dynamic tool loading: keeping \u2026 departed deferred tool(s) declared;` and emits the event `mcp_kept_deferred_tools` with `kept_count`, `kept_mcp_count` and `stripped_reference_count`; failures surface as `plan_failed`, `retraction_failed` or `record_failed`.\n- Credential-change retention is gated on `tengu_still_kestrel`, which would keep completed tool descriptions and discard only the ones still being built; with the gate off the whole per-host description cache is thrown away, which is the existing behaviour.\n- The `tengu_still_kestrel` reader is registered at startup and deliberately returns nothing when the value came from the compiled-in fallback, in which case the helper answers false. Nothing in this build sets a value for either gate.\n\n**Evidence**\n\n`tengu_still_kestrel`, `tengu_plucky_orchard`\n\n- Flag `tengu_still_kestrel`: Gate removed from the code (read for one account on one subscription tier against v2.1.248; this account: on, anonymous baseline: on, compiled default: not a boolean we can read)\n- Area: Tools\n- Tier: Nothing to try yet\n- Useful: 2\/5\n- Signal: 4\/5\n- Present in the build but not switched on"}