Skip to content

Types

All TypeScript interfaces and type aliases exported by the package.

typescript
import type {
  ClientOptions,
  QueryOptions,
  QueryResult,
  StreamEvent,
  TokenUsage,
  Message,
  PermissionMode,
  EffortLevel,
  // Permission types
  CanUseTool,
  PermissionResult,
  PermissionUpdate,
  PermissionBehavior,
  PermissionRuleValue,
  PermissionUpdateDestination,
  // Thinking types
  ThinkingConfig,
  ThinkingAdaptive,
  ThinkingEnabled,
  ThinkingDisabled,
  // Hook types
  HookEvent,
  HookCallback,
  HookCallbackMatcher,
  HookInput,
  HookJSONOutput,
  // MCP types
  McpServerConfig,
  McpSdkServerConfig,
  // Config types
  SettingSource,
  PluginConfig,
  SpawnOptions,
  SpawnedProcess,
  OnElicitation,
  ElicitationRequest,
  // Info / result types
  AccountInfo,
  ModelInfo,
  SlashCommand,
  AgentInfo,
  McpServerStatus,
  McpSetServersResult,
  RewindFilesResult,
} from '@scottwalker/claude-connector'

ClientOptions

Configuration for the Claude client instance. Options set here act as defaults for all queries.

typescript
interface ClientOptions {
  useSdk?: boolean
  executable?: string
  cwd?: string
  model?: string
  effortLevel?: EffortLevel
  fallbackModel?: string
  permissionMode?: PermissionMode
  allowedTools?: readonly string[]
  disallowedTools?: readonly string[]
  tools?: readonly string[]
  systemPrompt?: string
  appendSystemPrompt?: string
  maxTurns?: number
  maxBudget?: number
  additionalDirs?: readonly string[]
  mcpConfig?: string | readonly string[]
  mcpServers?: Record<string, McpServerConfig | McpSdkServerConfig>
  agents?: Record<string, AgentConfig>
  agent?: string
  hooks?: HooksConfig
  hookCallbacks?: Partial<Record<HookEvent, readonly HookCallbackMatcher[]>>
  canUseTool?: CanUseTool
  thinking?: ThinkingConfig
  enableFileCheckpointing?: boolean
  onElicitation?: OnElicitation
  env?: Record<string, string>
  noSessionPersistence?: boolean
  name?: string
  strictMcpConfig?: boolean
  settingSources?: readonly SettingSource[]
  settings?: string | Record<string, unknown>
  plugins?: readonly PluginConfig[]
  spawnClaudeCodeProcess?: (options: SpawnOptions) => SpawnedProcess
  stderr?: (data: string) => void
  allowDangerouslySkipPermissions?: boolean
  betas?: readonly string[]
  agentProgressSummaries?: boolean
  includePartialMessages?: boolean
  promptSuggestions?: boolean
  debug?: boolean
  debugFile?: string
}
FieldTypeDefaultDescription
useSdkbooleantrueUse Agent SDK (persistent session) instead of CLI mode
executablestring'claude'Path to CLI binary
cwdstringprocess.cwd()Working directory
modelstring'sonnet'Model: 'opus', 'sonnet', 'haiku', or full ID
effortLevelEffortLevel--Thinking depth
fallbackModelstring--Auto-fallback model on failure
permissionModePermissionMode'default'Tool approval behavior
allowedToolsstring[]--Auto-approved tools (supports glob patterns)
disallowedToolsstring[]--Always-denied tools
toolsstring[]--Restrict available built-in tools (--tools)
systemPromptstring--Replace entire system prompt
appendSystemPromptstring--Append to default system prompt
maxTurnsnumber--Max agentic turns per query
maxBudgetnumber--Max spend in USD per query
additionalDirsstring[]--Extra working directories
mcpConfigstring | string[]--Path(s) to MCP config JSON files
mcpServersRecord<string, McpServerConfig | McpSdkServerConfig>--Inline MCP server definitions
agentsRecord<string, AgentConfig>--Custom subagent definitions
agentstring--Select preconfigured agent
hooksHooksConfig--Lifecycle hooks (shell commands, CLI mode)
hookCallbacksPartial<Record<HookEvent, HookCallbackMatcher[]>>--Lifecycle hook callbacks (JS functions, SDK mode)
canUseToolCanUseTool--Custom permission handler (SDK mode)
thinkingThinkingConfig--Thinking/reasoning behavior (SDK mode)
enableFileCheckpointingboolean--Track file changes for rewind (SDK mode)
onElicitationOnElicitation--MCP elicitation request handler (SDK mode)
envRecord<string, string>--Extra environment variables
noSessionPersistenceboolean--Don't save sessions to disk
namestring--Display name for the session
strictMcpConfigboolean--Ignore MCP servers not in mcpConfig
settingSourcesSettingSource[]--Which settings files to load (SDK mode)
settingsstring | Record<string, unknown>--Additional settings to apply (SDK mode)
pluginsPluginConfig[]--Plugins to load (SDK mode)
spawnClaudeCodeProcess(options: SpawnOptions) => SpawnedProcess--Custom process spawner for VMs/containers (SDK mode)
stderr(data: string) => void--Callback for stderr output (SDK mode)
allowDangerouslySkipPermissionsboolean--Required when using bypassPermissions (SDK mode)
betasstring[]--Enable beta features (SDK mode)
agentProgressSummariesboolean--AI-generated progress summaries for subagents (SDK mode)
includePartialMessagesboolean--Include streaming text deltas (SDK mode)
promptSuggestionsboolean--Enable prompt suggestions after each turn (SDK mode)
debugboolean--Enable debug logging (SDK mode)
debugFilestring--Write debug logs to file, implies debug: true (SDK mode)

