Vibeleaderboard
← All Intel
Intel / repo

claude-agent-sdk-typescript v0.3.304

Source
github.com
Publisher
Anthropic
Author
ashwin-antTop Viber
Date

Context

The most practical change in version 0.3.304 of Anthropic's TypeScript Agent SDK is a fix to `startup()`, which could time out simply because a startup was still running (release notes). `startup()` pre-warms an agent: it launches the Claude Code the SDK drives and completes the opening handshake before any prompt exists, so the first real query does not pay that startup cost. It waits up to `initializeTimeoutMs` for that, 60 seconds by default, and rejects with a timeout error if initialization takes longer (SDK reference).

The problem was hooks. SessionStart and Setup command hooks are commands configured to run as a session begins, and while they ran, their time counted against that 60-second limit, so a slow hook could make `startup()` time out. According to the notes, when no `initializeTimeoutMs` is passed, up to 10 minutes of hook time no longer counts toward the limit, and a timeout error now includes what the process reported, which makes the cause easier to find. The notes describe the change only for that default case; they do not say how an explicitly set timeout treats hook time. A related fix stops `startup()` from holding every progress message from a running hook in memory and keeps only the newest one per hook.

Key takeaways · AI-distilled
  • When no initializeTimeoutMs is passed, startup() no longer counts up to 10 minutes spent in a running SessionStart or Setup command hook toward its 60-second limit, and the timeout error now reports what the process said.
  • During a long SessionStart or Setup hook, startup() now keeps only the newest hook_progress message per hook instead of holding every progress message in memory until it resolves.
  • getContextUsage() rows now carry stable ids. Plugin ids, agent and file paths, and per-server instruction token shares appear only when the CLI answers on its own stdio. The release matches Claude Code v2.1.304.
Terms in this piece · Glossary
  • 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.
  • Process — A running instance of a program, with its own working memory, open files and identity.
  • 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.
  • Model Context Protocol (MCP) — A published agreement for an AI application to discover what a separate program offers and ask it to run one of those offerings.

Get the Brief

A cited digest of what matters for people building with AI, every morning. Unsubscribe anytime. See today’s edition

More from ashwin-ant
Recommended reads