engraph: Instructions file for Claude Code

CLAUDE.md

engraph CLAUDE.md is an instructions file for Claude Code from devwhodevs/engraph. It costs 4,463 tokens per session, scanned A, original, MIT.

Project instructions for engraph, a Rust command-line tool and MCP server that adds search and AI features to Obsidian vaults. They describe its modules, configuration, document IDs, chunking, and local model components.

In plain words
What is it for?
Use them when developing engraph, particularly when working on configuration, document processing, search, model inference, or Obsidian integration.
Why use it?
They help an agent understand the project’s architecture and important dependencies before making changes.

Instructions file for Claude Code

Written for Claude Code: the file is CLAUDE.md.

This is devwhodevs/engraph's own configuration. It tells Claude Code how to work on engraph 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 engraph configures →

Reuse

Borrowing it

Nothing to install: this file belongs to devwhodevs/engraph. 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/devwhodevs/engraph/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/devwhodevs/engraph

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 engraph CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/devwhodevs/engraph/claude-md/github.svg)](https://agentmods.dev/instructions/devwhodevs/engraph/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/devwhodevs/engraph/claude-md"><img src="https://agentmods.dev/badge/instructions/devwhodevs/engraph/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 engraph CLAUDE.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/devwhodevs/engraph/claude-md"><img src="https://agentmods.dev/badge/instructions/devwhodevs/engraph/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 4,463 This file is loaded in full into every session.
When invoked 4,463 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.04463 $0.04463
Opus 5.5 $0.01785 $0.01785
Sonnet 5.5 $0.00893 $0.00893
Haiku 4.5 $0.00446 $0.00446

Measured 1mo ago against content hash 4e125ab3ca57, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

engraph 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 1mo 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 · 118 lines

How it starts

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

engraph

Local knowledge graph + intelligence layer for Obsidian vaults. Rust CLI + MCP server. llama.cpp inference with Metal GPU. MIT licensed.

Architecture

Single binary with 26 modules behind a lib crate:

  • config.rs — loads ~/.engraph/config.toml and vault.toml, merges CLI args, provides data_dir(). Includes intelligence: Option<bool>, [models] section for model overrides, [obsidian] section (CLI path, enabled flag), and [agents] section (registered AI agent names). Config::save() writes back to disk.
  • chunker.rs — smart chunking with break-point scoring algorithm. Finds optimal split points considering headings, code fences, blank lines, and thematic breaks. split_oversized_chunks() handles token-aware secondary splitting with overlap
  • docid.rs — deterministic 6-char hex IDs for files (SHA-256 of path, truncated). Shown in search results for quick reference
  • llm.rs — ML inference via llama.cpp (Rust bindings: llama-cpp-2). Three traits: EmbedModel (embeddings), RerankModel (cross-encoder scoring), OrchestratorModel (query intent + expansion). Three llama.cpp implementations: LlamaEmbed (embeddinggemma-300M GGUF on Metal GPU), LlamaOrchestrator (Qwen3-0.6B for query analysis + expansion), LlamaRerank (Qwen3-Reranker-0.6B for relevance scoring). Global LlamaBackend via OnceLock. Also: MockLlm for testing, HfModelUri for model download, FlexTokenizer (HuggingFace tokenizers + shimmytok GGUF fallback), PromptFormat for model-family prompt templates, heuristic_orchestrate() fast path, LaneWeights per query intent
  • fts.rs — FTS5 full-text search support. Re-exports FtsResult from store. BM25-ranked keyword search
  • fusion.rs — Reciprocal Rank Fusion (RRF) engine. Merges semantic + FTS5 + graph + reranker results. Supports per-lane weighting, --explain output with intent + per-lane detail
  • markdown.rs — section parser. Heading detection (ATX # headings with level tracking), section extraction by heading text, frontmatter splitting (YAML block between --- fences). Powers section-level reading and editing
  • migrate.rs — PARA migration engine. Heuristic classification of vault notes into Projects/Areas/Resources/Archive using priority-ordered rules (tasks, active status, recurring topics, people, reference, done/inactive). Preview-then-apply workflow generates markdown + JSON preview for review before moving files. Rollback support via engraph migrate para --undo reverses the last migration using SQLite migration log. Three MCP tools (migrate_preview, migrate_apply, migrate_undo) and three HTTP endpoints (POST /api/migrate/preview, /apply, /undo)
  • obsidian.rs — Obsidian CLI wrapper. Process detection (checks if Obsidian is running), circuit breaker state machine (Closed/Degraded/Open) for resilient CLI delegation, async subprocess execution with timeout. Falls back gracefully when Obsidian is unavailable
  • health.rs — vault health diagnostics. Orphan detection (notes with no incoming or outgoing wikilinks), broken link detection (wikilinks pointing to nonexistent notes), stale note detection (notes not modified within configurable threshold), tag hygiene (unused/rare tags). Returns structured health report
  • context.rs — context engine. Seven functions: read (full note content + metadata), read_section (targeted section extraction by heading), list (filtered note listing with created_by filter), vault_map (structure overview), who (person context bundle), project (project context bundle), context_topic (rich topic context with budget trimming). Pure functions taking ContextParams — no model loading except context_topic which reuses search_internal
  • vecstore.rs — sqlite-vec virtual table integration. Manages the vec_chunks vec0 table for vector storage and KNN search. Handles insert, delete, and search operations against the virtual table
  • tags.rs — tag registry module. Maintains a tag_registry table tracking known tags with source attribution. Supports fuzzy matching for tag suggestions during note creation
  • links.rs — link discovery module. Three match types: exact basename, fuzzy (sliding window Levenshtein, 0.92 threshold), and first-name (People folder, suggestion-only at 650bp). Overlap resolution via type priority (exact > alias > fuzzy > first-name)
  • placement.rs — folder placement engine. Uses folder centroids (online mean of embeddings per folder) to suggest the best folder for new notes. Falls back to inbox when confidence is low. Includes placement correction detection (detect_correction_from_frontmatter) and frontmatter stripping for moved files
  • writer.rs — write pipeline orchestrator. 5-step pipeline: resolve tags (fuzzy match + register new), discover links (exact + fuzzy), place in folder, atomic file write (temp + rename), and index update. Supports create, append, update_metadata, move_note, archive, unarchive, edit (section-level replace/prepend/append), rewrite (full content with frontmatter preservation), edit_frontmatter (granular set/remove/add_tag/remove_tag/add_alias/remove_alias ops), and delete (soft archive or hard permanent) operations with mtime-based conflict detection and crash recovery via temp file cleanup
  • watcher.rs — file watcher for engraph serve. OS thread producer (notify-debouncer-full, 2s debounce) sends Vec<WatchEvent> over tokio::mpsc to async consumer task. Two-pass batch processing: mutations (index_file/remove_file/rename_file) then edge rebuild. Move detection via content hash matching. Placement correction on file moves. Centroid adjustment on file add/remove. Startup reconciliation via run_index_shared. recent_writes map coordination with MCP server to prevent double re-indexing of files written through the write pipeline
  • serve.rs — MCP stdio server via rmcp SDK. Exposes 22 tools: 8 read (search, read, read_section, list, vault_map, who, project, context) + 10 write (create, append, update_metadata, move_note, archive, unarchive, edit, rewrite, edit_frontmatter, delete) + 1 diagnostic (health) + 3 migrate (migrate_preview, migrate_apply, migrate_undo). edit_frontmatter replaces update_metadata for granular frontmatter mutations. EngraphServer struct with Arc+Mutex wrapping for async handlers. Loads intelligence models (orchestrator + reranker) when enabled, wires into search_with_intelligence. Spawns file watcher on startup. CLI events table provides audit log for write operations. recent_writes map prevents double re-indexing of MCP-written files. HTTP mode also serves openapi.rs routes (/openapi.json, /.well-known/ai-plugin.json) with no auth required
  • http.rs — axum-based HTTP REST API server, enabled via engraph serve --http. 23 REST endpoints mirroring all 22 MCP tools + update-metadata. API key authentication with eg_ prefixed keys and read/write permission levels. Per-key token bucket rate limiting (configurable requests/minute). CORS with configurable allowed origins for web-based agents. --no-auth mode for local development (127.0.0.1 only). Graceful shutdown via CancellationToken coordinating MCP + HTTP + watcher exit
  • openapi.rs — OpenAPI 3.1.0 spec builder and ChatGPT plugin manifest. Hand-written spec for all 23 HTTP endpoints, served at GET /openapi.json. Plugin manifest served at GET /.well-known/ai-plugin.json. Both routes require no authentication. [http.plugin] config section for name, description, contact_email, and public_url. Used by engraph configure --setup-chatgpt for interactive ChatGPT Actions setup
  • graph.rs — vault graph agent. Extracts wikilink targets, expands search results by following graph connections 1-2 hops. Relevance filtering via FTS5 term check and shared tags
  • profile.rs — vault profile detection. Auto-detects PARA/Folders/Flat structure, vault type (Obsidian/Logseq/Plain), wikilinks, frontmatter, tags. Content-based role detection for people/daily/archive folders by content patterns (not just names). Writes/loads vault.toml
  • store.rs — SQLite persistence. Tables: meta, files (with docid, created_by), chunks (with vector BLOBs), chunks_fts (FTS5), edges (vault graph), tombstones, tag_registry, folder_centroids, placement_corrections, link_skiplist (reserved), llm_cache (orchestrator result cache), cli_events (audit log for CLI operations). vec_chunks virtual table (sqlite-vec) for KNN search. Dynamic embedding dimension stored in meta. has_dimension_mismatch() and reset_for_reindex() for migration. Enhanced resolve_file() with fuzzy Levenshtein matching as final fallback
  • indexer.rs — orchestrates vault walking (via ignore crate for .gitignore support), diffing, chunking, embedding, writes to store + sqlite-vec + FTS5, vault graph edge building (wikilinks + people detection), and folder centroid computation. Exposes index_file, remove_file, rename_file as public per-file functions. run_index_shared accepts external store/embedder for watcher FullRescan. Dimension migration on model change.
  • temporal.rs — temporal search lane. Extracts note dates from frontmatter date: field or YYYY-MM-DD filename patterns. Heuristic date parsing for natural language ("today", "yesterday", "last week", "this month", "recent", month names, ISO dates, date ranges). Smooth decay scoring for files near but outside target date range. Provides extract_note_date() for indexing and score_temporal() + parse_date_range_heuristic() for search
  • search.rs — hybrid search orchestrator. search_with_intelligence() runs the full pipeline: orchestrate (intent + expansions) → 5-lane RRF retrieval (semantic + FTS5 + graph + reranker + temporal) per expansion → two-pass RRF fusion. search_internal() is a thin wrapper without intelligence models. Adaptive lane weights per query intent including temporal (1.5 weight for time-aware queries). Results display normalized confidence percentages (0-100%) instead of raw RRF scores.
  • identity.rs — L1 extraction engine: active projects, key people, current focus, OOO, blocking. format_identity_block() for compact session context. extract_l1_facts() called after indexing.
  • onboarding.rs — Interactive CLI UX: welcome banner, vault scan, identity prompts (dialoguer), agent mode (--detect --json, --json). run_interactive(), run_detect_json(), run_apply_json().

Read the full file on GitHub · 118 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. 1mo ago First seen · 118 lines · 4,463 tokens per session scan A 4e125ab3ca57

Subscribe to this mod's changes

engraph CLAUDE.md is an instructions file published in the GitHub repository devwhodevs/engraph (172 stars, last pushed 4mo ago), licensed MIT. It adds 4,463 tokens to every session, about $0.0179 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

Other instructions, from other repositories

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 9,649 tokens

next.js AGENTS.md

AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,549 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, cache eligibility and rollout and applying the notice (cutover).

microsoft/vscode · 5,262 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,680 tokens

vscode copilot-instructions.md

Copilot instructions for microsoft/vscode, covering vs code copilot instructions, project overview, root folders, core architecture (src/ folder) and built-in extensions (extensions/ folder).

microsoft/vscode · 2,731 tokens

deno copilot-instructions.md

Copilot instructions for denoland/deno, covering deno development guide for github copilot, network access, high level overview, key directories and key files to understand first.

denoland/deno · 3,077 tokens