tools vs allowedTools

tools limits which tools exist (are available to Claude). allowedTools controls which existing tools are auto-approved without prompting.

settingSources

When omitted in SDK mode, no settings files are loaded and CLAUDE.md files are not read. Include 'project' to load project instructions.

QueryOptions

Per-query overrides. Any field set here takes precedence over ClientOptions for the duration of a single query.

typescript
interface QueryOptions {
  cwd?: string
  model?: string
  effortLevel?: EffortLevel
  permissionMode?: PermissionMode
  allowedTools?: readonly string[]
  disallowedTools?: readonly string[]
  tools?: readonly string[]
  systemPrompt?: string
  appendSystemPrompt?: string
  maxTurns?: number
  maxBudget?: number
  input?: string
  schema?: Record<string, unknown>
  worktree?: boolean | string
  additionalDirs?: readonly string[]
  env?: Record<string, string>
  agent?: string
  signal?: AbortSignal
  thinking?: ThinkingConfig
}
FieldTypeDescription
cwdstringOverride working directory
modelstringOverride model
effortLevelEffortLevelOverride effort level
permissionModePermissionModeOverride permission mode
allowedToolsstring[]Override allowed tools
disallowedToolsstring[]Override disallowed tools
toolsstring[]Override available built-in tools
systemPromptstringOverride system prompt
appendSystemPromptstringOverride appended system prompt
maxTurnsnumberOverride max turns
maxBudgetnumberOverride max budget
inputstringPiped stdin data (like echo data | claude)
schemaobjectJSON Schema for structured output
worktreeboolean | stringRun in isolated git worktree (true for auto name)
additionalDirsstring[]Override additional directories
envRecord<string, string>Override environment variables
agentstringOverride agent for this query
signalAbortSignalAbort signal for cancelling this query
thinkingThinkingConfigOverride thinking config (SDK mode)

QueryResult

Returned from claude.query() and session.query().

typescript
interface QueryResult {
  readonly text: string
  readonly sessionId: string
  readonly usage: TokenUsage
  readonly cost: number | null
  readonly durationMs: number
  readonly messages: readonly Message[]
  readonly structured: unknown | null
  readonly raw: Record<string, unknown>
}
FieldTypeDescription
textstringText response from Claude
sessionIdstringSession ID for resuming
usageTokenUsageToken usage statistics
costnumber | nullCost in USD
durationMsnumberWall-clock duration in milliseconds
messagesMessage[]Full conversation history
structuredunknown | nullStructured output (when schema is used)
rawobjectRaw CLI JSON response (for advanced use)

