A local web app for exploring Copilot chat audit sessions stored in a Git repository.
This project is the viewer dashboard for https://github.com/alxayo/copilot-flight-recorder.
copilot-flight-recorder provides a full audit trail for GitHub Copilot agent sessions. Every prompt, response, and file change is captured and committed linearly to a configurable external Git repository, giving you a complete record you can review, search, or use to reproduce sessions exactly as they happened.
It provides:
- A session dashboard with search
- Session-level timelines (prompts, patches, transcript)
- Cross-reference views that connect audit changes to source files/commits
- Audit + source repository browsing from one UI
The project is built with a React + Vite frontend and an Express + TypeScript backend.
The screenshots below show a few of the main views in the application.
When Copilot hooks write session artifacts (for example NNN-prompt.md, NNN-changes.patch, and transcript.json) into an audit repository, it can be hard to inspect those artifacts manually at scale.
This app turns that raw audit data into a navigable interface so you can:
- Review what was asked and changed in each session
- Inspect patch details quickly
- Search across sessions
- Trace audit changes back to a source repository
- Frontend: React 19, TypeScript, Vite, React Router, Tailwind CSS
- Backend: Express 4, TypeScript (
tsxruntime) - Git data access:
isomorphic-git - Rendering helpers:
react-markdown,diff2html
High-level flow:
- Backend reads the configured audit/source repositories.
- Backend exposes data through
/api/*endpoints. - Frontend fetches from
/api/*(proxied by Vite in development). - UI renders dashboards, timelines, diffs, and cross-reference views.
AgentAudit/
server/ # Express API and git-backed services
index.ts
routes/
services/
src/ # React app
components/
pages/
lib/
spec/ # Design and planning docs
.github/hooks/ # Copilot audit hook scripts/config
package.json
vite.config.ts
- Node.js 20+ recommended
- npm 10+ recommended
- Two local Git repositories:
- Audit repository: contains
sessions/<sessionId>/...artifacts - Source repository (optional but recommended): codebase used for cross-reference features
- Audit repository: contains
npm installCopy the sample and update paths:
cp .env.example .envOn Windows PowerShell:
Copy-Item .env.example .envSet absolute paths for your machine (examples in the sample file):
COPILOT_AUDIT_REPO: path to audit Git repositorySOURCE_REPO: path to source Git repositoryPORT: API port (default3001)
npm run devThis runs:
- Vite frontend at
http://localhost:5173 - Express API at
http://localhost:3001
Browse to:
http://localhost:5173
The backend loads .env from workspace root using dotenv.
| Variable | Required | Default | Purpose |
|---|---|---|---|
PORT |
No | 3001 |
Express API port |
COPILOT_AUDIT_REPO |
Yes (for useful data) | empty | Absolute path to audit Git repo |
SOURCE_REPO |
No | empty | Absolute path to source Git repo for source/xref pages |
COPILOT_AUDIT_MODE |
No | flat |
Hook mode hint shown in metadata (flat or per-session) |
COPILOT_AUDIT_BRANCH |
No | main |
Hook branch name for flat mode |
COPILOT_AUDIT_PUSH |
No | false |
Hook behavior flag for session-final push |
Main endpoints exposed by the server:
GET /api/config- Get current configured repo paths and validityPOST /api/config- Update repo paths at runtimeGET /api/sessions- List audit sessionsGET /api/sessions/:id- Get one session with timeline eventsGET /api/sessions/:id/commits- Get related commitsGET /api/search?q=...- Search across session artifactsGET /api/source/*- Source repository commit/tree/file browsingGET /api/xref/*- Cross-reference index and lookups
From package.json:
npm run dev:client- Start Vite onlynpm run dev:server- Start API server only (tsx watch server/index.ts)npm run dev- Run client + server togethernpm run build- Build frontend assets with Vite
Note:
- The current
npm run startscript expectsdist/server/index.js. - If you have not produced a server build artifact, use
npm run dev:serverfor local API execution.
- Copilot hooks write audit files into your audit repository.
- Run the viewer app locally.
- Point config to your audit/source repos (via
.envor the UI config endpoint). - Review sessions, prompts, patch history, and transcript events.
- Use source + xref pages to connect audit changes to source commits/files.
-
Empty dashboard:
- Confirm
COPILOT_AUDIT_REPOpoints to a valid Git repo. - Confirm the repo has
sessions/<sessionId>data.
- Confirm
-
Source page errors:
- Confirm
SOURCE_REPOpoints to a valid Git repo.
- Confirm
-
API unreachable:
- Ensure server is running on
PORT(default3001). - Ensure Vite proxy target matches backend port (
vite.config.ts).
- Ensure server is running on
-
Path validation errors in config API:
- Use absolute paths only.
spec/plan.md- project plan and architecture notesspec/audit-system.md- audit hook system behavior and data format.github/hooks/copilot-audit.json- hook event mapping


