epistract-enhance

epistract-enhance is a command for coding agents from usathyan/epistract. It costs 33 tokens per session (661 once invoked), scanned A, original, MIT.

A set of quality checks for a project's knowledge graph, including checking evidence, merging duplicate entities, and recording changes over time.

In plain words
What is it for?
Use it after building a graph to judge evidence, resolve duplicates such as differently written receptor names, and mark older relationships as superseded instead of deleting them.
Why use it?
It helps identify unsupported relationships, duplicate names, and newer information that conflicts with older information.

Command

Installs and runs on its own, but its text points at files inside its plugin — anything it tells you to read at a ${CLAUDE_PLUGIN_ROOT} path is only there once the plugin is installed. Installing the plugin gets both.

Part of the epistract plugin — 5 skills, 22 commands, 3 agents shipped together

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 commands/usathyan/epistract/enhance
Clone the repo
git clone --depth 1 https://github.com/usathyan/epistract

Or install epistract, the plugin that ships this one along with the rest of its 5 skills, 22 commands, 3 agents.

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 epistract-enhance

README.md
[![agentmods](https://agentmods.dev/badge/commands/usathyan/epistract/enhance.svg)](https://agentmods.dev/commands/usathyan/epistract/enhance)
Your own site
<a href="https://agentmods.dev/commands/usathyan/epistract/enhance"><img src="https://agentmods.dev/badge/commands/usathyan/epistract/enhance.svg" alt="Measured on agentmods" height="20"></a>
Per session 33 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 661 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.00033 $0.00661
Opus 5 $0.00016 $0.00331
Sonnet 5 $0.00007 $0.00132
Haiku 4.5 $0.00003 $0.00066

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

Security

Grade A, and why

epistract-enhance 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 4d 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.

commands/enhance.md · 53 lines

What it actually says

Improve the quality of a project's built knowledge graph with three research-backed passes. Operates on <project>/graph_data.json in place and writes an enhancement_report.json. Runs offline with lexical fallbacks; pass --llm to use a configured LLM for calibrated judgments.

Requires a built graph — run /epistract:build first.

Passes (if none is named, all three run):

  • --judgeLLM-as-judge triple gate (GraphJudge arXiv 2411.17388 / GraphEval arXiv 2407.10793): scores each relation against its evidence span, flags triples whose evidence does not support them.
  • --resolvetwo-stage entity resolution (ComEM arXiv 2405.16884): blocks by type, clusters by character/token/embedding similarity, merges duplicates (e.g. "GLP-1 Receptor" and "GLP1 receptor").
  • --epistemicbi-temporal contradiction layer (Graphiti/Zep arXiv 2501.13956) with graded hedge scoring (arXiv 2405.13319): when a newer relation contradicts an older one, the older edge is marked superseded (not deleted) with provenance; every edge gets a graded hedge_score and epistemic status (asserted / hypothesized / speculative).

Usage Guard

If invoked with no arguments or with --help: Display the following usage block verbatim and stop.

Usage: /epistract:enhance [--project <name>] [--judge] [--resolve] [--epistemic] [--llm]

Options:
  --project <name>   Target project (default: detected from cwd or $EPISTRACT_PROJECT)
  --judge            Only run the triple-judge gate
  --resolve          Only run entity resolution
  --epistemic        Only run the bi-temporal epistemic layer
  --llm              Use the configured LLM instead of the lexical fallback
  (no pass flag)     Run all three passes

Examples:
  /epistract:enhance --project glp1-research
  /epistract:enhance --project glp1-research --judge --llm
  /epistract:enhance --project acme-contracts --epistemic
PYTHONPATH="${CLAUDE_PLUGIN_ROOT}" python3 -m core.cli enhance [--project NAME] [--judge] [--resolve] [--epistemic] [--llm]

Report the merge count, triple-verdict breakdown, and epistemic status counts (including any superseded/contradicted edges). This complements /epistract:epistemic, which builds the domain-specific Super Domain claims narrative.

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. 4d ago First seen · 53 lines · 33 tokens per session scan A 082536593b62

Subscribe to this mod's changes

epistract-enhance is a command published in the GitHub repository usathyan/epistract (8 stars, last pushed 20d ago), licensed MIT. It adds 33 tokens to every session and 661 once invoked, about $0.0002 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-31.