kw-engine CLAUDE.md

Repository instructions for kw-engine, a tool that turns research notes into organized knowledge and searchable indexes. Markdown files are the source, while the SQLite database and index are generated from them.

In plain words
What is it for?
Use them when rebuilding or checking indexes, viewing project status, running tests, linting, type-checking, or changing the knowledge models and storage code.
Why use it?
They prevent the stored data and its indexes from drifting apart and define checks for invalid records, code boundaries, and pending work.

Instructions file

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/chenpg2/kw-engine/claude-md
Clone the repo
git clone --depth 1 https://github.com/chenpg2/kw-engine
Per session 189 This file is loaded in full into every session.
When invoked 189 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin 95% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00189 $0.00189
Opus 5 $0.00095 $0.00095
Sonnet 5 $0.00038 $0.00038
Haiku 4.5 $0.00019 $0.00019

Measured 2d ago against content hash 2c3a76868358, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

kw-engine CLAUDE.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

This is a copy

95% identical to kw-engine AGENTS.md — 2 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

CLAUDE.md · 23 lines

What it actually says

CLAUDE.md

kw-engine: methodology evolution engine substrate. Distill → abstract → synthesize → search by problem structure.

Commands

uv run kw reindex --memory-dir path   # rebuild SQLite + index.json from markdown
uv run kw verify --memory-dir path    # run SCHEMA §6 invariants
uv run kw status --memory-dir path    # show counts + pending/stale state
uv run pytest                          # all tests
uv run ruff check .                    # lint
uv run mypy src/                       # type check

Conventions

  • Markdown is truth; SQLite + index.json are derived (kw reindex rebuilds both)
  • Paper id = PDF filename stem
  • Principle id = P-#### (zero-padded)
  • All models in models.py; store/ never imports from cli.py
  • No silent fallback: validation errors raise, never coerce.
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 23 lines · 189 tokens per session scan A 2c3a76868358

Subscribe to this mod's changes

kw-engine CLAUDE.md is an instructions file published in the GitHub repository chenpg2/kw-engine (11 stars, last pushed 2mo ago), licensed MIT. It adds 189 tokens to every session, about $0.0009 per session on Opus 5. A static security scan graded it A with 0 findings. It is 95% identical to kw-engine AGENTS.md, differing in 2 lines, and is treated as a copy.

Related

Other instructions, from other repositories

charm-os AGENTS.md

Instructions for tonydzi/charm-os, covering agents.md — working in this repo, what this repo is, stack and layout, how to verify a change and conventions.

tonydzi/charm-os · 895 tokens

codex-autoresearch AGENTS.md

Instructions for TheGreenCedar/codex-autoresearch, covering agents.md, purpose and scope, canonical sources, stable product boundaries and source and package boundaries.

TheGreenCedar/codex-autoresearch · 2,034 tokens

autoharness AGENTS.md

Instructions for tigerless-labs/autoharness: This repo uses Open Knowledge — collaborative markdown via MCP. .open-knowledge/config.yml (with optional /.open-knowledge/config.yml; CLI/env may override) is the path contract: content.dir is the root for relative paths; content.include lists globs that add markdown…

tigerless-labs/autoharness · 2,201 tokens

SoDam-WikiMate AGENTS.md

Instructions for sodam-ai/SoDam-WikiMate, covering wikimate 작업 규칙 (크로스툴 — claude code · codex · gemini 공용), 문체, 자동 동작 (자연어 트리거 — 강제 호출 불필요), 접근 규칙 (자동 감지 — 특정 도구에 한정하지 않음) and obsidian 규칙.

sodam-ai/SoDam-WikiMate · 1,936 tokens

soia-open-skills AGENTS.md

Instructions for soia-team/soia-open-skills, covering agents.md - soia-open-skills, repository purpose, safety rules, validation and git workflow(本仓特有:默认分支是 main).

soia-team/soia-open-skills · 1,325 tokens

Polaris AGENTS.md

Instructions for sponge-b0b/Polaris, covering agents.md, purpose and authority, domain vocabulary, coding conduct and secrets.

sponge-b0b/Polaris · 1,873 tokens