Metadata-Version: 2.4
Name: agent-sessions
Version: 0.1.0
Summary: Discover and inspect local AI coding agent sessions
Project-URL: Homepage, https://github.com/XIThing/agent-sessions
Project-URL: Repository, https://github.com/XIThing/agent-sessions
Project-URL: Issues, https://github.com/XIThing/agent-sessions/issues
Author-email: Lars de Ridder <lars@xithing.io>
License-Expression: MIT
License-File: LICENSE
Keywords: agent,ai,claude,codex,discovery,sessions
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development :: Libraries
Classifier: Typing :: Typed
Requires-Python: >=3.11
Requires-Dist: pydantic>=2.0
Provides-Extra: dev
Requires-Dist: black; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.24; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Description-Content-Type: text/markdown

# agent-sessions

Discover and inspect local AI coding agent sessions (Claude Code, Codex, Pi).

> Looking for a ready-made solution for supervising your agents? Check out [Tether](https://github.com/larsderidder/tether).

```python
from agent_sessions import discover_sessions, get_session_detail, RunnerType

# Find all recent sessions
sessions = discover_sessions()
for s in sessions:
    print(f"{s.runner_type.value}: {s.directory} ({s.message_count} messages)")

# Filter by agent type
claude_sessions = discover_sessions(runner_type=RunnerType.CLAUDE_CODE)

# Filter by project directory
project_sessions = discover_sessions(directory="/home/user/my-project")

# Load full message history
detail = get_session_detail(sessions[0].id, sessions[0].runner_type)
for msg in detail.messages:
    print(f"[{msg.role}] {msg.content[:80]}")
```

## What it discovers

| Agent | Session location | Format |
|-------|-----------------|--------|
| Claude Code | `~/.claude/projects/` | JSONL per session |
| Codex | `~/.codex/sessions/` | JSONL rollout files |
| Pi | `~/.pi/agent/sessions/` | JSONL per session |

Each provider also detects whether sessions are currently running by inspecting the process table.

## Install

```bash
pip install agent-sessions
```

## License

MIT