StreamEvent

Discriminated union of all streaming event types. Check event.type to narrow.

typescript
type StreamEvent =
  | StreamTextEvent
  | StreamToolUseEvent
  | StreamResultEvent
  | StreamErrorEvent
  | StreamSystemEvent
  | StreamTaskStartedEvent
  | StreamTaskProgressEvent
  | StreamTaskNotificationEvent
TypeConstantKey Fields
StreamTextEventEVENT_TEXTtext: string
StreamToolUseEventEVENT_TOOL_USEtoolName: string, toolInput: object
StreamResultEventEVENT_RESULTtext, sessionId, usage, cost, durationMs
StreamErrorEventEVENT_ERRORmessage: string, code?: string
StreamSystemEventEVENT_SYSTEMsubtype: string, data: object
StreamTaskStartedEventEVENT_TASK_STARTEDtaskId, description, taskType?, prompt?
StreamTaskProgressEventEVENT_TASK_PROGRESStaskId, description, usage, summary?
StreamTaskNotificationEventEVENT_TASK_NOTIFICATIONtaskId, status, outputFile, summary

StreamTextEvent

typescript
interface StreamTextEvent {
  readonly type: 'text'
  readonly text: string // incremental text chunk
}

StreamToolUseEvent

typescript
interface StreamToolUseEvent {
  readonly type: 'tool_use'
  readonly toolName: string // e.g. 'Read', 'Bash'
  readonly toolInput: Record<string, unknown>
}

StreamResultEvent

typescript
interface StreamResultEvent {
  readonly type: 'result'
  readonly text: string
  readonly sessionId: string
  readonly usage: TokenUsage
  readonly cost: number | null
  readonly durationMs: number
}

StreamErrorEvent

typescript
interface StreamErrorEvent {
  readonly type: 'error'
  readonly message: string
  readonly code?: string
}

StreamSystemEvent

typescript
interface StreamSystemEvent {
  readonly type: 'system'
  readonly subtype: string
  readonly data: Record<string, unknown>
}

StreamTaskStartedEvent

typescript
interface StreamTaskStartedEvent {
  readonly type: 'task_started'
  readonly taskId: string
  readonly toolUseId?: string
  readonly description: string
  readonly taskType?: string
  readonly prompt?: string
}

StreamTaskProgressEvent

typescript
interface StreamTaskProgressEvent {
  readonly type: 'task_progress'
  readonly taskId: string
  readonly toolUseId?: string
  readonly description: string
  readonly usage: {
    totalTokens: number
    toolUses: number
    durationMs: number
  }
  readonly lastToolName?: string
  readonly summary?: string
}

StreamTaskNotificationEvent

typescript
interface StreamTaskNotificationEvent {
  readonly type: 'task_notification'
  readonly taskId: string
  readonly toolUseId?: string
  readonly status: 'completed' | 'failed' | 'stopped'
  readonly outputFile: string
  readonly summary: string
  readonly usage?: {
    totalTokens: number
    toolUses: number
    durationMs: number
  }
}

TokenUsage

typescript
interface TokenUsage {
  readonly inputTokens: number
  readonly outputTokens: number
}

Message

A single message in the conversation history.

typescript
interface Message {
  readonly role: 'user' | 'assistant'
  readonly content: string | readonly ContentBlock[]
}

ContentBlock

Discriminated union of content block types within a message.

typescript
type ContentBlock = TextBlock | ToolUseBlock | ToolResultBlock

TextBlock

typescript
interface TextBlock {
  readonly type: 'text'
  readonly text: string
}

ToolUseBlock

typescript
interface ToolUseBlock {
  readonly type: 'tool_use'
  readonly id: string
  readonly name: string
  readonly input: Record<string, unknown>
}

