entity-graph

entity-graph is a skill for Claude Code, Codex from TimSimpsonJr/magpie. It costs 69 tokens per session (3,679 once invoked), scanned A, original, MIT.

A workflow for matching the same people and organisations across investigation documents and storing the reviewed network in Neo4j, a graph database.

In plain words
What is it for?
Use it after document review to resolve cross-document identities, approve or reject uncertain pairs, log automatic merges, and write the resulting investigation graph.
Why use it?
It helps remove duplicate entities from a document collection while requiring a human to review uncertain matches and keeping merge decisions reversible.

Skill for Claude CodeCodex

Part of the magpie plugin — 13 skills, 2 agents, 1 MCP server 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 skills/timsimpsonjr/magpie/entity-graph
Any agent
npx skills add TimSimpsonJr/magpie --skill entity-graph
Clone the repo
git clone --depth 1 https://github.com/TimSimpsonJr/magpie

Made for: Claude Code, Codex.

Or install magpie, the plugin that ships this one along with the rest of its 13 skills, 2 agents, 1 MCP server.

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 entity-graph

README.md
[![agentmods](https://agentmods.dev/badge/skills/timsimpsonjr/magpie/entity-graph.svg)](https://agentmods.dev/skills/timsimpsonjr/magpie/entity-graph)
Your own site
<a href="https://agentmods.dev/skills/timsimpsonjr/magpie/entity-graph"><img src="https://agentmods.dev/badge/skills/timsimpsonjr/magpie/entity-graph.svg" alt="Measured on agentmods" height="20"></a>
Per session 69 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,679 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.1 $0.00069 $0.03679
Opus 5 $0.00034 $0.01840
Sonnet 5 $0.00014 $0.00736
Haiku 4.5 $0.00007 $0.00368

Measured 5d ago against content hash ceee69b97c40, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

entity-graph 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.

skills/entity-graph/SKILL.md · 298 lines

How it starts

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

entity-graph

Take the per-document reviewed FtM bundles Phase 12 produced, resolve which entities ACROSS documents are the same real-world person or organization, let a human decide the uncertain matches, and write the resolved network to a Neo4j graph scoped to one investigation. This is the FIRST heavy-infra (Docker) phase.

This is a Layer-2, OPERATOR-tier, Docker-gated workflow. The journalist onramp (JOURNALIST_START, the doctor skill's Track-A capabilities) stays Docker-free and is NOT touched by this skill. Do not pull this flow into any journalist surface.

The differentiator is the MANDATORY HUMAN REVIEW GATE, not the matcher. The matcher (nomenklatura LogicV2, a model-free heuristic) is imperfect on FOIA names; what makes the resolved graph trustworthy is that a person actively decides every uncertain pair and every auto-merge is logged and reversible. NEVER run this flow autonomously past the review gate.

13a (this skill) does resolution + the Neo4j write. Watchlist / sanctions / PEP cross-reference and own-corpus cross-ref (yente + OpenSearch + the yente-mcp server) are the SEPARATE entity-crossref skill (Phase 13b) -- run it AFTER this one, on the resolved snapshot. Do not attempt cross-ref here.


What you need before you start

  • Phase-12 FtM bundles for the corpus documents (the <name>.entities.ftm.json
    • sibling <name>.provenance.jsonl + <name>.manifest.json triples that entity_ftmize.write_bundle produced). Resolution runs ACROSS the whole investigation corpus at once -- pass ALL the bundles together, not one per document. That cross-corpus pass is what lets a homonym in two different documents surface as one review candidate.
  • The Phase-6 source page text for the same documents, reachable through a snippet_resolver callable (see STEP 2) -- the review packet hydrates each candidate's source snippet from it at render time.
  • Docker + Neo4j running (the PRECONDITION below).
  • A per-investigation scratch directory (gitignored). The resolver SQLite DB, the candidate snapshot, the auto-merge log, and run.json all live here. It is per-investigation on purpose (global resolution would contaminate unrelated cases). If a run crashes mid-way, just DISCARD the scratch DB and re-run -- it is disposable.

Read the full file on GitHub · 298 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. 5d ago First seen · 298 lines · 69 tokens per session scan A ceee69b97c40

Subscribe to this mod's changes

entity-graph is a skill published in the GitHub repository TimSimpsonJr/magpie (2 stars, last pushed 2mo ago), licensed MIT. It adds 69 tokens to every session and 3,679 once invoked, about $0.0003 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.

Related

Other skills, from other repositories

pdf-table-extractor-brief

Produces a structured extraction plan and clean spreadsheet template for pulling tabular data out of a PDF document — identifying the table structure, defining column headers, flagging extraction pitfalls, and providing a ready-to-use template that ensures the data lands in a consistent, analysable format.

ur-grue/autopunk-media-skills · 61 tokens

foia-request-writer

Drafts legally complete public records requests (federal FOIA and all 50 state laws), administrative appeals, and redaction challenge strategies for U.S. government records.

ur-grue/autopunk-media-skills · 40 tokens

osint-tool-catalog

Produces a categorised catalog of open-source intelligence tools relevant to a journalist's investigation, with practical guidance on what each tool does, when to use it, and what its limitations are.

ur-grue/autopunk-media-skills · 43 tokens

social-media-intelligence

Produces a structured open-source intelligence brief on a social media account or set of accounts, covering account authenticity analysis, narrative tracking, and coordination-detection patterns to support investigative reporting.

ur-grue/autopunk-media-skills · 40 tokens

data-cleaning-brief

Writes clear, step-by-step instructions for cleaning a messy or inconsistent dataset — specifying exactly what needs to be standardised, corrected, or removed to make the data ready for analysis and publication.

ur-grue/autopunk-media-skills · 44 tokens

data-outlier-finder

Identifies unusual values, unexpected patterns, and potential stories hidden in a dataset by systematically checking for statistical outliers and contextual anomalies.

ur-grue/autopunk-media-skills · 32 tokens