agentleFS
kayba-aikayba-ai/Kyoko/CLAUDE.md

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
  1. Distinctive:

    Read these first when the task touches product behavior:

    line 19
  2. Very specific:

    Every behavior-changing path must flow through the proposal/check/replay gate.

    line 100
  3. Distinctive:

    Do not add shortcuts in CLI, API, dashboard, or MCP code.

    line 101
  4. Very specific:

    Do not commit local state, build caches, __pycache__, virtualenvs, node_modules, or .kyoko/ runtime data.

    line 140

≈ “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.

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

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 apply

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:

  • README.md for the public overview.
  • docs/SCOPE.md for v0 boundaries and non-goals.
  • docs/ARCHITECTURE.md for the runtime model and safety boundary.
  • docs/DEVELOPMENT.md for tests, dashboard builds, and release smoke.
  • docs/specs/ and docs/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 --json

There 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 build

For frontend development:

python3 -m kyoko serve --db /tmp/kyoko.db
cd frontend
npm run dev

The 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-server is 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.py

Bundled 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.

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.