ToolResultBlock

typescript
interface ToolResultBlock {
  readonly type: 'tool_result'
  readonly tool_use_id: string
  readonly content: string
}

PermissionMode

typescript
type PermissionMode =
  | 'default'
  | 'acceptEdits'
  | 'plan'
  | 'dontAsk'
  | 'bypassPermissions'
  | 'auto'
ValueConstantDescription
'default'PERMISSION_DEFAULTPrompt on first use
'acceptEdits'PERMISSION_ACCEPT_EDITSAuto-accept file edits
'plan'PERMISSION_PLANRead-only, no modifications
'dontAsk'PERMISSION_DONT_ASKSkip permission prompts
'bypassPermissions'PERMISSION_BYPASSSkip all checks (dangerous)
'auto'PERMISSION_AUTOAutomatically approve tools

CanUseTool

Custom permission handler for controlling tool usage. Called before each tool execution in SDK mode.

typescript
type CanUseTool = (
  toolName: string,
  input: Record<string, unknown>,
  options: {
    signal: AbortSignal
    suggestions?: PermissionUpdate[]
    blockedPath?: string
    decisionReason?: string
    toolUseID: string
    agentID?: string
  },
) => Promise<PermissionResult>
typescript
const claude = new Claude({
  canUseTool: async (toolName, input, { signal }) => {
    if (toolName === 'Bash' && String(input.command).includes('rm -rf'))
      return { behavior: 'deny', message: 'Dangerous command blocked' }
    return { behavior: 'allow' }
  },
})

PermissionResult

Result returned from a CanUseTool handler.

typescript
type PermissionResult =
  | {
      behavior: 'allow'
      updatedInput?: Record<string, unknown>
      updatedPermissions?: PermissionUpdate[]
      toolUseID?: string
    }
  | {
      behavior: 'deny'
      message: string
      interrupt?: boolean
      toolUseID?: string
    }

PermissionBehavior

typescript
type PermissionBehavior = 'allow' | 'deny' | 'ask'

PermissionUpdate

Permission rule update, used to modify permissions at runtime.

typescript
type PermissionUpdate =
  | { type: 'addRules'; rules: PermissionRuleValue[]; behavior: PermissionBehavior; destination: PermissionUpdateDestination }
  | { type: 'replaceRules'; rules: PermissionRuleValue[]; behavior: PermissionBehavior; destination: PermissionUpdateDestination }
  | { type: 'removeRules'; rules: PermissionRuleValue[]; behavior: PermissionBehavior; destination: PermissionUpdateDestination }
  | { type: 'setMode'; mode: PermissionMode; destination: PermissionUpdateDestination }
  | { type: 'addDirectories'; directories: string[]; destination: PermissionUpdateDestination }
  | { type: 'removeDirectories'; directories: string[]; destination: PermissionUpdateDestination }

PermissionRuleValue

typescript
type PermissionRuleValue = {
  toolName: string
  ruleContent?: string
}

PermissionUpdateDestination

typescript
type PermissionUpdateDestination =
  | 'userSettings'
  | 'projectSettings'
  | 'localSettings'
  | 'session'
  | 'cliArg'

ThinkingConfig

Controls Claude's thinking/reasoning behavior. SDK mode only.

typescript
type ThinkingConfig = ThinkingAdaptive | ThinkingEnabled | ThinkingDisabled

ThinkingAdaptive

typescript
type ThinkingAdaptive = { type: 'adaptive' }

Claude decides when and how much to think.

ThinkingEnabled

typescript
type ThinkingEnabled = { type: 'enabled'; budgetTokens: number }

Fixed token budget for extended thinking.

ThinkingDisabled

typescript
type ThinkingDisabled = { type: 'disabled' }

No extended thinking.

EffortLevel

typescript
type EffortLevel = 'low' | 'medium' | 'high' | 'max'
ValueConstantDescription
'low'EFFORT_LOWQuick, minimal thinking
'medium'EFFORT_MEDIUMBalanced
'high'EFFORT_HIGHDeep analysis
'max'EFFORT_MAXMaximum depth

