agent-knowledge: Instructions file for Claude Code

CLAUDE.md

agent-knowledge CLAUDE.md is an instructions file for Claude Code from keshrath/agent-knowledge. It costs 5,641 tokens per session, scanned A, original, MIT.

Project instructions and technical notes for agent-knowledge, a tool that stores, searches, and displays a codebase’s knowledge in a dashboard. They describe its architecture, code layout, and development rules.

In plain words
What is it for?
Use them when working on the server, dashboard, code-structure extraction, knowledge search, storage, setup, or related hooks and skills.
Why use it?
They give coding agents the project context needed to change the system consistently and safely.

Instructions file for Claude Code

Written for Claude Code: the file is CLAUDE.md. Also seen: mentions .claude-plugin; mentions Claude Code; mentions Codex.

This is keshrath/agent-knowledge's own configuration. It tells Claude Code how to work on agent-knowledge itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything agent-knowledge configures →

Reuse

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.

Copy the file
curl -O https://raw.githubusercontent.com/keshrath/agent-knowledge/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/keshrath/agent-knowledge

Made for: Claude Code.

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 agent-knowledge CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/keshrath/agent-knowledge/claude-md/github.svg)](https://agentmods.dev/instructions/keshrath/agent-knowledge/claude-md)
Your own site
<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.

agentmods 80×15 button for agent-knowledge CLAUDE.md

Your own site · 80×15
<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>
Per session 5,641 This file is loaded in full into every session.
When invoked 5,641 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.05641 $0.05641
Opus 5.5 $0.02256 $0.02256
Sonnet 5.5 $0.01128 $0.01128
Haiku 4.5 $0.00564 $0.00564

Measured 5d ago against content hash 61993d5bac36, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

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.

CLAUDE.md · 159 lines

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

Read the full file on GitHub · 159 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. 5d ago Changed · +5 lines · +997 tokens per session 61993d5bac36
  2. 13d ago Changed · +1 lines · +193 tokens per session a7aba0c7d96e
  3. 19d ago Changed · +7 lines · +1,395 tokens per session 7e551709cae3
  4. 1mo ago Changed · +6 lines · +1,234 tokens per session d4d2c2285e42
  5. 3mo ago First seen · 140 lines · 1,822 tokens per session scan A f27b18b1472a

Subscribe to this mod's changes

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.

Related

agent-knowledge CLAUDE.md compared with instructions from other repositories

agent-knowledge CLAUDE.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
agent-knowledge CLAUDE.mdkeshrath/agent-knowledgeInstructions file195d agoMITA5,641Claude Code
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file196ktodayMITA9,887GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file144ktodayMITA7,230Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file196ktodayMITA5,685GitHub Copilot
langchain AGENTS.mdlangchain-ai/langchainInstructions file150ktodayMITA4,680Codex, OpenCode
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file196ktodayMITA3,303GitHub Copilot
deno copilot-instructions.mddenoland/denoInstructions file109ktodayMITA3,077GitHub Copilot