Skip to main content

TypeScript Agent SDK

Benchmarked against: Anthropic — TypeScript Agent SDK Line: Line 1 (Claude Agentic) Package: @anthropic-ai/claude-agent-sdk

The TypeScript Agent SDK provides Claude Code as a library — programmatic access to Claude's agent capabilities including tool use, file operations, and conversation management.


Overview

FeatureDetail
LanguageTypeScript / Node.js
ProviderAnthropic (Claude Agent SDK)
LineLine 1 — Claude Agentic
ToolsFull MCP tool access via SDK
Use caseBuilding custom agent workflows, integrating Claude into applications

Installation

npm install @anthropic-ai/claude-agent-sdk

Basic usage

import { Agent } from '@anthropic-ai/claude-agent-sdk';

const agent = new Agent({
model: 'claude-sonnet-4-6',
tools: ['file_read', 'file_write', 'bash'],
});

const result = await agent.run('Search the codebase for TODO comments');
console.log(result.output);

SuperPortia integration

To use the TypeScript SDK within SuperPortia's ecosystem:

Connect to MCP servers

const agent = new Agent({
model: 'claude-sonnet-4-6',
mcpServers: {
'cloud-ub': { url: process.env.CLOUD_UB_URL },
'local-ubi': {
command: 'python',
args: ['-m', 'ub.mcp_server'],
},
},
});

Agent identity

// Set ship and agent identity for UB tagging
process.env.SP_SHIP_ID = 'SS1';
process.env.SP_AGENT_ID = 'Mac CLI 小A';

When to use TypeScript SDK

ScenarioTypeScript SDKClaude Code CLI
Build a custom agent appYesNo
Automate agent workflowsYesLimited
Interactive terminal workNoYes
Captain-directed tasksNoYes
CI/CD integrationYesLimited

Relationship to Line 1

The TypeScript SDK is a component of Line 1 (Claude Agentic). It provides:

  • Programmatic agent control (vs. interactive CLI)
  • Embeddable agent capabilities (vs. standalone process)
  • Custom workflow building (vs. ad-hoc conversation)

Line 1 designs blueprints using both Claude Code CLI and the TypeScript SDK.


PageRelationship
Agent SDK OverviewDual agentic lines
Python SDKLine 2 alternative
Agent SDK QuickstartGetting started