Skip to content

ClaudeCodeSessionOptions

Base classes

Name Children Inherits
dict
builtins
dict() -> new empty dictionary

⋔ Inheritance diagram

graph TD
  95970871878736["field_meta.ClaudeCodeSessionOptions"]
  125067848556736["builtins.dict"]
  125067848591872["builtins.object"]
  125067848556736 --> 95970871878736
  125067848591872 --> 125067848556736

🛈 DocStrings

Bases: TypedDict

Claude Agent SDK Options forwarded via _meta.claudeCode.options.

Only JSON-serializable options are listed; options that take callbacks (hooks, canUseTool, abortController, stderr, …) cannot be sent over ACP. Any other key is forwarded to the SDK as is. Types follow @anthropic-ai/claude-agent-sdk 0.3.326, the version claude-agent-acp v0.108.1 uses.

The adapter ignores cwd, includePartialMessages, permissionMode, executable, pathToClaudeCodeExecutable and sessionId, and merges env, extraArgs, mcpServers and disallowedTools with its own values.

Source code in src/aclientp/schema/field_meta.py
class ClaudeCodeSessionOptions(TypedDict, total=False):
    """Claude Agent SDK ``Options`` forwarded via ``_meta.claudeCode.options``.

    Only JSON-serializable options are listed; options that take callbacks
    (``hooks``, ``canUseTool``, ``abortController``, ``stderr``, …) cannot be sent
    over ACP. Any other key is forwarded to the SDK as is. Types follow
    ``@anthropic-ai/claude-agent-sdk`` 0.3.326, the version claude-agent-acp
    v0.108.1 uses.

    The adapter **ignores** ``cwd``, ``includePartialMessages``, ``permissionMode``,
    ``executable``, ``pathToClaudeCodeExecutable`` and ``sessionId``, and
    **merges** ``env``, ``extraArgs``, ``mcpServers`` and ``disallowedTools`` with
    its own values.
    """

    resume: str
    """Session id of a previous Claude Code conversation to resume (``session/new``)."""

    model: str
    """Model to use."""

    fallbackModel: str
    """Model to use when the primary one is unavailable."""

    effort: Literal["low", "medium", "high", "xhigh", "max"] | int
    """Reasoning effort."""

    maxTurns: int
    """Maximum number of agentic turns."""

    maxBudgetUsd: float
    """Spending limit in USD."""

    maxThinkingTokens: int
    """Thinking token budget."""

    tools: list[str] | dict[str, str]
    """Built-in tools to expose: tool names, or ``{"type": "preset", "preset":
    "claude_code"}`` (the default). ``[]`` disables all built-in tools."""

    allowedTools: list[str]
    """Tools allowed without a permission prompt."""

    disallowedTools: list[str]
    """Tools to remove; merged with the adapter's own list."""

    additionalDirectories: list[str]
    """Extra directories Claude Code may access. Prefer the standard
    ``additionalDirectories`` field of the request."""

    mcpServers: dict[str, dict[str, Any]]
    """MCP server configs by name; merged with the request's ``mcpServers``."""

    env: dict[str, str]
    """Environment variables for the Claude Code process; merged."""

    extraArgs: dict[str, str | None]
    """Extra CLI flags (``None`` for flags without a value); merged."""

    allowDangerouslySkipPermissions: bool
    """``False`` removes ``bypassPermissions`` from the session (repeat it on
    ``session/load``). ``True`` cannot override the adapter's own restrictions."""

    forwardSubagentText: bool
    """Stream text produced by subagents to the client."""

    settingSources: list[Literal["user", "project", "local"]]
    """Which settings files Claude Code loads (adapter default: all three)."""

    promptSuggestions: bool
    """Predict the next prompt after each turn (adapter default: ``True``)."""

    strictMcpConfig: bool
    """Only use the given MCP servers, ignoring configured ones."""

additionalDirectories instance-attribute

additionalDirectories: list[str]

Extra directories Claude Code may access. Prefer the standard additionalDirectories field of the request.

allowDangerouslySkipPermissions instance-attribute

allowDangerouslySkipPermissions: bool

False removes bypassPermissions from the session (repeat it on session/load). True cannot override the adapter's own restrictions.

allowedTools instance-attribute

allowedTools: list[str]

Tools allowed without a permission prompt.

disallowedTools instance-attribute

disallowedTools: list[str]

Tools to remove; merged with the adapter's own list.

effort instance-attribute

effort: Literal['low', 'medium', 'high', 'xhigh', 'max'] | int

Reasoning effort.

env instance-attribute

env: dict[str, str]

Environment variables for the Claude Code process; merged.

extraArgs instance-attribute

extraArgs: dict[str, str | None]

Extra CLI flags (None for flags without a value); merged.

fallbackModel instance-attribute

fallbackModel: str

Model to use when the primary one is unavailable.

forwardSubagentText instance-attribute

forwardSubagentText: bool

Stream text produced by subagents to the client.

maxBudgetUsd instance-attribute

maxBudgetUsd: float

Spending limit in USD.

maxThinkingTokens instance-attribute

maxThinkingTokens: int

Thinking token budget.

maxTurns instance-attribute

maxTurns: int

Maximum number of agentic turns.

mcpServers instance-attribute

mcpServers: dict[str, dict[str, Any]]

MCP server configs by name; merged with the request's mcpServers.

model instance-attribute

model: str

Model to use.

promptSuggestions instance-attribute

promptSuggestions: bool

Predict the next prompt after each turn (adapter default: True).

resume instance-attribute

resume: str

Session id of a previous Claude Code conversation to resume (session/new).

settingSources instance-attribute

settingSources: list[Literal['user', 'project', 'local']]

Which settings files Claude Code loads (adapter default: all three).

strictMcpConfig instance-attribute

strictMcpConfig: bool

Only use the given MCP servers, ignoring configured ones.

tools instance-attribute

tools: list[str] | dict[str, str]

Built-in tools to expose: tool names, or {"type": "preset", "preset": "claude_code"} (the default). [] disables all built-in tools.

:fa-brands-github: Show source on GitHub