{"slug": "anthropic-agent-memory-header-migrate-before-july-22", "title": "Anthropic Agent Memory Header: Migrate Before July 22", "summary": "Anthropic is forcing a migration to a new beta header for its Managed Agents memory store API by July 22, which changes memory listing behavior and may break code that relies on the old header. The new header, agent-memory-2026-07-22, alters path_prefix matching, ignores order_by and order parameters, restricts depth values, and invalidates old page cursors. Developers using raw HTTP calls or explicit beta headers must update their code to avoid silent failures or 400 errors.", "body_md": "Anthropic’s Managed Agents memory store API is getting a forced upgrade on July 22 — five days from now. A new beta header, `agent-memory-2026-07-22`\n\n, changes how memory listing works and rewires three parameter behaviors. When the deadline hits, the old `managed-agents-2026-04-01`\n\nheader automatically inherits those changes whether you’ve opted in or not. If you’re setting beta headers manually in curl, or if you haven’t updated to the latest Anthropic SDK versions, your code will break silently or with 400 errors by next Wednesday.\n\n## The Header Split\n\nAnthropic [announced this change on July 2](https://platform.claude.com/docs/en/release-notes/overview), alongside SDK updates across all eight official languages. The core rule is straightforward: memory store endpoints (`/v1/memory_stores/…`\n\n) now use `agent-memory-2026-07-22`\n\nas their beta header. Session endpoints — creating agents, attaching stores to sessions — still use `managed-agents-2026-04-01`\n\n. The two headers serve different endpoint groups and are no longer interchangeable on memory calls. Sending both on the same memory store request returns a `400`\n\nerror immediately.\n\nThe reason for the split is endpoint versioning independence. Anthropic wants to iterate on memory store behavior without bumping the broader managed agents header. This is the first dedicated versioning of the memory store surface, and more changes will follow.\n\n## Four Changes That Will Break Your Code\n\nThe new header is not cosmetic. It changes four specific behaviors on `GET /v1/memory_stores/{store_id}/memories`\n\n. Two are silent failures — the worst kind.\n\n### 1. path_prefix Now Matches Whole Segments, Not Substrings\n\nThis is the one most likely to cause invisible bugs. Previously, `path_prefix=/notes`\n\nwould match `/notes-archive/todo.md`\n\nas a substring match. Under the new header, `path_prefix`\n\nmust end with `/`\n\nand matches only complete path segments. `path_prefix=/notes/`\n\nreturns `/notes/todo.md`\n\nbut not `/notes-archive/todo.md`\n\n. If your code constructs `path_prefix`\n\nvalues without the trailing slash, or relies on partial segment matching, your listing results will silently shrink.\n\n### 2. order_by and order Are Silently Ignored\n\nResults are now returned in a stable, server-defined order. The `order_by`\n\nand `order`\n\nquery parameters still exist but do nothing — they’re ignored without error. If your code sorts memory listings by passing these parameters and then relies on that ordering for downstream logic, the ordering will change without any indication that your parameters were dropped.\n\n### 3. depth Is Restricted to 0, 1, or Omitted\n\nThis one is loud, not silent. Under the new header, passing any `depth`\n\nvalue other than `0`\n\nor `1`\n\nreturns a `400`\n\nerror. Omitting `depth`\n\nlists the full subtree. If you’re passing `depth=2`\n\nor higher anywhere, those calls start returning errors on July 22.\n\n### 4. Page Cursors From the Old Header Don’t Transfer\n\nCursors issued by the API before the header change are not valid after you adopt `agent-memory-2026-07-22`\n\n. If you’re in the middle of paginating through a large store and you switch headers mid-run, restart from page one. This also applies on July 22 when the auto-adoption kicks in — any in-flight pagination at the moment of adoption needs to restart.\n\n## Who Needs to Act\n\nThe [official Anthropic SDKs](https://platform.claude.com/docs/en/managed-agents/memory) have already been updated: Python 0.116.0, TypeScript 0.110.0, Go 1.56.0, Java 2.48.0, Ruby 1.55.0, PHP 0.36.0, C# 12.35.0, and CLI 1.16.0. All of them now send `agent-memory-2026-07-22`\n\non memory store calls automatically. If you’re on these versions or newer and you do not override beta headers manually, you’re already running the new behavior and you’ll see no change on July 22.\n\nYou need to act if:\n\n- You use raw HTTP calls (curl, HTTP libraries) and set\n`anthropic-beta`\n\nheaders directly - You use an official SDK but pass\n`betas`\n\nexplicitly on memory store calls with the old header string - You’re on SDK versions below the minimums above\n\n## Migration Steps\n\nBefore July 22:\n\n- Search your codebase for\n`managed-agents-2026-04-01`\n\nanywhere it appears on a memory store call. Session endpoint calls keep that header — only memory store calls change. - Replace with\n`agent-memory-2026-07-22`\n\non those calls. Do not send both — that’s a 400. - Audit every\n`path_prefix`\n\nvalue you construct. Ensure it ends with`/`\n\nand that you’re not relying on substring matching across directory boundaries. - Audit\n`depth`\n\nparameter usage. Values above 1 need to be removed or replaced with 0 or 1. - Invalidate any stored page cursors. Restart pagination from the first page after updating.\n\n## One More Thing: Read-Only Access\n\nThe [memory documentation’s security note](https://platform.claude.com/docs/en/api/beta-headers) is worth flagging here. Memory stores default to `read_write`\n\n. If an agent is processing untrusted input — user-supplied prompts, fetched web content, third-party tool output — a successful prompt injection could write malicious content into the store. Every future session that reads from that store then sees it as trusted memory. Use `read_only`\n\naccess for any store that the agent doesn’t need to modify, particularly shared reference material or stores attached to sessions handling external input.\n\n## The Deadline Is July 22\n\nThe auto-adoption on July 22 is unconditional. Anthropic doesn’t provide an opt-out path beyond adopting the new header early. Developers running on official SDKs at current versions are already there. Developers running manual header configurations or outdated SDK versions have five days. Check your memory store calls, update the header, and fix the three parameter behaviors — the `path_prefix`\n\none in particular is easy to miss until queries start returning unexpectedly empty results.\n\nThe full behavior spec is in [Anthropic’s memory documentation](https://platform.claude.com/docs/en/managed-agents/memory#list-memories).", "url": "https://wpnews.pro/news/anthropic-agent-memory-header-migrate-before-july-22", "canonical_source": "https://byteiota.com/anthropic-agent-memory-header-migrate-before-july-22/", "published_at": "2026-07-17 00:07:57+00:00", "updated_at": "2026-07-17 01:34:16.829005+00:00", "lang": "en", "topics": ["ai-products", "ai-infrastructure", "developer-tools"], "entities": ["Anthropic", "Claude"], "alternates": {"html": "https://wpnews.pro/news/anthropic-agent-memory-header-migrate-before-july-22", "markdown": "https://wpnews.pro/news/anthropic-agent-memory-header-migrate-before-july-22.md", "text": "https://wpnews.pro/news/anthropic-agent-memory-header-migrate-before-july-22.txt", "jsonld": "https://wpnews.pro/news/anthropic-agent-memory-header-migrate-before-july-22.jsonld"}}