{"version":"2.1.336","anchor":"new-set-spend-tags-control-sets-claude-code-spend-tags","canonical_anchor":"new-env-vars-claude-code-spend-tags-claude-code-owner-typin","heading":"New CLAUDE_CODE_SPEND_TAGS variable for tagging hosted sessions","tier":"use","area":"Sessions","scope":"both","heads_up":false,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.336\/e\/new-set-spend-tags-control-sets-claude-code-spend-tags","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.336","markdown":"### New CLAUDE_CODE_SPEND_TAGS variable for tagging hosted sessions\n\nA new `CLAUDE_CODE_SPEND_TAGS` variable can be set through a `set_spend_tags` request and is passed on next to `CLAUDE_CODE_SPEND_PROJECT`\n\n**What**\n\nAn environment variable is a named setting a program receives when it starts. Claude Code has a new one, `CLAUDE_CODE_SPEND_TAGS`, which sits beside the existing `CLAUDE_CODE_SPEND_PROJECT` (the variable that tags remote work with a billing project). It did not exist in the previous build.\n\n- `set_spend_tags` is a new control request, a message a program hosting Claude Code can send to it. It accepts `spend_tags` as either null or up to five lowercase `key_uuid:value_uuid` pairs joined by commas, and then sets or clears `CLAUDE_CODE_SPEND_TAGS`. It is refused when the session has no connection to the hosting service.\n\n- A line `CLAUDE_CODE_SPEND_TAGS=` is now added to the environment of sessions Claude Code starts, next to `CLAUDE_CODE_SPEND_PROJECT`, carrying the value through, or an empty value if it is unset. This happens only under a condition involving the iTerm2 terminal backend that could not be fully read.\n\n- `CLAUDE_CODE_SPEND_TAGS` is on lists of variable names Claude Code handles, alongside `CLAUDE_CODE_SPEND_PROJECT` and `CLAUDE_CODE_AWAIT_FIRST_MESSAGE`.\n\nThree other new variable names were added to the same kinds of lists in this release: `CLAUDE_CODE_OWNER_TYPING_WAKE_AT`, `CLAUDE_CODE_KEEP_AGENT_MEMORY`, and `CLAUDE_CODE_FLAG_SURFACE` (placed next to `CLAUDE_CODE_CCR_SURFACE`). What reads them was not traced from these lists.\n\n**Why**\n\nA hosted session can now carry a set of spend tags in addition to a spend project, a host can change them while the session runs, and the tags can reach sessions that one starts in turn.\n\n- Area: Sessions\n- Names: `CLAUDE_CODE_SPEND_TAGS`\n- Tier: Use it now\n- Useful: 4\/5\n- Signal: 3\/5\n- Scope: both\n- Heads-up: no"}