ingest

ingest is a command for Claude Code from lowtidebuild/contract-review. It costs 0 tokens per session (727 once invoked), scanned A, original, Apache-2.0.

A command-line workflow for adding external reference files to a contract-review library. It converts supported files such as PDFs and Word documents into organized Markdown and updates the library indexes.

In plain words
What is it for?
Use it to ingest statutes, court decisions, commentary, sample forms, and other supported reference files from the library inbox.
Why use it?
It reduces the manual work of checking duplicates, extracting text, adding metadata, classifying sources, and placing files in the correct folders.

Command for Claude Code

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/lowtidebuild/contract-review/ingest
Clone the repo
git clone --depth 1 https://github.com/lowtidebuild/contract-review

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 ingest

README.md
[![agentmods](https://agentmods.dev/badge/commands/lowtidebuild/contract-review/ingest.svg)](https://agentmods.dev/commands/lowtidebuild/contract-review/ingest)
Your own site
<a href="https://agentmods.dev/commands/lowtidebuild/contract-review/ingest"><img src="https://agentmods.dev/badge/commands/lowtidebuild/contract-review/ingest.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 727 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.00000 $0.00727
Opus 5 $0.00000 $0.00364
Sonnet 5 $0.00000 $0.00145
Haiku 4.5 $0.00000 $0.00073

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

Security

Grade A, and why

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

.claude/commands/ingest.md · 75 lines

How it starts

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

Library Ingestion Pipeline

You are ingesting documents into the contract review library. The user has placed source files in contract-review/library/inbox/raw/.

$ARGUMENTS


Process

Step 1: Scan inbox

Scan contract-review/library/inbox/raw/ for files. Supported formats: DOCX, PDF, MD, TXT, HTML. If no files are found, inform the user and stop.

Check contract-review/library/inbox/sidecars/ for any matching sidecar metadata files (YAML).

Step 2: Fingerprint & duplicate check

For each file:

  • Generate a SHA-256 content hash
  • Assign a provisional doc_id (lowercase, hyphenated)
  • Compare the hash against existing entries in contract-review/library/indexes/documents.json
  • If exact duplicate found, skip and log

Step 3: Normalize

Convert each file to clean Markdown (clean.md) and plain text (plain.txt):

  • DOCX: extract text preserving heading hierarchy, numbering, and table structure
  • PDF: extract text (requires pdftotext/pymupdf/pypdf)
  • MD/TXT/HTML: normalize formatting

If normalization fails, move the file to contract-review/library/quarantine/ with an error log.

Step 4: Classify

Using the normalized text and policy files (contract-review/library/policies/contract-families.yaml, clause-taxonomy.yaml):

  • Determine: doc_class (template/precedent/playbook/comment_bank), contract_family, subtype, paper_role, jurisdiction, governing_law, language
  • Apply sidecar values first if available, infer only missing fields
  • Assign classification confidence (high/medium/low)

If confidence is low, route to contract-review/library/staging/ for human review.

Step 5: Structural parse

Identify heading hierarchy, section numbering, defined terms, cross-references, and exhibits/annexes. Output as structured JSON.

Step 6: Clause segmentation

Segment the document into clause-level units. Assign each clause a clause_type from clause-taxonomy.yaml. Mark unmapped clauses (do not guess). If unmapped ratio exceeds 30%, flag for human review.

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

Subscribe to this mod's changes

ingest is a command published in the GitHub repository lowtidebuild/contract-review (40 stars, last pushed 1mo ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 727 tokens. 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.