ExMCP.ACP.Adapters.ClaudeSDK.SessionStore (ex_mcp v1.0.0-rc.0)
View SourcePure helpers for Claude Code's SDK session store.
Claude Code persists conversations as JSONL files under
CLAUDE_CONFIG_DIR/projects/<project-key>. The project key and metadata
extraction in this module intentionally follow the official Claude Agent SDK
helpers so the ACP adapter can expose session/list and session/delete
without shelling out to Node.
Summary
Functions
Resolves the Claude config directory from adapter options, environment, or
~/.claude.
Deletes a persisted Claude session by UUID.
Copies a persisted session transcript to a new Claude session UUID.
Returns ACP SessionInfo maps for Claude Code sessions.
Returns SDK-shaped metadata for sessions visible from the given options.
Returns the official SDK project key for a cwd.
Reads decoded JSONL transcript entries for a persisted session.
Types
Functions
Resolves the Claude config directory from adapter options, environment, or
~/.claude.
Deletes a persisted Claude session by UUID.
When :cwd or :dir is supplied, deletion is restricted to that project and
its worktrees. Without a cwd, all project directories under the configured
Claude store are searched.
Copies a persisted session transcript to a new Claude session UUID.
This implements ACP session/fork for the disk-backed SDK store. The copied
transcript is rewritten with the new session id where common Claude JSONL id
fields are present, while message UUIDs are preserved so clients can still
refer to replayed history.
Returns ACP SessionInfo maps for Claude Code sessions.
Returns SDK-shaped metadata for sessions visible from the given options.
Supported options:
:claude_config_dir- explicit Claude config directory:env- environment map or keyword list, checked forCLAUDE_CONFIG_DIR:cwd/:dir- restrict sessions to the matching project directory:include_worktrees- include Git worktrees for the requested cwd, defaulttrue:offset/:limit- optional in-memory pagination
Returns the official SDK project key for a cwd.
Reads decoded JSONL transcript entries for a persisted session.