Skip to main content

Agent Session Insights

Create offline reports from coding-agent conversations: complete messages, evidence-linked analysis, per-model token and cost comparisons, and a zoomable timeline with local day/night shading. Supports Copilot CLI, Claude Code, Codex, Cursor exports, and Replit conversation exports.

See the example: HTML report, standalone player, or PDF.

Install

Use Python 3.12 or later. Install the package and its Chromium renderer in a virtual environment:

Windows PowerShell

python -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install agent-session-insights
python -m playwright install chromium

macOS/Linux

python3 -m venv .venv
source .venv/bin/activate
python -m pip install agent-session-insights
python -m playwright install chromium

On Linux, missing browser system libraries may require python -m playwright install --with-deps chromium and system-install privileges. Report commands check rendering dependencies before processing sessions or launching an agent.

The installed agent-session-insights command works from any directory. python -m agent_session_insights accepts the same arguments. For a source checkout, use python review.py after installing requirements.txt; see the maintainer guide. If Windows activation is unavailable, invoke the virtual environment's .\.venv\Scripts\python.exe with the module or checkout entry point directly.

Generate a report

agent-session-insights repo --repo C:\Source\my-project

This selects the newest matching session, freezes its logs, launches its native harness headlessly for reviewed annotations, then generates and verifies the report. The harness CLI must be on PATH and signed in; normal model charges apply. Only the selected evidence is reviewed. Use --noagent for measured accounting and replay without qualitative annotations or model calls.

Automatic discovery supports Copilot, Claude, and Codex. It matches recorded repository/working-directory metadata in the current user's native history stores, not project mentions in messages, and excludes native subagents. Missing or malformed metadata limits discovery; Cursor/Replit require explicit exports.

Native stores under your home are .copilot\session-state, .claude\projects, .codex\sessions, and .codex\archived_sessions. Home-directory overrides honor COPILOT_HOME, CLAUDE_CONFIG_DIR, and CODEX_HOME.

Select sessions

List the matching sessions before choosing:

agent-session-insights discover --repo C:\Source\my-project
agent-session-insights repo --repo C:\Source\my-project --session copilot:SESSION_ID

Repeat --session to combine selected IDs, or use --all for every match. For a combined report, the first selected session's harness reviews the evidence. --harness filters the histories searched; it does not choose a different reviewer for those histories.

Option Purpose
--repo PATH Required local repository directory.
--session ID Select an ID or harness:ID; repeat for multiple sessions.
--all Combine all matches; mutually exclusive with --session.
--harness NAME Search only copilot, claude, or codex.
--root PATH Override the native history directory; requires --harness.
--output PATH Override the report destination.
--noagent Skip the harness and qualitative annotations.
--timezone ZONE IANA report timezone; default America/Los_Angeles.
--pricing PATH Override the bundled, dated retail API pricing card.

For example, combine only Copilot sessions without launching an agent:

agent-session-insights repo --repo C:\Source\my-project --harness copilot --all --noagent

All commands have --help with command-specific examples.

Outputs and safety

The default destination is agent-session-reports\<repo-name> under your current working directory, not automatically inside the repository passed to --repo.

Successful report commands print the absolute paths of report.html, report.pdf, and player.html. Open the HTML files directly; no server is needed:

Start-Process .\agent-session-reports\my-project\report.html

On macOS, use open instead of Start-Process. Reports include supporting accounting, normalized events, coverage, verification, frozen pricing, and private source snapshots. Repository reports also save discovery.json and a reusable manifest.json, plus annotations.json when agent-reviewed.

Overwrite protection: existing reviews require Overwrite? [y/N]? confirmation; only y or yes proceeds. An empty answer or closed stdin cancels. Directories containing unrelated files or selected inputs are refused. Confirmed replacement removes the previous report before generation, so use a fresh --output directory when you need to retain it if generation fails.

Privacy: outputs contain conversation text and private raw snapshots. Credential and shared-session URL redaction is best effort; review files before sharing or publishing them. This repository ignores the default report directory; keep outputs out of version control yourself in other workspaces. POSIX outputs use directory mode 0700 and file mode 0600. Windows outputs inherit the parent directory's NTFS ACLs; Python's chmod does not set those ACLs.

Interpretation limits: retail API-equivalent estimates are not invoices. Frozen rates may be historical; unknown models or missing total usage are unpriced, not free. Missing cache counters can produce labeled estimates and ranges, not verified cache hits. Different workloads and cache use prevent per-model totals from being an efficiency benchmark. Timeline activity is not measured working time; day/night shading uses 06:00-18:00 daytime in the report timezone, not astronomical sunrise/sunset.

A missing or failed harness is an error, not a silent fallback to --noagent. Completion requires verified artifacts and intact snapshots, not merely a zero harness exit status.

