Kyoko
CLAUDE.md97 starsChanged 6 months agoApache-2.0View on GitHub
This file gives coding agents the repo-specific context needed to work on Kyoko without re-learning the project from scratch. Kyoko is a local repair loop for AI agent workflows: It is a single-user, local-first tool. The shipped runtime is a Python CLI, loopback dashboard/API, SQLite database, blob store, bundled dashboard assets, MCP server, telemetry SDKs, source/replay scaffolds, and conservative autonomy gate. Read these first when the task touches product behavior: The current package, module, and CLI are still named kyoko.…
- Installs packages
The file
We split this CLAUDE.md into the rules it gives an agent
4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 19
Read these first when the task touches product behavior:
- Very specific: line 100
Every behavior-changing path must flow through the proposal/check/replay gate.
- Distinctive: line 101
Do not add shortcuts in CLI, API, dashboard, or MCP code.
- Very specific: line 140
Do not commit local state, build caches, __pycache__, virtualenvs, node_modules, or .kyoko/ runtime data.
≈ “Common” is an estimate: at least 1 in 5 of the 12,729 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.
Files
CLAUDE.md
This file gives coding agents the repo-specific context needed to work on Kyoko without re-learning the project from scratch.
Product Shape
Kyoko is a local repair loop for AI agent workflows:
telemetry -> issue -> proposal -> check -> replay -> gated applyIt is a single-user, local-first tool. The shipped runtime is a Python CLI, loopback dashboard/API, SQLite database, blob store, bundled dashboard assets, MCP server, telemetry SDKs, source/replay scaffolds, and conservative autonomy gate.
Read these first when the task touches product behavior:
README.mdfor the public overview.docs/SCOPE.mdfor v0 boundaries and non-goals.docs/ARCHITECTURE.mdfor the runtime model and safety boundary.docs/DEVELOPMENT.mdfor tests, dashboard builds, and release smoke.docs/specs/anddocs/fixtures/for contract-level behavior.
Current Names
The current package, module, and CLI are still named kyoko. Do not rename the
package, command, import path, docs, or release metadata unless the user
explicitly asks for that change.
Commands
# Local editable install
python3 -m pip install -e .
# Validate specs, schemas, fixtures, and bundled asset mirrors
python3 scripts/validate_gate_artifacts.py
python3 -m kyoko validate-gates
# Full Python test suite
python3 -m unittest discover -s tests
# First-run/safe local smoke
python3 -m kyoko doctor --safe-smokes --json
# Package install smoke
python3 -m kyoko release-smoke --artifact both --install-deps --jsonThere is no separate lint/format config. Match surrounding style.
Frontend
The dashboard source lives in frontend/. Vite builds into kyoko/assets/web/
so the Python package can serve the dashboard after installation.
cd frontend
npm install
npm run buildFor frontend development:
python3 -m kyoko serve --db /tmp/kyoko.db
cd frontend
npm run devThe dev server proxies API requests to kyoko serve. Push updates use
Server-Sent Events, not WebSockets.
Architecture Map
kyoko/cli.py: argparse front door and command dispatch.kyoko/web.py: dashboard/API server and SSE stream.kyoko/storage.py: SQLite schema, migrations, and canonical ingest.kyoko/sdk.py: dependency-free Python recorder/client.kyoko/project_bootstrap.py: project-local.kyoko/bootstrap.kyoko/demo.py: bundled first-run demo.kyoko/doctor.py: readiness and safe smoke checks.kyoko/analyze.py,kyoko/issues.py,kyoko/proposals.py: diagnosis, first-class issues, and proposal creation.kyoko/checks.py,kyoko/replay_adapters.py,kyoko/replay_servers.py: check and replay gate.kyoko/improve.py,kyoko/autonomy_runner.py,kyoko/apply.py,kyoko/harness.py: improvement loop and gated writes.kyoko/eval_detectors.py,kyoko/llm_evals.py,kyoko/evals_measure.py: evidence-only measurement plane.kyoko/mcp.py: stdio MCP server and install-plan helpers.kyoko/assets/**: packaged schemas, fixtures, detectors, LLM eval templates, and built dashboard.
Safety Invariants
Every behavior-changing path must flow through the proposal/check/replay gate. Do not add shortcuts in CLI, API, dashboard, or MCP code.
Preserve these rules:
- Operator, ACE, import, and MCP outputs become validated proposals first.
- Context or harness writes happen only after gate evaluation.
- Human locks block later writes to the same protected target.
- Harness writes require an explicit workspace root and patch transaction.
- Replay server URLs are loopback-only unless
--allow-remote-serveris set. - External model/provider/framework calls are opt-in and never part of the default safe smoke path.
- Evidence exported to prompts, MCP, API summaries, or bundles is redacted by default.
Contract Artifacts
Many CLI commands have frozen --json contracts under
docs/fixtures/cli-json/. If output shape changes, update the relevant golden
and the matching spec in docs/specs/0005-cli-json-contracts.md.
Source/proposal/replay fixtures have authoring copies in docs/fixtures/ and
runtime copies in kyoko/assets/. Keep mirrors synchronized and run:
python3 scripts/validate_gate_artifacts.pyBundled detectors and LLM eval templates also mirror between docs/ and
kyoko/assets/.
Dependencies
The Python runtime currently keeps required dependencies minimal
(jsonschema). Optional integrations belong in extras or lazy imports. The
frontend is a normal Node/Vite/React project and may use frontend dependencies
when they earn their keep.
Repo Hygiene
Do not commit local state, build caches, __pycache__, virtualenvs,
node_modules, or .kyoko/ runtime data. Keep user-facing docs concise and
put stable contracts under docs/specs, docs/schemas, and docs/fixtures.
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
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.

