What
Publishing an artifact now records the account and conversation it started in, and the session state written after the server responds is only kept if both still match. A publish that finishes after /clear or an account switch no longer writes its slug, verification record or cached contract into the new session.
Details
- The state guarded this way includes the registry of slugs published by this session, the last-publish record used for verification, and the cached publish contract pin.
- Resetting a conversation without continuing it bumps the conversation counter and clears the published-slug registry.
- Unconditional; both counters start at 0.
Evidence
ownPublishedSlugs
Strings lifted out of the shipped bundle, so the claim above can be checked against them.
Names in the bundle/clear
The entry above is what we published on the day. These lines were added later, as Anthropic's own pages caught up, and they sit beside the original rather than replacing it.
Added since
A small documentation edit on How the agent loop works touched a line naming /clear after this was published.
With [streaming input](/docs/en/agent-sdk/streaming-vs-single-mode), a message that is still queued when a turn ends at the max-turns limit stays queued. Claude Code doesn't add it to that turn's last model call. It starts a new turn for t…agent-sdk/agent-loop see the edit
Confirmed since
Anthropic's documentation has since written up /clear, on Hooks reference.
* **Later in a running session**: after `/clear` or a compaction, `SessionStart` fires again with the servers already available, and its `mcp_tool` hooks run.hooks see the edit
One source agreesOne thing we can check says the same as this entry.
Anthropic's documentation agrees
Anthropic's documentation has since written up /clear, on Hooks reference.