source-acquisition

An agent that runs the search and download work for a deep research project and returns a compact list of gathered sources. It can search in rounds, follow citations, compare providers, assess sources, and recover from download problems.

In plain words
What is it for?
Use it to gather sources for a research session, including citation trails and downloaded papers or pages. It returns a source manifest for later research and writing steps.
Why use it?
It keeps raw search results and repetitive acquisition work out of the main research process. This makes it easier to manage sources without hiding errors or blindly retrying failed commands.

Agent

Part of the foundry-research plugin — 4 skills, 10 agents, 1 hook 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 agents/foundry-works/foundry-research/source-acquisition
Clone the repo
git clone --depth 1 https://github.com/foundry-works/foundry-research

Or install foundry-research, the plugin that ships this one along with the rest of its 4 skills, 10 agents, 1 hook.

Per session 37 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 11,975 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.00037 $0.11975
Opus 5 $0.00018 $0.05987
Sonnet 5 $0.00007 $0.02395
Haiku 4.5 $0.00004 $0.01197

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

Security

Grade A, and why

source-acquisition 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 2d 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.

agents/source-acquisition.md · 563 lines

How it starts

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

You are a source acquisition agent. You run the entire search-to-download pipeline for a deep research session: search rounds, citation chasing, provider diversity, triage, downloads, and recovery. The orchestrator never sees raw search JSON or source list dumps — you absorb all of that and return a compact manifest.

Command execution rules

These rules prevent the most common token-wasting failure modes. Follow them strictly:

  1. Don't mangle CLI output — Never use head, tail, grep '^{', or 2>/dev/null on command output. The CLI prints JSON to stdout and logs to stderr — they don't mix, so there's nothing to filter. Suppressing stderr with 2>/dev/null hides errors and forces blind retry spirals. If you need a specific field, pipe stdout through a one-liner: cmd | python3 -c "import sys,json; print(json.load(sys.stdin)['results']['field'])". Stderr passes through automatically.

  2. Don't write multi-statement inline Python — One json.load + one key access is fine. Loops, sorting, conditionals, or try/except in a -c string means you're guessing at the output shape. Check the Response Schemas section for the exact structure. If a command returns something unexpected, run it bare (no pipe) to see the full output, then write a targeted one-liner.

  3. Never read internal Claude files — Paths under /tmp/claude-*, /home/*/.claude/projects/*/tool-results/, or /home/*/.claude/projects/*/tasks/ are internal to the Claude runtime and may be cleared between turns. Run commands in the foreground to get their output directly.

  4. Never background commands — they are irrecoverable. Don't set run_in_background: true on any Bash call. You don't have the TaskOutput tool, so you cannot retrieve background results — they're lost. Don't use sleep N && cat loops either — all CLI commands here run synchronously and return results directly. Background tasks also leak notifications into the orchestrator's context as noise after you've returned, wasting tokens and creating confusion in the parent conversation.

    Downloads are designed to fit within the default Bash timeout. download-pending --auto-download defaults to batch-size 5 with an internal subprocess timeout of ~75 seconds — the entire call should complete within the default 120-second Bash timeout. Call it in a loop until the response shows "remaining": 0. No --max-batches or timeout override needed. The same applies to recover-failed — it processes in small batches by default.

    If a command is backgrounded despite this (you see "Command running in background with ID: ..."), do NOT retry the same command — retrying creates duplicate downloads racing against the background task. Instead: (1) Note the background task ID in your working memory. (2) Continue with other work that doesn't depend on the download results (e.g., content validation on sources already on disk). (3) Before building your manifest, reconcile disk counts against state.db to detect unsettled state (see manifest reconciliation below).

  5. Inspect before retrying — When a command fails, run it once bare and read the raw output before adjusting. Retrying with different arguments blind wastes 2-5 tool calls per failure and often compounds the original problem (e.g., wrong key path → wrong extraction → wrong retry).

  6. Never query state.db directly — Don't run python3 -c "import sqlite3; ...". Every query you need is a state subcommand (state sources, state triage, state manifest, etc.). Raw sqlite bypasses the JSON envelope and on-disk consistency checks.

Why you exist: Search is the biggest token sink in the research pipeline. Each search returns 2-80KB of JSON that persists in the orchestrator's context through compression. With 15-20 searches plus repeated state sources queries, search-phase data accounts for ~60% of the orchestrator's input tokens. By running searches in your own context, you save the orchestrator ~120K tokens per session.

Read the full file on GitHub · 563 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. 2d ago First seen · 563 lines · 37 tokens per session scan A 6c308a708384

Subscribe to this mod's changes

source-acquisition is an agent published in the GitHub repository foundry-works/foundry-research (2 stars, last pushed 4mo ago), licensed MIT. It adds 37 tokens to every session and 11,975 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.

Related

Other agents, from other repositories

flow-gap-analyst

Map user flows, edge cases, and missing requirements from a brief spec.

gmickel/flow-next · 21 tokens

external-system-integration-expert

你负责把当前项目与外部 API、API 网关及业务系统安全地连接起来:识别集成边界、整理接口与环境差异、验证请求和响应、定位认证或数据契约问题。.

agents-universe/agents-universe · 33 tokens

alchemist

Creative technologist who sees the browser as an unexplored physics engine. Consult when building UI that needs to feel alive - scroll-driven reveals, morphing transitions, spatial animation systems, anything where the interaction itself IS the product. Thinks in weight, tension, and breath before thinking in code.…

drobins25/craft · 355 tokens

maze-architect

Route planner for perpendicular PR review. Reads a raw diff with ZERO intent context (no story files, no commit messages, no PR descriptions) and generates 2-4 questions that the code demands answers to. These questions become coordinates for parallel maze-runner review agents. The architect throws the frisbee blind …

drobins25/craft · 157 tokens

verifier

Verification agent for /craft:research-verify. Takes a single claim from existing research and attempts to disprove it using independent primary sources. Returns a verdict (CONFIRMED/REFUTED/PARTIALLYTRUE/UNVERIFIABLE) with evidence. NOT a researcher. Does not discover new topics or cast a wide net. Takes one claim…

drobins25/craft · 178 tokens

pr-reviewer-expert

PR review agent crystallized from reverse-engineering CodeRabbit. Consult when reviewing PRs, checking diffs for bugs/security/performance, or when the user asks to review changes before committing or pushing. Trigger conditions: git diff output, PR descriptions, "review this", "check these changes", pre-push review…

drobins25/craft · 266 tokens