claude-agent-sdk-typescript v0.3.332
- Source
- github.com
- Author
- claude-code-publisher[bot]Top Viber
- Date

Context
Version 0.3.332 of Anthropic's TypeScript Agent SDK, the library developers use to build their own agents on Claude Code's engine, makes messages sent while Claude is in the middle of a turn count as the user's in some sessions where they did not before, which matters for applications that pass other text into a session (release notes). The change concerns auto mode, where a classifier model reviews actions such as commands and network requests and allows or blocks each one. The release notes say auto mode was missing user messages sent mid-turn, from Opus 4.8 on, in sessions that don't fetch feature flags. Claude Code turns some features on through flags it fetches from Anthropic, and the environment variables documentation says it skips that fetch on third-party providers such as Amazon Bedrock and Google Cloud's Agent Platform, and when variables such as `DISABLE_TELEMETRY` are set. When Claude Code sends its own classifier requests, the permission modes documentation says the classifier sees the user's messages, Claude's tool calls other than read-only lookups, and the project's CLAUDE.md, while tool results are stripped so that hostile content in a file or web page can't manipulate it directly. The same page says that from Claude Code 2.1.282, sessions that don't fetch flags ask Anthropic's server to do the review by default, and it doesn't describe what that review sees.
After the fix, those mid-turn messages count as the user's, and the release notes tell applications to mark any other text `isSynthetic: true`. The matching Claude Code 2.1.332 release notes describe that other text as relayed. The SDK's TypeScript reference already says to send text the user didn't write, such as a fetched page or another agent's output, as its own message with `isSynthetic` set to `true`, which Claude Code records as not coming from the user. An that instead passes such text as an ordinary user message during a turn now has it counted as the user's in these environments. That matters because the permission modes documentation ties some verdicts to what the user wrote: among the actions the classifier blocks by default is sending sensitive details to other people or shared systems when the user's own message didn't authorize them. The release notes don't say what else the change does to verdicts, so before upgrading, check that everything the application injects mid-turn that the user didn't type carries the flag.
The other change can stop a build. `Query.setPermissionMode()`, which switches a running session between modes such as `default` and `auto`, now resolves with `{ mode }`, the mode in effect after the call, or with `undefined`, and the release notes say code that holds its promise as `Promise<void>` no longer compiles. The notes don't say when the call resolves with `undefined`, and the TypeScript reference still showed the old `Promise<void>` signature when this was written. The release also adds types for the `PreSkillShellCommand` , which Claude Code 2.1.332 introduced so a hook can refuse the shell commands a runs as it loads, and a `rewritten_by_plugin` field that marks a tool result a plugin mod's `session.append` hook changed.
- Query.setPermissionMode() now resolves with { mode }, the permission mode actually in effect, or undefined. It is a breaking type change: code that holds the promise as Promise<void> no longer compiles.
- Auto mode no longer misses mid-turn user messages where feature flags aren't fetched, such as on clouds or with telemetry off, from Opus 4.8 on. Those messages now count as the user's, so other text sent mid-turn should be marked isSynthetic: true.
- Two additions for extension authors: tool_result_meta[].rewritten_by_plugin is set when a mod's session.append hook changed a tool result, and the new PreSkillShellCommand hook event ships with its own input and output types.
- Terminal and shell — A text interface for navigating files and running programs.
- Application — Software arranged so that a person can use it; in this course, the software around a model that accepts your request, prepares the context and shows the reply.
- agent hook — A script the harness runs automatically at a fixed point in an agent's loop — before a tool call, after an edit, on session start.
- agent skill — A reusable instruction file that teaches an agent how to do one job well — the procedure, the tools, and what counts as done.
Checking sign-in…
Loading comments…






