tk is now a reserved metadata name and stripped from your extra metadata or body.
What's wrong with this entry?
Remote-controlled sessions now attach a per-turn attribution key to API request metadata as tk, alongside device_id, session_id and parent_session_id. Because of that, tk has been added to the list of metadata names you cannot set yourself: anything you put under that name in CLAUDE_CODE_EXTRA_METADATA or CLAUDE_CODE_EXTRA_BODY is stripped before the request is sent.
- The full reserved set is
ti,sb,he,uf,ap,tk; your object is filtered against it so the key cannot be spoofed. - The key is carried on queued user messages, propagated through agent contexts, and merged when queued prompts are combined, where the last keyed entry wins.
- Only computed when the session is running remote-controlled (
CLAUDE_CODE_REMOTE); omitted otherwise, and deliberately not set for cross-session inbound messages.
kxS = new Set(["ti", "sb", "he", "uf", "ap", "tk"]);, turnAttributionKey, CLAUDE_CODE_EXTRA_BODY
Strings lifted out of the shipped bundle, so the claim above can be checked against them.
Related
Other releases about the same thing. Found by shared names or similar wording; neither means one caused the other.
-
v2.1.222
Commands, skills and plugin manifests accept a free-form metadata object
Both mention metadata
-
v2.1.222
Bad
metadatain frontmatter and manifests now warnsBoth mention metadata
-
v2.1.222
Skill frontmatter metadata is kept on the loaded record
Both mention metadata