McpServerConfig

Configuration for an inline MCP server definition.

typescript
interface McpServerConfig {
  readonly type?: 'stdio' | 'http' | 'sse'
  readonly command?: string
  readonly args?: readonly string[]
  readonly url?: string
  readonly env?: Record<string, string>
  readonly headers?: Record<string, string>
}
FieldTypeDescription
type'stdio' | 'http' | 'sse'Transport type
commandstringCommand to start stdio server
argsstring[]Arguments for stdio server command
urlstringURL for http/sse server
envRecord<string, string>Environment variables for the server process
headersRecord<string, string>HTTP headers for http/sse servers
typescript
import { Claude } from '@scottwalker/claude-connector'

const claude = new Claude({
  mcpServers: {
    filesystem: {
      type: 'stdio',
      command: 'npx',
      args: ['-y', '@modelcontextprotocol/server-filesystem', '/tmp'],
    },
    remote: {
      type: 'sse',
      url: 'https://mcp.example.com/sse',
      headers: { Authorization: 'Bearer token' },
    },
  },
})

McpSdkServerConfig

In-process MCP server config for SDK mode. Created via createSdkMcpServer().

typescript
interface McpSdkServerConfig {
  readonly type: 'sdk'
  readonly name: string
  readonly instance: unknown // McpServer instance
}
FieldTypeDescription
type'sdk'Always 'sdk' for in-process servers
namestringServer name
instanceunknownMcpServer instance (opaque to avoid hard dependency)

AgentConfig

Configuration for a custom subagent.

typescript
interface AgentConfig {
  readonly description: string
  readonly prompt?: string
  readonly model?: string
  readonly tools?: readonly string[]
  readonly disallowedTools?: readonly string[]
  readonly permissionMode?: PermissionMode
  readonly maxTurns?: number
  readonly isolation?: 'worktree'
  readonly background?: boolean
}
FieldTypeDescription
descriptionstringWhen to delegate to this agent
promptstringInitial prompt / instructions
modelstringModel: 'opus', 'sonnet', 'haiku', 'inherit'
toolsstring[]Tools available to this agent
disallowedToolsstring[]Tools denied to this agent
permissionModePermissionModePermission mode for this agent
maxTurnsnumberMax agentic turns
isolation'worktree'Run in isolated git worktree
backgroundbooleanAlways run as background task
typescript
import { Claude, PERMISSION_PLAN } from '@scottwalker/claude-connector'

const claude = new Claude({
  agents: {
    reviewer: {
      description: 'Code review specialist',
      prompt: 'You are a senior code reviewer. Focus on security and performance.',
      model: 'opus',
      permissionMode: PERMISSION_PLAN,
    },
    fixer: {
      description: 'Bug fixer that works in isolation',
      model: 'sonnet',
      isolation: 'worktree',
      maxTurns: 10,
    },
  },
})

HookEvent

All 21 lifecycle hook event types supported by hookCallbacks.

typescript
type HookEvent =
  | 'PreToolUse'
  | 'PostToolUse'
  | 'PostToolUseFailure'
  | 'Notification'
  | 'UserPromptSubmit'
  | 'SessionStart'
  | 'SessionEnd'
  | 'Stop'
  | 'SubagentStart'
  | 'SubagentStop'
  | 'PreCompact'
  | 'PermissionRequest'
  | 'Setup'
  | 'TeammateIdle'
  | 'TaskCompleted'
  | 'Elicitation'
  | 'ElicitationResult'
  | 'ConfigChange'
  | 'WorktreeCreate'
  | 'WorktreeRemove'
  | 'InstructionsLoaded'

HookCallback

JS callback for hook events (SDK mode).

typescript
type HookCallback = (
  input: HookInput,
  toolUseID: string | undefined,
  options: { signal: AbortSignal },
) => Promise<HookJSONOutput>

HookCallbackMatcher

SDK-style hook callback matcher with JS callbacks.

