Skip to main content

Module claude_adapter

Module claude_adapter 

Source
Expand description

Claude Code history adapter. Scans for session JSONL files across both the user’s global Claude homes and the AgentMux-isolated homes that current agents actually write to:

  • ~/.claude/projects/ and ~/.config/claude-*/projects/ (global / legacy)
  • <AGENTMUX_SHARED_DIR>/providers/claude/projects/ (default isolated home)
  • <AGENTMUX_SHARED_DIR>/identities/<account_id>/claude/projects/ (per account, global)
  • /channels//identities//claude/projects/ and /dev//(/)?identities/*/claude/projects/ (per-channel isolated — Step 4 of docs/specs/SPEC_AGENT_IDENTITY_HISTORY_PERSISTENCE_PROTOCOL_2026_08_16.md. Step 3 links these forward to the global location, but history written before that fix landed, or for an account whose link creation failed (best-effort, can fail), still has real data only under these per-channel paths — scanned here so it stays discoverable rather than requiring a manual filesystem search.)

Structs§

ClaudeHistoryAdapter
Where Claude homes live. The homes under them — one per account, and channels — are listed again on every discovery (ClaudeHistoryAdapter::base_dirs), because they are created while srv runs: an account added or switched after srv started used to stay invisible until the next restart.

Functions§

message_from_entry 🔒
One conversation message from a Claude record — a transcript line or a line of the stream-json output AgentMux keeps (agent:<id>:current); the two share the message shape. None for anything that isn’t a user or assistant message with something in it (a tool-result frame, thinking only).
metadata_or_note 🔒
note_unreadable 🔒
Record a directory or file discovery couldn’t read. A path that no longer exists isn’t one: it was deleted (or never created), so nothing in it was missed.
read_dir_or_note 🔒