Agent session intelligence CLI. Parses AI agent transcripts, detects behavioral anti-patterns, grades sessions, and generates remediations.
pip install -e . # install from source
pytest tests/ -v # run tests (~400)
ruff check sesh/ tests/ # lintsesh/— main packagecli.py— CLI entry point, argparse subcommandsanalyze.py— one-command analysis pipeline (no DB)db.py— SQLite + FTS5 session storageconfig.py— configuration loading from.sesh/config.jsonwatch.py— filesystem polling for auto-ingestdebug.py— thinking block extraction and searchreplay.py— step-by-step timeline reconstructionmcp_server.py— MCP server for agent-native accessparsers/— transcript parsers (Claude Code, OpenAI Codex)analyzers/— pattern detection, grading, trends, remediationaudit/— repo legibility scoring (9 metrics, 0-100)formatters/— output formatting (report, handoff, JSON)web/— browser dashboard server
tests/— pytest test suiteeval/— evaluation harnesses for testing remediation effectivenessdocs/— landing page and documentation
- Zero required dependencies. The stdlib is the dependency.
- All new features need tests. Run
pytest tests/ -vbefore committing. - Use
rufffor linting. Runruff check sesh/before committing. - CLI subcommands live in
sesh/commands/— dispatch is incli.py. - Pattern detectors register via
register_pattern()inanalyzers/patterns.py. - Audit metric detectors register via
register_metric()inaudit/engine.py. - Every command supports
--jsonfor machine-readable output.
| Command | What it does | Needs DB? |
|---|---|---|
sesh analyze <file> |
One-shot session diagnostic | No |
sesh audit [path] |
Repo legibility score | No |
sesh reflect |
Analyze most recent session | Yes |
sesh replay |
Step-by-step playback | Yes |
sesh debug |
Search agent thinking blocks | Yes |
sesh fix |
Generate CLAUDE.md remediation patch | Yes |
sesh watch |
Auto-ingest new sessions | Yes |