typescript
interface HookCallbackMatcher {
  readonly matcher?: string
  readonly hooks: readonly HookCallback[]
  readonly timeout?: number
}
FieldTypeDescription
matcherstringRegex pattern to match tool names (optional)
hooksHookCallback[]Callback functions to execute
timeoutnumberTimeout in milliseconds
typescript
const claude = new Claude({
  hookCallbacks: {
    PreToolUse: [{
      matcher: 'Bash',
      hooks: [async (input) => ({ continue: true })],
    }],
  },
})

HookInput

Input passed to hook callbacks.

typescript
type HookInput = {
  session_id: string
  transcript_path: string
  cwd: string
  permission_mode?: string
  agent_id?: string
  agent_type?: string
  hook_event_name: string
  [key: string]: unknown
}

HookJSONOutput

Return value from hook callbacks. Can be synchronous or asynchronous.

typescript
type HookJSONOutput = SyncHookJSONOutput | AsyncHookJSONOutput

type SyncHookJSONOutput = {
  [key: string]: unknown
}

type AsyncHookJSONOutput = {
  async: true
  asyncTimeout?: number
}

HookEntry

A single hook command to execute at a lifecycle point (CLI mode).

typescript
interface HookEntry {
  readonly command: string
  readonly timeout?: number
}
FieldTypeDescription
commandstringShell command to execute
timeoutnumberTimeout in seconds

HookMatcher

Matches tool names to hook entries (CLI mode).

typescript
interface HookMatcher {
  readonly matcher: string
  readonly hooks: readonly HookEntry[]
}
FieldTypeDescription
matcherstringRegex pattern to match tool names
hooksHookEntry[]Hook entries to execute when matched

HooksConfig

Lifecycle hooks configuration (CLI mode, shell commands).

typescript
interface HooksConfig {
  readonly PreToolUse?: readonly HookMatcher[]
  readonly PostToolUse?: readonly HookMatcher[]
  readonly Stop?: readonly HookMatcher[]
  readonly [key: string]: readonly HookMatcher[] | undefined
}
HookWhen
PreToolUseBefore a tool is executed
PostToolUseAfter a tool completes
StopWhen Claude stops
typescript
const claude = new Claude({
  hooks: {
    PreToolUse: [
      {
        matcher: 'Bash',
        hooks: [{ command: 'echo "Running bash command"', timeout: 5 }],
      },
    ],
    PostToolUse: [
      {
        matcher: '.*',
        hooks: [{ command: 'echo "Tool finished"' }],
      },
    ],
  },
})

OnElicitation

Callback for handling MCP elicitation requests. SDK mode only.

typescript
type OnElicitation = (
  request: ElicitationRequest,
  options: { signal: AbortSignal },
) => Promise<{
  action: 'accept' | 'decline' | 'cancel'
  content?: Record<string, unknown>
}>

ElicitationRequest

MCP elicitation request payload.

typescript
interface ElicitationRequest {
  serverName: string
  message: string
  mode?: 'form' | 'url'
  url?: string
  elicitationId?: string
  requestedSchema?: Record<string, unknown>
}
FieldTypeDescription
serverNamestringName of the MCP server requesting input
messagestringMessage to display to the user
mode'form' | 'url'Elicitation mode
urlstringURL for URL-mode elicitation
elicitationIdstringUnique elicitation identifier
requestedSchemaRecord<string, unknown>JSON Schema for expected input

SettingSource

Controls which filesystem settings are loaded. SDK mode only.

typescript
type SettingSource = 'user' | 'project' | 'local'
ValueDescription
'user'Global settings (~/.claude/settings.json)
'project'Project settings (.claude/settings.json)
'local'Local settings (.claude/settings.local.json)
typescript
// Load project settings + CLAUDE.md
new Claude({ settingSources: ['user', 'project'] })

// Full isolation (default SDK behavior)
new Claude({ settingSources: [] })

PluginConfig

Plugin configuration. Plugins provide custom commands, agents, skills, and hooks. SDK mode only.

