Agentic AI Atlasby a5c.ai
OverviewWikiGraphFor AgentsEdgesSearchWorkspace
/
GitHubDocsDiscord
i.4Wiki
Agentic AI Atlas · Sessions
docs/agent-mux/tutorials/sessionsa5c.ai
Search the atlas/
Wiki · linked records

Article and nearby pages

I.Current articlepp. 1 - 1
Cost trackingDocker Invocation ModeGetting StartedHooksKubernetes Invocation ModeMock Harness
I.
Wiki article

docs/agent-mux/tutorials/sessions

Reading · 2 min

Sessions reference

Agent-mux persists every run as a session: a JSONL file written by the

Page nodewiki/docs/agent-mux/tutorials/sessions.mdNearby pages · 9Documents · 0

Continue reading

Nearby pages in the same section.

Cost trackingDocker Invocation ModeGetting StartedHooksKubernetes Invocation ModeMock HarnessMulti-Agent DispatchPlugins (MCP)Remote bootstrap

Sessions

Agent-mux persists every run as a **session**: a JSONL file written by the underlying CLI (Claude, Codex, Gemini, …) that you can list, resume, inspect, and export through the SDK or amux CLI.

Listing sessions

ts
import { AgentMuxClient } from '@a5c-ai/agent-mux';

const client = new AgentMuxClient();
const sessions = await client.listSessions({ agent: 'claude' });
for (const s of sessions) {
  console.log(s.sessionId, s.title ?? '(no title)', s.modifiedAt);
}

From the CLI:

bash
amux sessions list --agent claude
amux sessions list --agent codex --limit 20

Resuming a session

Pass sessionId to run(). The adapter rehydrates the conversation on disk and the CLI picks up where it left off:

ts
await client.run({
  agent: 'claude',
  sessionId: 'abc123',
  prompt: 'Continue from where we stopped.',
});
bash
amux run claude --session-id abc123 "Continue from where we stopped."

Reading session contents

Each adapter exposes parseSessionFile() which returns a normalized Session object (messages, tool calls, cost totals). This is useful for building dashboards or replaying a run:

ts
const adapter = client.registry.get('claude');
const paths = await adapter.listSessionFiles();
const parsed = await adapter.parseSessionFile(paths[0]);

console.log(parsed.messages.length, 'messages');
console.log(parsed.totalCost?.totalUsd ?? 0, 'USD');

Where sessions live

AgentDefault path
claude~/.claude/projects/
codex~/.codex/sessions/
cursor~/.cursor/sessions/
gemini~/.gemini/sessions/
opencode~/.config/opencode/sessions/

Override by setting the adapter's sessionDir(cwd?) — or pass cwd on the run and adapters that key on cwd will scope their sessions accordingly.

Watching sessions

Live session watching is not currently exposed on SessionManager.

Earlier tutorial drafts mentioned watchSessions(), but no truthful cross-adapter contract is available yet. Use list(), get(), search(), export(), and diff() for read-only session inspection.

Trail

Wiki
Babysitter Docs
agent-mux docs
Agent Mux Tutorials

Sessions

Continue reading

Cost tracking
Docker Invocation Mode
Getting Started
Hooks
Kubernetes Invocation Mode
Mock Harness
Multi-Agent Dispatch
Plugins (MCP)

Page record

Open node ledger

wiki/docs/agent-mux/tutorials/sessions.md

Documents

No documented graph nodes on this page.