This repo is Peaky Peek, a local-first AI agent debugger.
The product has three connected surfaces:
agent_debugger_sdk/: Python SDK for capturing sessions, events, decisions, checkpoints, and adaptersapi/: FastAPI server for query, replay, streaming, auth, and packaged UI servingfrontend/: React + TypeScript + Vite UI for trace inspection
Primary loop: instrument an agent with the SDK, persist/query it through the API, inspect and replay it in the frontend.
agent_debugger_sdk/core/: tracing primitives, contexts, emitters, recorders, session/event logicagent_debugger_sdk/checkpoints/: checkpoint schemas and validationagent_debugger_sdk/adapters/: framework integrationsagent_debugger_sdk/auto_patch/: auto-instrumentation registry and transport bridgeagent_debugger_sdk/config.py,transport.py,pricing.py: runtime config, delivery, pricing metadata
api/: app factory, routes, schemas, services, UI/static hookscollector/: ingestion and event pipeline integrationstorage/: database engine, migrations, repositoriesauth/: auth and API key supportredaction/: security/privacy filterspyproject-server.toml: package definition forpeaky-peek-server
frontend/src/App.tsx: app composition rootfrontend/src/components/: inspection panels and visualizationsfrontend/src/api/client.ts: API boundaryfrontend/src/types/index.ts: frontend contract mirrorfrontend/src/hooks/,frontend/src/stores/: data flow and statefrontend/src/App.css: main styling surface
tests/: main Python test suitetests/auto_patch/: auto-instrumentation coverageexamples/,scripts/: demo flows and seed scripts
- Prefer targeted reads over broad scans.
- Prefer
rgandrg --files. - Use
python3, notpython, for module commands in this environment. - Do not touch unrelated user changes in the worktree.
- Avoid noisy directories unless directly relevant:
.venv*,frontend/node_modules,frontend/dist,dist,.pytest_cache,.ruff_cache,__pycache__,traces/. traces/may emit permission noise during naive filesystem scans.- Playwright MCP: Use
mcp__plugin_playwright_playwright__*tools, NOTmcp__playwright__*. The officialmcp__playwright__*tools are misconfigured for Chrome instead of Chromium and will fail.
Before changing shared shapes, inspect both sides of the boundary.
Check together:
api/schemas.pyfrontend/src/types/index.tsfrontend/src/api/client.ts
If sessions, events, replay payloads, analysis payloads, or live summaries change, update these together.
If event capture or event fields change, inspect:
agent_debugger_sdk/core/agent_debugger_sdk/checkpoints/api/schemas.py- related route/service code in
api/
If changing auto-patching or adapters, inspect:
agent_debugger_sdk/auto_patch/agent_debugger_sdk/adapters/tests/auto_patch/
If changing a UI panel, inspect:
frontend/src/App.tsx- the target component
- any related hooks/store files
frontend/src/types/index.tsfrontend/src/api/client.tswhen data shape assumptions are involved
Start with:
git status --short
rg --files agent_debugger_sdk api frontend/src testsThen read the smallest set of files that defines the target path and its adjacent boundary.
Make the narrowest safe edit that solves the problem.
Run the smallest meaningful validation for the area you changed.
ruff check .
python3 -m pytest -qUse targeted tests when possible, for example:
python3 -m pytest -q tests/test_api_contract.py -k sessionscd frontend && npm run buildmake server
make frontendmake demo-seed
make demo-live
make demo-safety
make demo-research- Use
git status --shortwhen you need a fast read on the working tree before making changes or committing. - Use
rg --files agent_debugger_sdk api frontend/src testswhen you are orienting to the repo or locating the narrowest set of relevant files. - Use
git diff --statwhen you want a quick size and scope summary of current edits before deeper review. - Use
ruff check .after Python, API, storage, auth, redaction, or SDK changes. - Use
python3 -m pytest -qafter meaningful backend or SDK changes, especially when behavior or contracts changed. - Use a targeted pytest command such as
python3 -m pytest -q tests/test_api_contract.py -k sessionswhen you changed one area and want fast feedback before running the full suite. - Use
cd frontend && npm run buildafter any TypeScript, React, or UI contract change. - Use
make serverwhen you need the FastAPI app running locally for API or integration checks. - Use
make frontendwhen you need the Vite UI running for manual inspection. - Use
make demo-seedbefore demo recording or when you need example session data in the system. - Use
make demo-live,make demo-safety, ormake demo-researchwhen validating the demo flows or generating showcase traces.
- If you change event types or event payload fields, assume backend schema, frontend types, and tests may all need updates.
- If you change an API route, inspect the route module,
api/services.py, schema definitions, and frontend callers. - If you change storage or collector behavior, inspect ingestion flow and any tests covering persistence and replay.
- If you change UI logic, validate with a frontend build even if the change looks type-local.
- If you change packaging or release logic, inspect both
pyproject.tomlandpyproject-server.toml.
- CI in
.github/workflows/ci.ymlrunsruff check .andpytest -qon Python 3.10, 3.11, and 3.12. - Frontend build is not part of the main CI job, but it is part of local validation and the server publish flow.
- Publishing is tag-driven in
.github/workflows/publish.yml:sdk-vX.Y.Zpublishespeaky-peekserver-vX.Y.Zpublishespeaky-peek-servervX.Y.Zpublishes both
- The publish workflow derives package versions from the tag and rewrites package metadata during CI.
git status --short
git diff --stat
ruff check .
python3 -m pytest -q
cd frontend && npm run build
make server
make frontendInstall hooks with pre-commit install after setting up the dev environment.