entity-extract

entity-extract is a skill for Claude Code from TimSimpsonJr/magpie. It costs 119 tokens per session (2,110 once invoked), scanned A, original, MIT.

A document-analysis workflow that finds people, organizations, agencies, vendors, and their connections in a trusted ingested document. It turns those findings into a reviewed relationship graph, with the source of each statement recorded.

In plain words
What is it for?
Use it to examine FOIA PDFs and other ingested documents, extract named entities and relationships, map their connections, and produce a reviewed Follow the Money-shaped intermediate record.
Why use it?
It prevents untrusted documents from being analyzed and adds a required human review before extracted claims are accepted. This helps keep names, relationships, and evidence traceable.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the magpie plugin — 13 skills, 2 agents, 1 MCP server shipped together

Good fit Use it to examine FOIA PDFs and other ingested documents, extract named entities and relationships, map their connections, and produce a reviewed Follow the Money-shaped intermediate record.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/timsimpsonjr/magpie/entity-extract
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.

Any agent
npx skills add TimSimpsonJr/magpie --skill entity-extract
Clone the repo
git clone --depth 1 https://github.com/TimSimpsonJr/magpie

Made for: Claude Code.

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-extract

README.md
[![agentmods](https://agentmods.dev/badge/skills/timsimpsonjr/magpie/entity-extract.svg)](https://agentmods.dev/skills/timsimpsonjr/magpie/entity-extract)
Your own site
<a href="https://agentmods.dev/skills/timsimpsonjr/magpie/entity-extract"><img src="https://agentmods.dev/badge/skills/timsimpsonjr/magpie/entity-extract.svg" alt="Measured on agentmods" height="20"></a>
Per session 119 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,110 The whole file, excluding the scripts and references it only reads on demand.
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.00119 $0.02110
Opus 5 $0.00060 $0.01055
Sonnet 5 $0.00024 $0.00422
Haiku 4.5 $0.00012 $0.00211

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

Security

Grade A, and why

entity-extract 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 8d 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-extract/SKILL.md · 169 lines

How it starts

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

entity-extract

entity-extract is the first Track-B skill. It turns ONE trustworthy ingested document into a REVIEWED, FtM-shaped intermediate -- but only after a mandatory human gate clears every claim. It runs GLiNER entity NER + GLiREL relation extraction, maps the result deterministically to an FtM-shaped graph with per-statement provenance, and emits a followthemoney-free reviewed intermediate.

Engines (all pure or lazy -- nothing heavy imports until you call a real model):

  • scripts/entity_extract.py -- the pure core: docling_to_extraction_input, extract(), build_intermediate(), ReviewQueue, Statement. stdlib only.
  • scripts/entity_taxonomy.py -- resolve(), the entity/relation taxonomy (generic default + the surveillance/flock preset).
  • scripts/entity_models.py -- the lazy GLiNER/GLiREL edge (gliner/glirel/spaCy imported only on first predict).

No .mcp.json ships -- this skill drives the scripts directly.

0. Refuse a non-trustworthy document (checked first)

The ONLY upstream input is a Phase-6 ingest DoclingDocument JSON plus its IngestResult. Normalize it first:

from scripts.entity_extract import docling_to_extraction_input
doc = docling_to_extraction_input(
    docling_json,
    doc_id=source_sha256,                       # the ingest source hash
    trustworthy_for_extraction=ingest_result_bool,
)

extract() then REFUSES (returns refused=True, an empty queue) when trustworthy_for_extraction is false -- i.e. the ingest decision was review or PARTIAL_SUCCESS. Key on the BOOLEAN, never the decision string: this is the SAME Phase-8 trust seam investigate uses. There is NO override in v1 -- a non-trustworthy document never auto-extracts.

1. Resolve the taxonomy + extract

from scripts.entity_taxonomy import resolve
from scripts.entity_models import GlinerEntityExtractor, GlirelRelationExtractor

taxonomy = resolve("generic")        # or resolve("flock")
result = extract(
    doc,
    taxonomy=taxonomy,
    namespace="<run name>",
    entity_extractor=GlinerEntityExtractor(),
    relation_extractor=GlirelRelationExtractor(),
    threshold=0.4,
)

Read the full file on GitHub · 169 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. 8d ago First seen · 169 lines · 119 tokens per session scan A 4a4ca4378c32

Subscribe to this mod's changes

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

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

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