ken CLAUDE.md

ken CLAUDE.md is an instructions file for Claude Code, Codex from townsendmerino/ken. It costs 6,633 tokens per session, scanned B, original, MIT.

Repository instructions for ken, a Go code-search tool that combines text matching with meaning-based search and combines their results. They explain the project, its design documents, and who is allowed to edit it.

In plain words
What is it for?
Finding the right project documentation before coding, maintaining ken’s search behavior, and following its editing and design-review process.
Why use it?
They provide the background and ownership rules needed to change the search tool safely and consistently.

Instructions file for Claude CodeCodex

Written for Codex and Claude Code: reads ~/.codex or $CODEX_HOME, but also the file is CLAUDE.md. Also seen: mentions CLAUDE.md; mentions Claude Code; mentions Codex.

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/townsendmerino/ken/claude-md
Clone the repo
git clone --depth 1 https://github.com/townsendmerino/ken

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for ken CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/townsendmerino/ken/claude-md.svg)](https://agentmods.dev/instructions/townsendmerino/ken/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/townsendmerino/ken/claude-md"><img src="https://agentmods.dev/badge/instructions/townsendmerino/ken/claude-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 6,633 This file is loaded in full into every session.
When invoked 6,633 The same file — it is already loaded in full.
Security scan B 1 finding. Scan, not verified.
Origin original No closer match found 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.1 $0.06633 $0.06633
Opus 5 $0.03317 $0.03317
Sonnet 5 $0.01327 $0.01327
Haiku 4.5 $0.00663 $0.00663

Measured 6d ago against content hash 582a377f42a0, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade B, and why

ken CLAUDE.md scanned grade B with 1 finding 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 6d 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.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

`~/.codex/config.toml`:
CLAUDE.md · 127 lines

How it starts

The opening of the file, as written. The whole thing — 127 lines — stays where its author put it; the contents beside it link to each section on GitHub.

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

What this is

ken is a pure-Go, no-cgo port of MinishLab/semble, a hybrid code-search tool (lexical BM25 + Model2Vec semantic embeddings + RRF fusion + rerank heuristics). The authoritative docs:

  • docs/DESIGN.md — algorithm spec, precision contracts, license chain, risk register. Read it before any non-trivial change.
  • docs/internal/DECISIONS.md — ADR-style record of every architectural decision (alternatives considered, consequences). Cross-linked from DESIGN.md's "Decisions" summary.
  • docs/BENCH.md — NDCG benchmark reproduction + empirical findings.

The repo is on GitHub at townsendmerino/ken.

Repository ownership (read this first)

Claude Code is the sole editor of this repository. A second Claude instance ("the claude app") is used for design/planning discussion only and has been instructed by the user not to modify files here. Implications:

  • There is no lane partition. Every package in this repo is maintained here directly; the old "report, don't cross lanes" rule no longer applies. (The algorithm packages themselves now live in the sibling aikit repo — ADR-034; edit them there.)
  • docs/DESIGN.md is the shared design doc and may be discussed conceptually with the other instance, but all file edits (code and docs/DESIGN.md) happen here.
  • Keep the whole tree gofmt-clean and go test ./... green on every change.

Commands

go build ./...                                   # build everything
go test ./...                                    # all tests
go test ./internal/search/ -run TestSerializeRoundtrip_BM25 -v   # a single test (regexp on name)
go vet ./...                                      # must be clean
make gofmt-check                                  # gofmt scope = Makefile GOFMT_DIRS (cmd internal mcp bench demos); CI runs this exact target
go fix ./...                                      # Go 1.26 modernizers (SplitSeq, min, range-int)

go run ./cmd/ken index  <path>  [--watch|--no-watch] [--write-snapshot] [--chunker=regex|treesitter|line] [--mode=bm25|semantic|hybrid] [--model=DIR]
go run ./cmd/ken search <path> <query>...  [-k N] [--chunker=...] [--mode=...] [--model=...]
go run ./cmd/ken doctor [--json] [--verbose]       # health check + recommendations (folds status/savings/rerank-cache/config into advice)
go run ./cmd/ken-mcp                               # stdio MCP server (env-configured; see MCP section)

Read the full file on GitHub · 127 lines

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. 6d ago First seen · 127 lines · 6,633 tokens per session scan B 582a377f42a0

Subscribe to this mod's changes

ken CLAUDE.md is an instructions file published in the GitHub repository townsendmerino/ken (30 stars, last pushed 2d ago), licensed MIT. It adds 6,633 tokens to every session, about $0.0332 per session on Opus 5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.