AI News
Signal over noise. Daily.
一線 AI Lab
23 articlesClaude Code changelog
Release notes for Claude Code, including new features, improvements, and bug fixes by version. This page is generated from the CHANGELOG.md on GitHub. Run `claude --version` to check your installed version. * Claude Sonnet 5 sessions no longer use the mid-conversation system role for harness reminders * Changed `AskUserQuestion` dialogs to no longer auto-continue by default; opt into an idle timeout via `/config` * Changed the "default" permission mode to "Manual" across the CLI, `--help`, VS Code, and JetBrains; `--permission-mode manual` and `"defaultMode": "manual"` are accepted alongside `default` * Fixed a crash at startup when `disabledMcpServers` or `enabledMcpServers` in `.claude.json` is set to a non-array value
Agent SDK reference - TypeScript
Complete API reference for the TypeScript Agent SDK, including all functions, types, and interfaces. npm install @anthropic-ai/claude-agent-sdk The SDK bundles a native Claude Code binary for your platform as an optional dependency such as `@anthropic-ai/claude-agent-sdk-darwin-arm64`. You don't need to install Claude Code separately. If your package manager skips optional dependencies, the SDK throws `Native CLI binary for not found`; set `pathToClaudeCodeExecutable` to a separately installed `claude` binary instead. When you compile your application into a single-file executable with `bun build --compile`, the SDK cannot resolve the bundled CLI binary at runtime. `require.resolve` does not work inside the compiled executable's `$bunfs` virtual filesystem, so the SDK throws `Native CLI…
Agent SDK reference - Python
Complete API reference for the Python Agent SDK, including all functions, types, and classes. pip install claude-agent-sdk The Python SDK provides two ways to interact with Claude Code: | Feature | `query()` | `ClaudeSDKClient` | | :------------------ | :--------------------------------------------- | :--------------------------------- | | **Session** | Creates a new session by default | Reuses same session | | **Conversation** | Single exchange | Multiple exchanges in same context | | **Connection** | Managed automatically | Manual control | | **Streaming Input** | ✅ Supported | ✅ Supported |
Stream responses in real-time
Get real-time responses from the Agent SDK as text and tool calls stream in By default, the Agent SDK yields complete `AssistantMessage` objects after Claude finishes generating each response. To receive incremental updates as text and tool calls are generated, enable partial message streaming by setting `include_partial_messages` (Python) or `includePartialMessages` (TypeScript) to `true` in your options. This page covers output streaming (receiving tokens in real-time). For input modes (how you send messages), see Send messages to agents. You can also stream responses using the Agent SDK via the CLI. To enable streaming, set `include_partial_messages` (Python) or `includePartialMessages` (TypeScript) to `true` in your options. This causes the SDK to yield `StreamEvent` messages…
Modifying system prompts
Choose between the `claude_code` preset and a custom system prompt, and customize behavior with CLAUDE.md, output styles, append, or a fully custom prompt. System prompts define Claude's behavior, capabilities, and response style. Start from the `claude_code` preset for CLI or IDE-like coding tools where a human watches and steers the work. Write your own prompt for agents with a different surface, identity, or permission model. This page covers: * How system prompts work, with a decision table for choosing between the preset, the preset with `append`, and a custom prompt * Customize agent behavior with CLAUDE.md files, output styles, `append`, or a custom string * Compare the four approaches by persistence, scope, and what they preserve * Combine approaches to layer customization methods…
Connect to external tools with MCP
Configure MCP servers to extend your agent with external tools. Covers transport types, tool search for large tool sets, authentication, and error handling. The Model Context Protocol (MCP) is an open standard for connecting AI agents to external tools and data sources. With MCP, your agent can query databases, integrate with APIs like Slack and GitHub, and connect to other services without writing custom tool implementations. MCP servers can run as local processes, connect over HTTP, or execute directly within your SDK application. This page covers MCP configuration for the Agent SDK. To add MCP servers to the Claude Code CLI so they load in every project, see MCP installation scopes. This example connects to the Claude Code documentation MCP server using HTTP transport and uses…
Handle approvals and user input
Surface Claude's approval requests and clarifying questions to users, then return their decisions to the SDK. While working on a task, Claude sometimes needs to check in with users. It might need permission before deleting files, or need to ask which database to use for a new project. Your application needs to surface these requests to users so Claude can continue with their input. Claude requests user input in two situations: when it needs **permission to use a tool** (like deleting files or running commands), and when it has **clarifying questions** (via the `AskUserQuestion` tool). Both trigger your `canUseTool` callback, which pauses execution until you return a response. This is different from normal conversation turns where Claude finishes and waits for your next message. For…
Use Claude Code on the web
Configure cloud environments, setup scripts, network access, and Docker in Anthropic's sandbox. Move sessions between web and terminal with `--cloud` and `--teleport`. Claude Code on the web is in research preview for Pro, Max, and Team users, and for Enterprise users with premium seats or Chat + Claude Code seats. Claude Code on the web runs tasks on Anthropic-managed cloud infrastructure at claude.ai/code. Sessions persist even if you close your browser, and you can monitor them from the Claude mobile app. New to Claude Code on the web? Start with Get started to connect your GitHub account and submit your first task. This page covers: * GitHub authentication options: two ways to connect GitHub * The cloud environment: what config carries over, what tools are installed, and how to…
Observability with OpenTelemetry
Export traces, metrics, and events from the Agent SDK to your observability backend using OpenTelemetry. When you run agents in production, you need visibility into what they did: * which tools they called * how long each model request took * how many tokens were spent * where failures occurred The Agent SDK can export this data as OpenTelemetry traces, metrics, and log events to any backend that accepts the OpenTelemetry Protocol (OTLP), such as Honeycomb, Datadog, Grafana, Langfuse, or a self-hosted collector. This guide explains how the SDK emits telemetry, how to configure the export, and how to tag and filter the data once it reaches your backend. To read token usage and cost directly from the SDK response stream instead of exporting to a backend, see Track cost and usage. The Agent…
Hosting the Agent SDK
Deploy the Agent SDK in production: subprocess architecture, session persistence, scaling, observability, and multi-tenant isolation for Docker, Kubernetes, and sandbox providers. The Agent SDK spawns and supervises a `claude` CLI subprocess that owns a shell, a working directory, and session files on disk. Hosting it is not like hosting a stateless API wrapper. Every running agent is a long-lived process tied to local state, which shapes how you allocate resources, persist sessions, and scale across tenants. This page covers self-hosting on your own infrastructure: understand the subprocess model, choose a session pattern, provision the container, and handle production concerns like persistence, observability, auth, and multi-tenant isolation. For deployable Dockerfiles and Kubernetes…
Subagents in the SDK
Define and invoke subagents to isolate context, run tasks in parallel, and apply specialized instructions in your Claude Agent SDK applications. Subagents are separate agent instances that your main agent can spawn to handle focused subtasks. Use them to isolate context, run multiple analyses in parallel, and apply specialized instructions without adding to the main agent's prompt. This guide explains how to define and use subagents in the SDK using the `agents` parameter. You can create subagents in three ways: * **Programmatically**: use the `agents` parameter in your `query()` options. See the TypeScript and Python references * **Filesystem-based**: define agents as markdown files in `.claude/agents/` directories. See defining subagents as files * **Built-in general-purpose**: Claude…
Todo Lists
Track and display todos using the Claude Agent SDK for organized task management Todo tracking provides a structured way to manage tasks and display progress to users. The Claude Agent SDK includes built-in todo functionality that helps organize complex workflows and keep users informed about task progression. As of TypeScript Agent SDK 0.3.142 and Claude Code v2.1.142, sessions use the structured Task tools `TaskCreate`, `TaskUpdate`, `TaskGet`, and `TaskList` instead of `TodoWrite`. The Python SDK gets this change from the Claude Code CLI it launches, not from the Python package version: the switch applies once that CLI — the copy bundled inside the pip package, or one you point to with `cli_path` — is v2.1.142 or later. See Migrate to Task tools for how monitoring code changes. The…
Rewind file changes with checkpointing
Track file changes during agent sessions and restore files to any previous state File checkpointing tracks file modifications made through the Write, Edit, and NotebookEdit tools during an agent session, allowing you to rewind files to any previous state. Want to try it out? Jump to the interactive example. With checkpointing, you can: * **Undo unwanted changes** by restoring files to a known good state * **Explore alternatives** by restoring to a checkpoint and trying a different approach * **Recover from errors** when the agent makes incorrect modifications Only changes made through the Write, Edit, and NotebookEdit tools are tracked. Changes made through Bash commands (like `echo > file.txt` or `sed -i`) are not captured by the checkpoint system. When you enable file checkpointing, the…
Track cost and usage
Learn how to track token usage, estimate costs, and configure prompt caching with the Claude Agent SDK. The Claude Agent SDK provides detailed token usage information for each interaction with Claude. This guide explains how to properly track usage and understand cost reporting, especially when dealing with parallel tool uses and multi-step conversations. For complete API documentation, see the TypeScript SDK reference and Python SDK reference. The `total_cost_usd` and `costUSD` fields are client-side estimates, not authoritative billing data. The SDK computes them locally from a price table bundled at build time, so they can drift from what you are actually billed when: * pricing changes * the installed SDK version does not recognize a model * billing rules apply that the client cannot…
How the agent loop works
Understand the message lifecycle, tool execution, context window, and architecture that power your SDK agents. The Agent SDK lets you embed Claude Code's autonomous agent loop in your own applications. The SDK is a standalone package that gives you programmatic control over tools, permissions, cost limits, and output. You don't need the Claude Code CLI installed to use it. When you start an agent, the SDK runs the same execution loop that powers Claude Code: Claude evaluates your prompt, calls tools to take action, receives the results, and repeats until the task is complete. This page explains what happens inside that loop so you can build, debug, and optimize your agents effectively. Every agent session follows the same cycle:
Google DeepMind and A24 announce first-of-its-kind research partnership
Today, Google DeepMind and A24 are announcing a first-of-its-kind partnership focused on research. The collaboration pairs a world-leading research lab with the industry…
Visible Extended Thinking
Discussing Claude's new thought process
Anthropics Responsible Scaling Policy
We’re publishing our Responsible Scaling Policy—a series of technical and organizational protocols that we’re adopting to help us manage the risks of developing increasingly capable AI systems.
Fable Safeguards Jailbreak Framework
What is and isn't blocked by our cyber classifiers, and a first draft of our jailbreak severity framework
Monitoring
Learn how to enable and configure OpenTelemetry for Claude Code. Track Claude Code usage, costs, and tool activity across your organization by exporting telemetry data through OpenTelemetry (OTel). Claude Code exports metrics as time series data via the standard metrics protocol, events via the logs/events protocol, and optionally distributed traces via the traces protocol. Configure your metrics, logs, and traces backends to match your monitoring requirements. Configure OpenTelemetry using environment variables: export CLAUDE_CODE_ENABLE_TELEMETRY=1 export OTEL_METRICS_EXPORTER=otlp # Options: otlp, prometheus, console, none export OTEL_LOGS_EXPORTER=otlp # Options: otlp, console, none export OTEL_EXPORTER_OTLP_PROTOCOL=grpc export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317
How Claude Code works
Understand the agentic loop, built-in tools, and how Claude Code interacts with your project. Claude Code is an agentic assistant that runs in your terminal. While it excels at coding, it can help with anything you can do from the command line: writing docs, running builds, searching files, researching topics, and more. This guide covers the core architecture, built-in capabilities, and tips for working effectively. For step-by-step walkthroughs, see Common workflows. For extensibility features like skills, MCP, and hooks, see Extend Claude Code. When you give Claude a task, it works through three phases: **gather context**, **take action**, and **verify results**. These phases blend together. Claude uses tools throughout, whether searching files to understand your code, editing to make…
Configure permissions
Control how your agent uses tools with permission modes, hooks, and declarative allow/deny rules. The Claude Agent SDK provides permission controls to manage how Claude uses tools. Use permission modes and rules to define what's allowed automatically, and the `canUseTool` callback to handle everything else at runtime. This page covers permission modes and rules. To build interactive approval flows where users approve or deny tool requests at runtime, see Handle approvals and user input. When Claude requests a tool, the SDK checks permissions in this order: Run hooks first. A hook can deny the call outright or pass it on. A hook that returns `allow` does not skip the deny and ask rules below; those are evaluated regardless of the hook result.
Claude Sonnet 5
Our most agentic Sonnet yet, with top-tier intelligence for coding and everyday professional work.
媒體
6 articlesThe only AI glossary you’ll need this year
The rise of AI has brought an avalanche of new terms and slang. Here is a glossary with definitions of some of the most important words and phrases you might encounter.
The browser wars aren’t about search anymore — here are the best alternatives to Chrome and Safari
We’ve compiled an overview of some of the top alternative browsers available today aiming to challenge Chrome and Safari.
Google DeepMind Unionization Talks Are Off to a Rocky Start
During negotiations on Wednesday, employees voiced frustrations with what they consider an unwillingness among executives to engage meaningfully with the prospect of unionization.
Anthropic wants to develop its own drugs
At the event "The Briefing: AI for Science" earlier this week, Anthropic announced Claude Science , a new " AI workbench for scientists " that pulls fragmented tools and datasets into one environment, and generates figures and visuals. Anthropic, already dominating the industry with its popular coding tools and powerful AI models, framed the launch around what it says is AI's potential to "dramatically accelerate the pace of scientific discovery and the development of healthcare interventions," and touted a long list of biotech and pharma customers already using Claude. Anthropic also went a step further, saying it would develop drugs of its … Read the full story at The Verge.
A behind-the-scenes look at Midjourney’s medical scanner leaves many questions unanswered
A scan of an imaging phantom, segmented to validate how cleanly structures separate under controlled conditions. | Image: Midjourney Medical Midjourney has shown more of its futuristic medical scanner . It still hasn't shown much proof it works. The AI startup, best known for generating images, released a behind-the-scenes video of its dunk-tank ultrasound scanner, which it plans to deploy in spas and hopes will transform medicine with cheap, detailed, radiation-free imaging. The nearly 20-minute tour comes from tech YouTuber Marcin Plaza, who also happens to be an engineer at the company. Plaza frankly describes the scanner as scores of ultrasound probes "hacked apart and slapped on a glorified hot tub with an elevator in it," connected to off-the-shelf computers and Raspberry … Read the…
We Didn’t Build the Atomic Bomb This Way
There’s no reason the United States should refrain from building its own frontier A.I. model.