ingest

ingest is a command for Claude Code from slowww-ai/second-brain. It costs 15 tokens per session (809 once invoked), scanned A, original, MIT.

A command for turning new files in a wiki's raw folder into shorter, connected notes. It handles Markdown, images, and PDFs, preserving the original files while adding descriptions or transcriptions when needed.

In plain words
What is it for?
Use it to find unprocessed captures, transcribe image or PDF content, create companion notes, and distill raw Markdown into linked wiki notes.
Why use it?
It reduces the work of organizing saved material and helps prevent raw captures from remaining unreadable or disconnected from the rest of the wiki.

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/slowww-ai/second-brain/ingest
Clone the repo
git clone --depth 1 https://github.com/slowww-ai/second-brain

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/slowww-ai/second-brain/ingest.svg)](https://agentmods.dev/commands/slowww-ai/second-brain/ingest)
Your own site
<a href="https://agentmods.dev/commands/slowww-ai/second-brain/ingest"><img src="https://agentmods.dev/badge/commands/slowww-ai/second-brain/ingest.svg" alt="Measured on agentmods" height="20"></a>
Per session 15 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 809 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.00015 $0.00809
Opus 5 $0.00008 $0.00404
Sonnet 5 $0.00003 $0.00162
Haiku 4.5 $0.00002 $0.00081

Measured 4d ago against content hash f1373ae27032, 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 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.

.claude/commands/ingest.md · 36 lines

What it actually says

Your job is to turn new raw captures into clean, linked wiki notes.

Steps:

  1. Run python scripts/ingest.py list-new to find raw files not yet referenced by any note. Also list any images or PDFs in wiki/raw/ that don't yet have a companion .md file — those need to be processed too.
  2. Non-text captures first. For every image or PDF in raw/ without a companion .md:
    • Read the file directly (Claude can see images and PDFs natively).
    • Create raw/<same-name>.md with frontmatter, a description, a full transcription of any visible text/tables, and an image: or pdf: reference line.
    • Do NOT modify or delete the original binary file.
    • Treat the new companion .md as a raw capture and continue with the normal flow below.
  3. For each new raw markdown file (including companions just created): a. Read it according to its length. First check line count (wc -l <path> or the file header from Read). Then:
    • Under 500 lines — read the entire file in one pass. No shortcuts.
    • 500–2000 lines — read the entire file, in sequential chunks if needed. Distill aggressively into short notes, but do not skip sections.
    • Over 2000 lines — read the first ~200 lines to get structure and thesis, scan the table of contents / headers, then read in full the sections most relevant for distillation and linking. It's fine to skip appendices, repetitive examples, or sections clearly tangential to the core concepts.
    • Always report read-coverage in your final summary as read X/Y lines of <file> so shallow reads are never silent. If coverage is under 100%, note which sections you skipped and why, so the user can request a follow-up deep pass. b. Run python scripts/ingest.py stamp <path> if it has no frontmatter yet. c. Identify the 1–3 core concepts in the file. d. For each concept, decide: does a matching note already exist in wiki/notes/? Use python scripts/search.py "<concept>" to check. e. If yes → append a distilled paragraph to that note and cite the raw file (see raw/<filename>). f. If no → create a new note in wiki/notes/<slug>.md with proper frontmatter, a short summary, and [[wikilinks]] to any related existing notes. If the source was an image or PDF, embed it inline with ![](../raw/<name>.png).
  4. Add backlinks: if note A now references note B, make sure B has an entry pointing back to A when it's meaningful.
  5. Never modify or delete original files in wiki/raw/ (companion .md files you just created are fine to edit).
  6. Record each processed raw file in the ledger. After you finish distilling a raw file, run:
    python scripts/ingest.py record <raw-filename> <note1,note2,...>
    
    where the second argument is a comma-separated list of note IDs (filenames without .md) produced or updated from that raw file. This is how the ledger tracks what's been ingested — without it, the file will show up as "new" on every run.
  7. At the end, print a short summary: how many raw files processed, how many notes created, how many notes updated, and which decisions you're least sure about so the user can correct you.

Remember: small, focused notes are better than big ones. Split when in doubt.

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 · 36 lines · 15 tokens per session scan A f1373ae27032

Subscribe to this mod's changes

ingest is a command published in the GitHub repository slowww-ai/second-brain (10 stars, last pushed 20d ago), licensed MIT. It adds 15 tokens to every session and 809 once invoked, about $0.0001 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.