agentleFS
ruvnetruvnet/metaharness/kimi-k3-harness/CLAUDE.md

metaharness / kimi-k3-harness

CLAUDE.md686 starsChanged 2 months agoMITView on GitHub

Repo-aware coding agent harness for kimi-k3-in-c — Kimi K3 (2.78T-param) inference in portable C99: one CPU, 8 GB RAM, no BLAS, no framework, no GPU Advanced Coding harness · domain: software-engineering. Generated with create-agent-harness. This harness uses @metaharness/kernel — a Rust-compiled WASM module with a NAPI-RS native fallback — so the same code runs identically on every platform. This harness targets kimi-k3-in-c — Kimi K3 (2.78 T parameters) inference in portable C99. One CPU, 8 GB of RAM. No BLAS,…

The file

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

2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    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. Very specific:

    Use the harness's MCP tools (mcp__kimi-k3-harness__*) for orchestration

    line 9
  2. Very specific:

    Every performance figure must be measured, not asserted: All numbers in docs come from the measurement output in docs/data/ — update the …

    line 72

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

kimi-k3-harness

Repo-aware coding agent harness for kimi-k3-in-c — Kimi K3 (2.78T-param) inference in portable C99: one CPU, 8 GB RAM, no BLAS, no framework, no GPU

Advanced Coding harness · domain: software-engineering. Generated with create-agent-harness.

Behavioral rules

  • Use the harness's MCP tools (mcp__kimi-k3-harness__*) for orchestration
  • Memory and routing are handled by the kernel — you don't need to learn them
  • Defer destructive operations to the user

Agents

AgentTierRole
architectopusDesigns the change before code is written.
implementersonnetWrites code that matches the surrounding style.
revieweropusHunts correctness bugs in the diff.
test-writersonnetAdds the missing tests for the change.

Skills

  • /plan-change — Turn a feature request into a minimal, file-level implementation plan before any code.

Commands

  • doctor — Health-check the harness: kernel load, MCP wiring, memory backend, host adapter.
  • review-diff — Review the current working diff for correctness, security, and reuse.

Architecture

This harness uses @metaharness/kernel — a Rust-compiled WASM module with a NAPI-RS native fallback — so the same code runs identically on every platform.

Project: kimi-k3-in-c

This harness targets kimi-k3-in-c — Kimi K3 (2.78 T parameters) inference in portable C99. One CPU, 8 GB of RAM. No BLAS, no framework, no GPU.

FactValue
Parameters2.78 T
Checkpoint on disk1.56 TB
Peak RSS, measured (--preset laptop)8.24 GB
Peak RSS, measured (--preset server)127.92 GB
Engine size176 KB
GPUs0
Language / license / platformC99 · Apache-2.0 · Linux x86-64

Running the engine

./bin/k3 ~/k3model --trunk ~/k3trunk --preset laptop \
        --tok ~/k3model --prompt "The capital of France is" --gen 8 --incremental
  • --preset laptop trades speed for memory (~32.7 s/token, 8.24 GB peak RSS); --preset server trades memory for speed (~10.7 s/token, 127.92 GB peak RSS). More memory changes only the clock, never the output.
  • This is a base model: output is a continuation, not a reply. There is no chat template — do not treat generations as assistant answers.
  • Generation is slow (minutes per short run). Never launch ./bin/k3 as a casual smoke test; prefer the project's unit tests and small fixtures.

Rules for agents working on this repo

  • Portability is the product. Changes must stay portable C99: no BLAS, no GPU/framework dependencies, no platform-specific intrinsics outside existing guarded paths.
  • Memory is the budget. Peak RSS is a headline metric. Any change touching the trunk/streaming path must state its effect on peak RSS under --preset laptop.
  • Every performance figure must be measured, not asserted. All numbers in docs come from the measurement output in docs/data/ — update the data, then the docs, never the docs alone.

Optimization loop (Darwin + Flywheel + Rust/WASM)

crates/k3-kernel-bench is a Rust replica of the trunk inner loop (block-quantized int8 matvec, q8 blocks of 32, per-block f32 scales) compiled to wasm32-unknown-unknown with simd128. Its levers — kernel (scalar/simd), unroll (1/2/4), accs (1/2/4) — are evolved by npm run flywheel (@metaharness/flywheel): each candidate is measured for real, must clear a frozen conjunctive gate (≥2% lift, no cost regression, correctness vs an f64 golden reference, no regression on a never-optimized anchor shape), and every promotion is Ed25519-signed into a replayable lineage under .harness/flywheel/. npm run evolve runs @metaharness/darwin real-sandbox evolution over the harness itself (record: .harness/darwin/).

Rules for this loop:

  • The gate is frozen. Never loosen k3KernelPromotionRule to get a promotion through; a change to the gate invalidates the lineage.
  • .harness/flywheel/replay-bundle.json is evidence, not decoration — regenerate it by re-running the loop; never edit it by hand (verifyReplayBundle will catch it).
  • The wasm artifact is built, not committed: npm run build:wasm first.
  • Current promoted policy: simd/u1/a4 — 5.07× over the naive scalar root on the holdout shape, 2.12× on the anchor (see bench:kernel).

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.