knowledge-ingest

A tool that loads a codebase into an agent knowledge base by extracting its structure and recording related knowledge and connections.

In plain words
What is it for?
Use it when onboarding a repository, refreshing knowledge after a refactor, importing documentation, or processing new, changed, and deleted files incrementally.
Why use it?
It gives future coding sessions project context and updates only files that changed after the initial import.

Skill for Claude CodeCodex

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 skills/keshrath/agent-knowledge/knowledge-ingest
Any agent
npx skills add keshrath/agent-knowledge --skill knowledge-ingest
Clone the repo
git clone --depth 1 https://github.com/keshrath/agent-knowledge

Made for: Claude Code, Codex.

Per session 96 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,519 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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 $0.00096 $0.02519
Opus 5 $0.00048 $0.01260
Sonnet 5 $0.00019 $0.00504
Haiku 4.5 $0.00010 $0.00252

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

Security

Grade A, and why

knowledge-ingest 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.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/validate.mjs), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

skills/knowledge-ingest/SKILL.md · 225 lines

How it starts

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

knowledge-ingest

Populate or update agent-knowledge from a codebase. Tree-sitter extracts structure (zero LLM tokens), then the agent distills clusters into knowledge entries + graph edges via existing MCP tools.

First run: full ingest — scans all files, creates entries from scratch. Subsequent runs: incremental — only reprocesses files whose SHA256 changed, adds entries for new files, removes entries for deleted files. The .knowledge-ingest-cache.json file in the target directory tracks state between runs.

When to use

  • Onboarding a new project — bootstrap the knowledge base so future sessions have context
  • After a refactor — re-run to update subsystem boundaries and relationships
  • Periodic refresh — re-run after significant changes to keep knowledge current
  • Importing documentation — PDFs, architecture diagrams, or external URLs

When NOT to use

  • Single-file changes — just write a knowledge entry manually
  • No code changes since last ingest — the cache will skip everything anyway (fast no-op)

Procedure

Phase 0 — Validation

  1. Confirm the target path exists and is a directory.
  2. Detect project name:
    • Check package.jsonname field
    • Check Cargo.toml[package] name
    • Check go.modmodule line
    • Check pyproject.toml[project] name
    • Fall back to directory basename
  3. Check for .knowledge-ingest-cache.json in the target directory. If found, load it — this is an incremental run. Report how many files changed since last ingest.

Phase 1 — Structural Extraction (zero tokens)

  1. Locate the tree-sitter extraction script. It ships with agent-knowledge:
node "<agent-knowledge-repo>/scripts/tree-sitter-extract.mjs" "<target-path>" --exclude "node_modules,dist,.git,vendor,__pycache__,build,target,.venv,coverage" --json

To find <agent-knowledge-repo>, check common locations:

  • ~/.claude/mcp-servers/agent-knowledge/
  • Or locate via: dirname $(which agent-knowledge)/../

Read the full file on GitHub · 225 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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 · 225 lines · 96 tokens per session scan A 240e21a406c8

Subscribe to this mod's changes

knowledge-ingest is a skill published in the GitHub repository keshrath/agent-knowledge (15 stars, last pushed 4mo ago), licensed MIT. It adds 96 tokens to every session and 2,519 once invoked, about $0.0005 per session on Opus 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

Other skills, from other repositories

mybrain-setup

Use when users want to install or set up MyBrain -- a personal knowledge base with semantic search. Install is always per-project (local MCP scope); the only user-facing choice is which database backend to connect to (Bundled, Docker, Native, or RDS). Detects and offers to remove deprecated user/project/plugin-scoped…

robertsfeir/mybrain · 75 tokens

mybrain-overview

Use when users ask about MyBrain, what it does, how it works, what tools are available, or how to use the personal knowledge base. Covers architecture, tools, deployment modes, and usage.

robertsfeir/mybrain · 46 tokens

nemotron-retrieval-recipes

Use when planning, debugging, tuning, evaluating, exporting, or deploying public Nemotron embed/rerank retrieval recipes.

NVIDIA-NeMo/Nemotron · 36 tokens

wegent-knowledge

Knowledge base management and search tools for Wegent. Provides capabilities to list, create, update, and search knowledge bases and documents using RAG retrieval. Use this skill when the user wants to manage knowledge bases, documents, or search for information programmatically.

wecode-ai/Wegent · 51 tokens

karpathy-llm-wiki

Use when building or maintaining a personal LLM-powered knowledge base. Triggers: ingesting sources into a wiki, querying wiki knowledge, linting wiki quality, 'add to wiki', 'what do I know about', or any mention of 'LLM wiki' or 'Karpathy wiki'.

Astro-Han/karpathy-llm-wiki · 67 tokens

qdrant-clients-sdk

Qdrant provides client SDKs for various programming languages, allowing easy integration with Qdrant deployments.

qdrant/skills · 28 tokens