typescript
interface PluginConfig {
  readonly type: 'local'
  readonly path: string
}
FieldTypeDescription
type'local'Plugin type (currently only 'local')
pathstringAbsolute or relative path to the plugin directory
typescript
new Claude({
  plugins: [
    { type: 'local', path: './my-plugin' },
    { type: 'local', path: '/absolute/path/to/plugin' },
  ],
})

SpawnOptions

Options passed to a custom spawnClaudeCodeProcess function.

typescript
interface SpawnOptions {
  readonly command: string
  readonly args: readonly string[]
  readonly cwd: string
  readonly env: Record<string, string | undefined>
  readonly signal?: AbortSignal
}
FieldTypeDescription
commandstringCommand to execute
argsstring[]Arguments for the command
cwdstringWorking directory
envRecord<string, string | undefined>Environment variables
signalAbortSignalAbort signal

SpawnedProcess

Interface that a custom-spawned process must satisfy.

typescript
interface SpawnedProcess {
  readonly stdout: NodeJS.ReadableStream
  readonly stderr: NodeJS.ReadableStream
  readonly stdin: NodeJS.WritableStream
  readonly exitCode: Promise<number | null>
  kill(signal?: string): void
}
FieldTypeDescription
stdoutReadableStreamStandard output stream
stderrReadableStreamStandard error stream
stdinWritableStreamStandard input stream
exitCodePromise<number | null>Process exit promise
kill()(signal?: string) => voidKill the process
typescript
new Claude({
  spawnClaudeCodeProcess: (options) => {
    // options: { command, args, cwd, env, signal }
    return myDockerProcess // Must satisfy SpawnedProcess
  },
})

AccountInfo

Information about the logged-in user's account. Returned by claude.getAccountInfo().

typescript
interface AccountInfo {
  email?: string
  organization?: string
  subscriptionType?: string
  tokenSource?: string
  apiKeySource?: string
}

ModelInfo

Information about an available model. Returned by claude.listModels().

typescript
interface ModelInfo {
  value: string
  displayName: string
  description: string
  supportsEffort?: boolean
  supportedEffortLevels?: ('low' | 'medium' | 'high' | 'max')[]
  supportsAdaptiveThinking?: boolean
  supportsFastMode?: boolean
  supportsAutoMode?: boolean
}

SlashCommand

Available slash command. Returned by claude.listSlashCommands().

typescript
interface SlashCommand {
  [key: string]: unknown
}

AgentInfo

Information about an available subagent. Returned by claude.listAgents().

typescript
interface AgentInfo {
  name: string
  description: string
  model?: string
}

McpServerStatus

Status of an MCP server connection. Returned by claude.getMcpServers().

typescript
interface McpServerStatus {
  name: string
  status: 'connected' | 'failed' | 'needs-auth' | 'pending' | 'disabled'
  serverInfo?: { name: string; version: string }
  error?: string
  config?: Record<string, unknown>
  scope?: string
  tools?: Array<{
    name: string
    description?: string
    annotations?: {
      readOnly?: boolean
      destructive?: boolean
      openWorld?: boolean
    }
  }>
}

McpSetServersResult

Result of a claude.setMcpServers() operation.

typescript
interface McpSetServersResult {
  added: string[]
  removed: string[]
  errors: Record<string, string>
}

RewindFilesResult

Result of a claude.rewindFiles() operation.

typescript
interface RewindFilesResult {
  canRewind: boolean
  error?: string
  filesChanged?: string[]
  insertions?: number
  deletions?: number
}

SessionInfo

Metadata about a stored session (returned by session listing APIs).

typescript
interface SessionInfo {
  readonly sessionId: string
  readonly name?: string
  readonly summary?: string
  readonly lastActive: string
  readonly cwd: string
}
FieldTypeDescription
sessionIdstringUnique session identifier
namestringHuman-readable session name (if renamed)
summarystringBrief summary of the session
lastActivestringISO 8601 timestamp of last activity
cwdstringWorking directory associated with the session

Released under the MIT License.