{"slug": "agent-session-insights", "title": "Agent Session Insights", "summary": "Mark Russinovich released Agent Session Insights, a Python 3.12+ package that generates offline HTML and PDF reports from coding-agent conversations, including complete messages, evidence-linked analysis, per-model token and cost comparisons, and a zoomable timeline with local day/night shading. The tool supports Copilot CLI, Claude Code, Codex, Cursor exports, and Replit conversation exports, and its `repo` command selects the newest matching session, freezes its logs, launches the native harness headlessly for reviewed annotations, then generates and verifies the report; `--noagent` skips model calls for measured accounting and replay only.", "body_md": "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.\n\n**See the example:** [HTML report](https://markrussinovich.github.io/agent-session-insights/),\n[standalone player](https://markrussinovich.github.io/agent-session-insights/player.html),\nor [PDF](https://markrussinovich.github.io/agent-session-insights/report.pdf).\n\nUse Python 3.12 or later. Install the package and its Chromium renderer in a virtual environment:\n\n**Windows PowerShell**\n\n```\npython -m venv .venv\n.\\.venv\\Scripts\\Activate.ps1\npython -m pip install agent-session-insights\npython -m playwright install chromium\n```\n\n**macOS/Linux**\n\n```\npython3 -m venv .venv\nsource .venv/bin/activate\npython -m pip install agent-session-insights\npython -m playwright install chromium\n```\n\nOn Linux, missing browser system libraries may require\n`python -m playwright install --with-deps chromium` and system-install privileges.\nReport commands check rendering dependencies before processing sessions or\nlaunching an agent.\n\nThe installed `agent-session-insights` command works from any directory.\n`python -m agent_session_insights` accepts the same arguments. For a source\ncheckout, use `python review.py` after installing `requirements.txt`; see the\n[maintainer guide](https://github.com/markrussinovich/agent-session-insights/blob/main/MAINTAINING.md#development-setup).\nIf Windows activation is unavailable, invoke the virtual environment's\n`.\\.venv\\Scripts\\python.exe` with the module or checkout entry point directly.\n\n```\nagent-session-insights repo --repo C:\\Source\\my-project\n```\n\nThis selects the **newest matching session**, freezes its logs, launches its\nnative harness headlessly for reviewed annotations, then generates and verifies\nthe report. The harness CLI must be on `PATH` and signed in; normal model charges\napply. Only the selected evidence is reviewed. Use `--noagent` for measured\naccounting and replay without qualitative annotations or model calls.\n\nAutomatic discovery supports Copilot, Claude, and Codex. It matches recorded\nrepository/working-directory metadata in the current user's native history\nstores, not project mentions in messages, and excludes native subagents.\nMissing or malformed metadata limits discovery; Cursor/Replit require\n[explicit exports](#explicit-exports-and-manifests).\n\nNative stores under your home are `.copilot\\session-state`, `.claude\\projects`,\n`.codex\\sessions`, and `.codex\\archived_sessions`. Home-directory overrides honor\n`COPILOT_HOME`, `CLAUDE_CONFIG_DIR`, and `CODEX_HOME`.\n\nList the matching sessions before choosing:\n\n```\nagent-session-insights discover --repo C:\\Source\\my-project\nagent-session-insights repo --repo C:\\Source\\my-project --session copilot:SESSION_ID\n```\n\nRepeat `--session` to combine selected IDs, or use `--all` for every match.\nFor a combined report, the first selected session's harness reviews the evidence.\n`--harness` filters the histories searched; it does not choose a different\nreviewer for those histories.\n\n| Option | Purpose | \n|---|---|\n| `--repo PATH` | Required local repository directory. | \n| `--session ID` | Select an ID or `harness:ID` ; repeat for multiple sessions. | \n| `--all` | Combine all matches; mutually exclusive with `--session` . | \n| `--harness NAME` | Search only `copilot` ,`claude` , or`codex` . | \n| `--root PATH` | Override the native history directory; requires `--harness` . | \n| `--output PATH` | Override the report destination. | \n| `--noagent` | Skip the harness and qualitative annotations. | \n| `--logs-only` | Save selected raw logs as `session-logs.zip` in the output directory; no analysis, agent, or report. | \n| `--timezone ZONE` | IANA report timezone; default `America/Los_Angeles` . | \n| `--pricing PATH` | Override the bundled, dated retail API pricing card. | \n\nFor example, combine only Copilot sessions without launching an agent:\n\n```\nagent-session-insights repo --repo C:\\Source\\my-project --harness copilot --all --noagent\n```\n\nAll commands have `--help` with command-specific examples.\n\n```\nagent-session-insights repo --repo C:\\Source\\my-project --all --logs-only --output .\\collected-logs\n```\n\nThis writes `.\\collected-logs\\session-logs.zip` without running analysis, calling\na model, or requiring Chromium/Playwright. The same selection rules apply:\nnewest matching session by default, repeated `--session` for specific sessions,\nor `--all` for every match; `--harness` and `--root` also work.\nOmit `--output` to use the normal default destination directory.\n\nThe ZIP contains byte-for-byte copies of the selected history files under\n`logs`, a `manifest.json` with source hashes, and `discovery.json`. It does not\ninclude auxiliary session files or subagent histories. Extract it and use\n`run --manifest` with the extracted manifest to generate a report later.\nReport-only `--pricing`, `--timezone`, and `--noagent` do not trigger analysis;\nthe timezone is saved in the manifest for later use.\n\nExisting destination files are left untouched, and an existing\n`session-logs.zip` is refused; choose another output directory or move the\nprevious ZIP. **Raw logs are not redacted** and may contain credentials,\nprivate conversation text, and local paths. Review before sharing.\n\nThe default destination is **`agent-session-reports\\<repo-name>` under your\ncurrent working directory**, not automatically inside the repository passed to\n`--repo`.\n\nSuccessful report commands print the absolute paths of `report.html`,\n`report.pdf`, and `player.html`. Open the HTML files directly; no server is needed:\n\n```\nStart-Process .\\agent-session-reports\\my-project\\report.html\n```\n\nOn macOS, use `open` instead of `Start-Process`. Reports include supporting\naccounting, normalized events, coverage, verification, frozen pricing, and\nprivate source snapshots. Repository reports also save `discovery.json` and a\nreusable `manifest.json`, plus `annotations.json` when agent-reviewed.\n\nReports and players share bold blue typography, white light-mode surfaces, and\na navy dark mode. They follow your system theme; embedded replay and log panes\nfollow the surrounding report. Append `?scoutTheme=light` or `?scoutTheme=dark`\nto a report or standalone player URL to override the system preference.\n\n**Overwrite protection:** existing reviews require `Overwrite? [y/N]?`\nconfirmation; only `y` or `yes` proceeds. An empty answer or closed stdin cancels.\nDirectories containing unrelated files or selected inputs are refused.\nConfirmed replacement removes the previous report before generation, so use a\nfresh `--output` directory when you need to retain it if generation fails.\n\n**Privacy:** outputs contain conversation text and private raw snapshots.\nCredential and shared-session URL redaction is best effort; review files before\nsharing or publishing them. This repository ignores the default report directory;\nkeep outputs out of version control yourself in other workspaces. POSIX outputs\nuse directory mode 0700 and file mode 0600. Windows outputs inherit the parent\ndirectory's NTFS ACLs; Python's `chmod` does not set those ACLs.\n\n**Interpretation limits:** retail API-equivalent estimates are not invoices.\nFrozen rates may be historical; unknown models or missing total usage are\nunpriced, not free. Missing cache counters can produce labeled estimates and\nranges, not verified cache hits. Different workloads and cache use prevent\nper-model totals from being an efficiency benchmark. Timeline activity is not\nmeasured working time; day/night shading uses 06:00-18:00 daytime in the report\ntimezone, not astronomical sunrise/sunset.\n\nA missing or failed harness is an error, not a silent fallback to `--noagent`.\nCompletion requires verified artifacts and intact snapshots, not merely a zero\nharness exit status.\n\n| Command | Input | Result | \n|---|---|---|\n| `discover` | `--repo PATH` , or`--harness NAME --root PATH` | JSON inventory; no report or agent. | \n| `repo` | `--repo PATH` | Complete report with agent review unless opted out. | \n| `prepare` | `--manifest FILE --output DIRECTORY` | Frozen evidence and measured analysis; no HTML/PDF/player or agent. | \n| `run` | `--manifest FILE --output DIRECTORY` | Complete report using existing annotations if supplied; never launches an agent. | \n\nUse a report's saved manifest to render its frozen sources, annotations, and pricing into a different, empty directory:\n\n```\nagent-session-insights run --manifest .\\agent-session-reports\\my-project\\manifest.json --output .\\rerendered\n```\n\nKeep the original directory intact: the manifest references files saved beside it. This avoids rereading changing live logs or repeating model interpretation.\n\nCreate a JSON manifest for selected history files, including Cursor/Replit exports. Paths are relative to the manifest:\n\n```\n{\n  \"title\": \"Project review\",\n  \"timezone\": \"America/Los_Angeles\",\n  \"sources\": [\n    {\"harness\": \"copilot\", \"path\": \"logs\\\\events.jsonl\", \"session\": \"session-id\"},\n    {\"harness\": \"cursor\", \"path\": \"chat.md\", \"session\": \"export-id\"}\n  ]\n}\n```\n\nEach source needs `harness`, `path`, and `session`. Supported harness identifiers\nare `copilot`, `claude`, `codex`, `cursor`, and `replit`. Optional source `start`\nand `end` values are inclusive, timezone-aware ISO timestamps. Optional\n`annotations` and `pricing` paths provide reviewed interpretation and a custom\nrate card. Without supplied annotations, `run` labels qualitative interpretation\nunavailable.\n\n```\nagent-session-insights run --manifest .\\review.json --output .\\imported-review\n```\n\nFor manual annotation, use `prepare`, review its stable event IDs and measured\nevidence, then create a final manifest referencing the prepared snapshots and\nyour annotations in the same source order. `prepare` marks interpretation\npending even if its input manifest contains annotations. This staging is\noptional; `repo` handles it automatically.\n\nSee [collection contracts](https://github.com/markrussinovich/agent-session-insights/blob/main/DESIGN.md#collection-contracts) for export formats\nand scoping, [analysis rules](https://github.com/markrussinovich/agent-session-insights/blob/main/DESIGN.md#analysis-and-qualitative-review) for\naccounting limits, and the [example rate card](https://github.com/markrussinovich/agent-session-insights/blob/main/examples/pricing-rates.json) for\nthe pricing schema. No report-time network access is needed for token pricing.\n\nFor natural-language selection, use the bundled **agent-session-insights** agent\nin this repository's workspace and ask:\n\nMake a report for `C:\\Source\\my-project`. I want to pick the sessions.\n\nUnlike the CLI's automatic selection, the agent prompts for unresolved session\nchoices and the output location. Its profile is\n`.github/agents/agent-session-insights.agent.md`; the collect, analyze, and publish\nskills are under `.github/skills/`. You can copy those definitions into another\nworkspace. Installation does not register agents globally or change personal\nsettings. See [agent contracts](https://github.com/markrussinovich/agent-session-insights/blob/main/DESIGN.md#agent-contract-and-stages) for the\nannotation-only launcher and interactive workflows.\n\nClone/download this repository, then run from its root:\n\n```\nagent-session-insights run --manifest .\\examples\\creation.json --output .\\tmp\\creation-review\n```\n\nThe example uses a scoped, redacted export of the conversation that built this\nproject, reviewed annotations, and frozen historical prices. Rebuilding it needs\nno agent or model call. Offline copies of the\n[HTML report](https://github.com/markrussinovich/agent-session-insights/blob/main/examples/creation/report.html),\n[player](https://github.com/markrussinovich/agent-session-insights/blob/main/examples/creation/player.html), and\n[PDF](https://github.com/markrussinovich/agent-session-insights/blob/main/examples/creation/report.pdf) are also checked in. Download the HTML files\nand open them locally; GitHub's file viewer does not run the player.\n\nSee the [maintainer guide](https://github.com/markrussinovich/agent-session-insights/blob/main/MAINTAINING.md)\nfor checkout setup, tests, example provenance, GitHub Pages deployment, and PyPI\nreleases. [DESIGN.md](https://github.com/markrussinovich/agent-session-insights/blob/main/DESIGN.md) contains collection, accounting, privacy, and\nplayer contracts. The project is [MIT licensed](https://github.com/markrussinovich/agent-session-insights/blob/main/LICENSE).", "url": "https://wpnews.pro/news/agent-session-insights", "canonical_source": "https://github.com/markrussinovich/agent-session-insights", "published_at": "2026-11-22 23:27:31+00:00", "updated_at": "2026-11-22 23:44:29.638599+00:00", "lang": "en", "topics": ["ai-agents", "ai-tools", "developer-tools"], "entities": ["Mark Russinovich", "Agent Session Insights", "GitHub Copilot CLI", "Claude Code", "Codex", "Cursor", "Replit", "Playwright"], "also_reported_by": [], "takeaway": "Agent Session Insights turns native Copilot, Claude and Codex session logs into offline HTML/PDF reports with per-model token and cost comparisons, and its --noagent flag produces measured accounting and replay without any model calls or charges.", "recommendation": null, "alternates": {"html": "https://wpnews.pro/news/agent-session-insights", "markdown": "https://wpnews.pro/news/agent-session-insights.md", "text": "https://wpnews.pro/news/agent-session-insights.txt", "jsonld": "https://wpnews.pro/news/agent-session-insights.jsonld"}}