Advanced workflows

Command Input Result
discover --repo PATH, or --harness NAME --root PATH JSON inventory; no report or agent.
repo --repo PATH Complete report with agent review unless opted out.
prepare --manifest FILE --output DIRECTORY Frozen evidence and measured analysis; no HTML/PDF/player or agent.
run --manifest FILE --output DIRECTORY Complete report using existing annotations if supplied; never launches an agent.

Regenerate without another review

Use a report's saved manifest to render its frozen sources, annotations, and pricing into a different, empty directory:

agent-session-insights run --manifest .\agent-session-reports\my-project\manifest.json --output .\rerendered

Keep the original directory intact: the manifest references files saved beside it. This avoids rereading changing live logs or repeating model interpretation.

Explicit exports and manifests

Create a JSON manifest for selected history files, including Cursor/Replit exports. Paths are relative to the manifest:

{
  "title": "Project review",
  "timezone": "America/Los_Angeles",
  "sources": [
    {"harness": "copilot", "path": "logs\\events.jsonl", "session": "session-id"},
    {"harness": "cursor", "path": "chat.md", "session": "export-id"}
  ]
}

Each source needs harness, path, and session. Supported harness identifiers are copilot, claude, codex, cursor, and replit. Optional source start and end values are inclusive, timezone-aware ISO timestamps. Optional annotations and pricing paths provide reviewed interpretation and a custom rate card. Without supplied annotations, run labels qualitative interpretation unavailable.

agent-session-insights run --manifest .\review.json --output .\imported-review

For manual annotation, use prepare, review its stable event IDs and measured evidence, then create a final manifest referencing the prepared snapshots and your annotations in the same source order. prepare marks interpretation pending even if its input manifest contains annotations. This staging is optional; repo handles it automatically.

See collection contracts for export formats and scoping, analysis rules for accounting limits, and the example rate card for the pricing schema. No report-time network access is needed for token pricing.

Interactive reviewer agent

For natural-language selection, use the bundled agent-session-insights agent in this repository's workspace and ask:

Make a report for C:\Source\my-project. I want to pick the sessions.

Unlike the CLI's automatic selection, the agent prompts for unresolved session choices and the output location. Its profile is .github/agents/agent-session-insights.agent.md; the collect, analyze, and publish skills are under .github/skills/. You can copy those definitions into another workspace. Installation does not register agents globally or change personal settings. See agent contracts for the annotation-only launcher and interactive workflows.

Rebuild the bundled example

Clone/download this repository, then run from its root:

agent-session-insights run --manifest .\examples\creation.json --output .\tmp\creation-review

The example uses a scoped, redacted export of the conversation that built this project, reviewed annotations, and frozen historical prices. Rebuilding it needs no agent or model call. Offline copies of the HTML report, player, and PDF are also checked in. Download the HTML files and open them locally; GitHub's file viewer does not run the player.

Development and publishing

See the maintainer guide for checkout setup, tests, example provenance, GitHub Pages deployment, and PyPI releases. DESIGN.md contains collection, accounting, privacy, and player contracts. The project is MIT licensed.

Metadata

Release files for agent-session-insights 0.1.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for agent-session-insights 0.1.6
File Size Uploaded Provenance Actions
agent_session_insights-0.1.6.tar.gz 79.2 kB With provenance Details for agent_session_insights-0.1.6.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for agent-session-insights 0.1.6
File Interpreter ABI Platform Actions
agent_session_insights-0.1.6-py3-none-any.whl Python 3 none any Details for agent_session_insights-0.1.6-py3-none-any.whl

Total release size: 172.1 kB

Release files / agent_session_insights-0.1.6.tar.gz

Download URL agent_session_insights-0.1.6.tar.gz
Size 79.2 kB
Tags Source
SHA-256 checksum
How to use checksums
90a9182263d366022a9bcd7ef2dee159716058a4546133a468affbb64596812e
BLAKE2b-256 checksum
How to use checksums
f2e2513e5bb2c10de5aa4777bbc9c30920692c2e60ab6eb08290c54d7ee258a8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 17, 2026.

Transparency log

Release files / agent_session_insights-0.1.6-py3-none-any.whl

Download URL agent_session_insights-0.1.6-py3-none-any.whl
Size 92.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
aca1144966e2a34aee45ed8401cc9032a0b4c84dd3b4253007fe99ebe8fd2278
BLAKE2b-256 checksum
How to use checksums
4b4c44764b851db66a61dfa263344e81f74a8ac8c579ca36f3410f06511cf903
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 17, 2026.

Transparency log

Security for agent-session-insights 0.1.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for agent_session_insights-0.1.6.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 17, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page