agentleFS
acailicacailic/agent_debugger/CLAUDE.md

agent_debugger

CLAUDE.md9 starsChanged 7 months agoMITView on GitHub

This repo is Peaky Peek, a local-first AI agent debugger. The product has three connected surfaces: Primary loop: instrument an agent with the SDK, persist/query it through the API, inspect and replay it in the frontend. Before changing shared shapes, inspect both sides of the boundary. Check together: If sessions, events, replay payloads, analysis payloads, or live summaries change, update these together. If event capture or event fields change, inspect: If changing auto-patching or adapters, inspect: If changing a UI…

The file

Show its rules and text

We split this CLAUDE.md into the rules it gives an agent

30 rules. About 0 are common, 14 are distinctive, and 16 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈14

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 16

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Prefer targeted reads over broad scans.

    line 51
  2. Very specific:

    Prefer rg and rg --files.

    line 52
  3. Very specific:

    Use python3, not python, for module commands in this environment.

    line 53
  4. Distinctive:

    Do not touch unrelated user changes in the worktree.

    line 54
  5. Very specific:

    Avoid noisy directories unless directly relevant: .venv*, frontend/node_modules, frontend/dist, dist, .pytest_cache, .ruff_cache, …

    line 55
  6. Very specific:

    Playwright MCP: Use mcp__plugin_playwright_playwright__* tools, NOT mcp__playwright__*.

    line 57
  7. Distinctive:

    Before changing shared shapes, inspect both sides of the boundary.

    line 61
  8. Distinctive:

    If sessions, events, replay payloads, analysis payloads, or live summaries change, update these together.

    line 71
  9. Distinctive:

    If event capture or event fields change, inspect:

    line 75
  10. Distinctive:

    If changing auto-patching or adapters, inspect:

    line 84
  11. Distinctive:

    If changing a UI panel, inspect:

    line 92
  12. Distinctive:

    Run the smallest meaningful validation for the area you changed.

    line 119
  13. Distinctive:

    Use targeted tests when possible, for example:

    line 130
  14. Distinctive:

    Use git status --short when you need a fast read on the working tree before making changes or committing.

    line 165
  15. Very specific:

    Use rg --files agent_debugger_sdk api frontend/src tests when you are orienting to the repo or locating the narrowest set of relevant files.

    line 166
  16. Distinctive:

    Use git diff --stat when you want a quick size and scope summary of current edits before deeper review.

    line 167
  17. Very specific:

    Use ruff check . after Python, API, storage, auth, redaction, or SDK changes.

    line 168
  18. Very specific:

    Use python3 -m pytest -q after meaningful backend or SDK changes, especially when behavior or contracts changed.

    line 169
  19. Very specific:

    Use a targeted pytest command such as python3 -m pytest -q tests/test_api_contract.py -k sessions when you changed one area and want fast …

    line 170
  20. Very specific:

    Do not chase per-file coverage numbers for api/*_routes.py locally: coverage.py under-records FastAPI handler bodies exercised through …

    line 171
  21. Very specific:

    Use cd frontend && npm run build after any TypeScript, React, or UI contract change.

    line 172
  22. Very specific:

    Use make server when you need the FastAPI app running locally for API or integration checks.

    line 173
  23. Very specific:

    Use make frontend when you need the Vite UI running for manual inspection.

    line 174
  24. Very specific:

    Use make demo-seed before demo recording or when you need example session data in the system.

    line 175
  25. Very specific:

    Use make demo-live, make demo-safety, or make demo-research when validating the demo flows or generating showcase traces.

    line 176
  26. Distinctive:

    If you change event types or event payload fields, assume backend schema, frontend types, and tests may all need updates.

    line 180
  27. Very specific:

    If you change an API route, inspect the route module, api/services.py, schema definitions, and frontend callers.

    line 181
  28. Distinctive:

    If you change storage or collector behavior, inspect ingestion flow and any tests covering persistence and replay.

    line 182
  29. Distinctive:

    If you change UI logic, validate with a frontend build even if the change looks type-local.

    line 183
  30. Very specific:

    If you change packaging or release logic, inspect both pyproject.toml and pyproject-server.toml.

    line 184

≈ “Common” is an estimate: at least 1 in 5 of the 26,980 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

CLAUDE.md

Purpose

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 adapters
  • api/: FastAPI server for query, replay, streaming, auth, and packaged UI serving
  • frontend/: 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.

Repo Map

SDK and tracing

  • agent_debugger_sdk/core/: tracing primitives, contexts, emitters, recorders, session/event logic
  • agent_debugger_sdk/checkpoints/: checkpoint schemas and validation
  • agent_debugger_sdk/adapters/: framework integrations
  • agent_debugger_sdk/auto_patch/: auto-instrumentation registry and transport bridge
  • agent_debugger_sdk/config.py, transport.py, pricing.py: runtime config, delivery, pricing metadata

Server and storage

  • api/: app factory, routes, schemas, services, UI/static hooks
  • collector/: ingestion and event pipeline integration
  • storage/: database engine, migrations, repositories
  • auth/: auth and API key support
  • redaction/: security/privacy filters
  • pyproject-server.toml: package definition for peaky-peek-server

Frontend

  • frontend/src/App.tsx: app composition root
  • frontend/src/components/: inspection panels and visualizations
  • frontend/src/api/client.ts: API boundary
  • frontend/src/types/index.ts: frontend contract mirror
  • frontend/src/hooks/, frontend/src/stores/: data flow and state
  • frontend/src/App.css: main styling surface

Tests and demos

  • tests/: main Python test suite
  • tests/auto_patch/: auto-instrumentation coverage
  • examples/, scripts/: demo flows and seed scripts

Agent Rules

  • Prefer targeted reads over broad scans.
  • Prefer rg and rg --files.
  • Use python3, not python, 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, NOT mcp__playwright__*. The official mcp__playwright__* tools are misconfigured for Chrome instead of Chromium and will fail.

High-Risk Boundaries

Before changing shared shapes, inspect both sides of the boundary.

API ↔ frontend contract

Check together:

  • api/schemas.py
  • frontend/src/types/index.ts
  • frontend/src/api/client.ts

If sessions, events, replay payloads, analysis payloads, or live summaries change, update these together.

SDK ↔ API contract

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/

Auto-instrumentation

If changing auto-patching or adapters, inspect:

  • agent_debugger_sdk/auto_patch/
  • agent_debugger_sdk/adapters/
  • tests/auto_patch/

Frontend behavior

If changing a UI panel, inspect:

  • frontend/src/App.tsx
  • the target component
  • any related hooks/store files
  • frontend/src/types/index.ts
  • frontend/src/api/client.ts when data shape assumptions are involved

Default Workflow

1. Orient

Start with:

git status --short
rg --files agent_debugger_sdk api frontend/src tests

Then read the smallest set of files that defines the target path and its adjacent boundary.

2. Change

Make the narrowest safe edit that solves the problem.

3. Validate

Run the smallest meaningful validation for the area you changed.

Validation Defaults

Python and server changes

ruff check .
python3 -m pytest -q

Use targeted tests when possible, for example:

python3 -m pytest -q tests/test_api_contract.py -k sessions

Full-stack scenario tests live in tests/e2e/ (marker e2e): they start a real uvicorn subprocess with a temp SQLite database and drive the SDK over real HTTP. They run as part of the default suite; opt out with -m 'not e2e'. Run them alone with python3 -m pytest -q tests/e2e.

Frontend changes

cd frontend && npm run build

Dev servers

make server
make frontend

Demo flows

make demo-seed
make demo-live
make demo-safety
make demo-research

When To Use Which Command

  • Use git status --short when you need a fast read on the working tree before making changes or committing.
  • Use rg --files agent_debugger_sdk api frontend/src tests when you are orienting to the repo or locating the narrowest set of relevant files.
  • Use git diff --stat when 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 -q after 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 sessions when you changed one area and want fast feedback before running the full suite.
  • Do not chase per-file coverage numbers for api/*_routes.py locally: coverage.py under-records FastAPI handler bodies exercised through httpx ASGITransport in some environments (verified with a manual sys.settrace probe — the lines do execute). Trust passing response assertions; CI measures coverage independently.
  • Use cd frontend && npm run build after any TypeScript, React, or UI contract change.
  • Use make server when you need the FastAPI app running locally for API or integration checks.
  • Use make frontend when you need the Vite UI running for manual inspection.
  • Use make demo-seed before demo recording or when you need example session data in the system.
  • Use make demo-live, make demo-safety, or make demo-research when validating the demo flows or generating showcase traces.

Change Heuristics

  • 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.toml and pyproject-server.toml.

CI and Release Facts

  • CI in .github/workflows/ci.yml runs ruff check . and pytest -q on 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.Z publishes peaky-peek
    • server-vX.Y.Z publishes peaky-peek-server
    • vX.Y.Z publishes both
  • The publish workflow derives package versions from the tag and rewrites package metadata during CI.

Quick Commands

git status --short
git diff --stat
ruff check .
python3 -m pytest -q
cd frontend && npm run build
make server
make frontend

Pre-Commit Hooks

Install hooks with pre-commit install after setting up the dev environment.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.