Vibeleaderboard
← All Intel
Intel / repo

claude-agent-sdk-typescript v0.3.317

Source
github.com
Author
ashwin-antTop Viber
Date

Context

Version 0.3.317 of Anthropic's Claude Agent SDK for TypeScript, a library for building agents that this release brings to parity with Claude Code v2.1.317, adds a setting for what happens when a breaks. Hooks are custom code a developer attaches to an , often to check an action and stop it if needed. With the new onFailure option on a hook matcher set to "block", a hook that throws an error or returns invalid output blocks the action. The release also puts a warning into the agent's message stream whenever a hook callback fails.

For a hook that acts as a safety check, such as one that must approve a command before it runs, the option means a crash or bug in the check stops the action. The release notes do not say what a failing hook does without the setting. A related addition reports a different quiet failure: a session_writes_lost message now arrives after the final result when a full disk or disk quota prevented the CLI from saving the session transcript or the ~/.claude.json file.

Key takeaways · AI-distilled
  • Hook matchers gain an `onFailure` setting: with "block", a hook that throws or returns invalid output blocks the action. The stream also now carries a warning whenever a hook callback fails.
  • A new `session_writes_lost` system message arrives after the last result when a full disk or disk quota kept the CLI from saving the session transcript or ~/.claude.json.
  • The `file_unchanged` variant of `FileReadOutput` is removed, so a repeated Read now returns the file content. `readFile()` utf-8 answers also gain a `lossy` flag, true when invalid UTF-8 bytes were replaced.
Terms in this piece · Glossary
  • AI agent — An AI system that doesn't just answer once but works toward a goal in a loop — taking actions, reading the results, and deciding what to do next.
  • 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.
  • MCP — The Model Context Protocol — an open standard that lets any AI assistant plug into any tool or data source without custom integration code.
More from ashwin-ant
Recommended reads
Comments

Checking sign-in…

Loading comments…