Borrowing it
Nothing to install: this file belongs to keshrath/agent-knowledge. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/keshrath/agent-knowledge/main/CLAUDE.mdgit clone --depth 1 https://github.com/keshrath/agent-knowledgeWrote 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.
[](https://agentmods.dev/instructions/keshrath/agent-knowledge/claude-md)<a href="https://agentmods.dev/instructions/keshrath/agent-knowledge/claude-md"><img src="https://agentmods.dev/badge/instructions/keshrath/agent-knowledge/claude-md/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/instructions/keshrath/agent-knowledge/claude-md"><img src="https://agentmods.dev/badge/instructions/keshrath/agent-knowledge/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.05641 | $0.05641 |
| Opus 5.5 | $0.02256 | $0.02256 |
| Sonnet 5.5 | $0.01128 | $0.01128 |
| Haiku 4.5 | $0.00564 | $0.00564 |
Grade A, and why
agent-knowledge 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 5d 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.
How it starts
The opening of the file, as written. The whole thing — 159 lines — stays where its author put it; the contents beside it link to each section on GitHub.
agent-knowledge
Architecture
Layered architecture — server.ts handles the MCP tools, rest-server.ts the local REST API and the web dashboard:
scripts/
tree-sitter-extract.mjs Standalone CLI for zero-token code structure extraction
tree-sitter-lang.mjs Per-language tree-sitter query definitions (8 languages)
setup.js Host setup: OpenCode config, the ~/.agents skill, removes 2.x Claude Code command hooks
plugins/opencode/ The opencode plugin
plugin/ Claude Code plugin: .mcp.json, skills/knowledge-ingest, one mod (hooks/ = /knowledge pane + session lifecycle)
src/
server.ts MCP server, 6 tool definitions, request routing
rest-server.ts REST server on 127.0.0.1 (startRestServer, serveRestWhenFree: leader election + takeover)
dashboard-cli.ts `agent-knowledge dashboard [--no-open]`: prints the URL, opens the browser, serves when nothing does
widget.ts MCP Apps widget resource (ui://agent-knowledge/app.html, dist/web/widget.html)
transport/ rest.ts (routes), http.ts (json, readBody, Router), guard.ts (Host/Origin/Content-Type), web.ts (dashboard files + CSP)
web/ Browser code (own tsconfig with DOM; esbuild via build.mjs into dist/web): dashboard.ts, widget.ts, shown.ts, views/, markdown.ts, charts.ts, dom.ts, styles.css
events.ts Live event ring (POST /api/events, read by the pane)
slice.ts runSliced / runAll: index builds as steps that give the event loop back
index.ts Entry point (MCP stdio; the REST holder also runs the background indexer)
types.ts KnowledgeConfig, getConfig(), getVersion()
package-meta.ts Cached name/version from package.json
validate.ts ValidationError class, input validation
version.ts Re-exports getVersion from types.ts
knowledge/
store.ts Markdown CRUD, frontmatter parsing, path traversal protection
search.ts TF-IDF search over knowledge entries with regex fallback; the index follows the files (stat check, only changed entries re-read)
git.ts git pull/push/sync with timeouts
distill.ts Session auto-distillation with secrets scrubbing
graph.ts Knowledge graph — edges table, link/unlink/traverse (BFS)
scoring.ts Confidence/decay scoring — entry_scores table, auto-promotion
consolidate.ts Memory consolidation — TF-IDF duplicate detection, cluster grouping
reflect.ts Reflection cycle — surfaces unconnected entries, generates prompts
analyze.ts Graph analysis — god nodes, bridges, gaps, knowledge brief
ingest-freshness.ts A folder against its knowledge-ingest cache (SHA-256)
similar.ts How close a prompt is to each entry in meaning (local embeddings), for the first-prompt rule
sessions/
parser.ts Multi-format session parsing with mtime-based cache
indexer.ts Background indexing for sessions
search.ts TF-IDF ranked search; the index follows the session files (a growing one is read from where the last read ended)
scopes.ts Search scopes (errors, plans, configs, tools, files, decisions)
summary.ts Session summaries, topic extraction, file path detection
human.ts What a person asked: no slash command, no host wrapper (with parser.promptsOf: no isMeta entry); project and branch names
snapshot.ts The session snapshot (sessions/<project>/<day>-<id>.md), scrubbed
adapters/
index.ts SessionAdapter interface, adapter registry, auto-init
opencode.ts OpenCode adapter (SQLite database)
search/
lexicon.ts What a word is to the base: generic (said in sessions, naming no entry) or what entries are named by
tfidf.ts TF-IDF scoring engine (tokenizer, stopwords, index)
fuzzy.ts Levenshtein distance, sliding window fuzzy matching
excerpt.ts Search result excerpt generation
types.ts SearchResult, SearchOptions interfaces
embeddings/
index.ts Embedding provider registry
factory.ts Provider factory (auto-detect available providers)
types.ts EmbeddingProvider interface
claude.ts Claude/Voyage embeddings
openai.ts OpenAI embeddings
gemini.ts Gemini embeddings
local.ts Local embedding fallback
vectorstore/
index.ts Vector store facade
store.ts SQLite-backed vector storage with cosine similarity
chunker.ts Document chunking for embedding
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.
- 5d ago Changed · +5 lines · +997 tokens per session 61993d5bac36
- 13d ago Changed · +1 lines · +193 tokens per session a7aba0c7d96e
- 19d ago Changed · +7 lines · +1,395 tokens per session 7e551709cae3
- 1mo ago Changed · +6 lines · +1,234 tokens per session d4d2c2285e42
- 3mo ago First seen · 140 lines · 1,822 tokens per session scan A f27b18b1472a
agent-knowledge CLAUDE.md is an instructions file published in the GitHub repository keshrath/agent-knowledge (19 stars, last pushed 5d ago), licensed MIT. It adds 5,641 tokens to every session, about $0.0226 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
agent-knowledge CLAUDE.md compared with instructions from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| agent-knowledge CLAUDE.mdkeshrath/agent-knowledge | Instructions file | 19 | 5d ago | MIT | A | 5,641 | Claude Code |
| vscode buildNext.instructions.mdmicrosoft/vscode | Instructions file | 196k | today | MIT | A | 9,887 | GitHub Copilot |
| next.js AGENTS.mdvercel/next.js | Instructions file | 144k | today | MIT | A | 7,230 | Codex, OpenCode |
| vscode oss-third-party-notices.instructions.mdmicrosoft/vscode | Instructions file | 196k | today | MIT | A | 5,685 | GitHub Copilot |
| langchain AGENTS.mdlangchain-ai/langchain | Instructions file | 150k | today | MIT | A | 4,680 | Codex, OpenCode |
| vscode copilot-instructions.mdmicrosoft/vscode | Instructions file | 196k | today | MIT | A | 3,303 | GitHub Copilot |
| deno copilot-instructions.mddenoland/deno | Instructions file | 109k | today | MIT | A | 3,077 | GitHub Copilot |