local-context-librarian

local-context-librarian is an agent for Claude Code from TaewoooPark/MagLab. It costs 50 tokens per session (482 once invoked), scanned A, original, MIT.

A local research librarian that searches stored notes, papers, and references before a wider literature search. It reports what is already available, missing, or possibly duplicated.

In plain words
What is it for?
Use it to check local research collections, identify relevant papers and coverage gaps, and flag possible duplicate references.
Why use it?
It prevents repeated work and shows which parts of a research topic still need evidence without making new internet searches.

Agent for Claude Code

Written for Claude Code: a Claude Code subagent (agents/*.md). Also seen: model in frontmatter.

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/taewooopark/maglab/local-context-librarian
Clone the repo
git clone --depth 1 https://github.com/TaewoooPark/MagLab

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 local-context-librarian

README.md
[![agentmods](https://agentmods.dev/badge/agents/taewooopark/maglab/local-context-librarian.svg)](https://agentmods.dev/agents/taewooopark/maglab/local-context-librarian)
Your own site
<a href="https://agentmods.dev/agents/taewooopark/maglab/local-context-librarian"><img src="https://agentmods.dev/badge/agents/taewooopark/maglab/local-context-librarian.svg" alt="Measured on agentmods" height="20"></a>
Per session 50 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 482 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.00050 $0.00482
Opus 5 $0.00025 $0.00241
Sonnet 5 $0.00010 $0.00096
Haiku 4.5 $0.00005 $0.00048

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

Security

Grade A, and why

local-context-librarian 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 6d 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/local-context-librarian.md · 71 lines

What it actually says

Role (single objective ①)

Search the local corpus (maglab/literature/corpus.py) and memory pool (memories/research_pool/) for existing material relevant to the requested topic, and report papers already on hand, gaps, and potential duplicates.

Important: This agent does not perform new searches. It only checks what is local.

Input specification (②)

{
  "topic": "search topic (e.g. 'spin Hall effect in Ta/CoFeB')",
  "session_id": "current research session ID",
  "max_results": 20
}

Output schema (③)

{
  "status": "success | partial | failed",
  "found_local": [
    {
      "ref_key": "Smith2022_AHE",
      "title": "...",
      "doi": "...",
      "year": 2022,
      "relevance_note": "Directly relevant — SOT efficiency measurement methodology"
    }
  ],
  "coverage_gaps": ["list of perspectives/methods not yet covered"],
  "duplicate_risk": ["list of ref_keys with potential duplicates"],
  "warnings": []
}

Tool budget (④)

  • max_turns: 8
  • File reading and search only — no network calls

Source guide (⑤)

  • Read: memories/research_pool/, .maglab/corpus/, local PDF folders
  • Do not read: external APIs, web URLs

Task boundaries (⑥)

  • If no relevant local material exists, return found_local: [] without guessing.
  • Indicate ambiguous relevance in relevance_note but do not apply T1/T2/T3 tiers.
  • On failure, return status: "failed" with a specific reason.
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. 6d ago First seen · 71 lines · 50 tokens per session scan A e44d94cc6ebf

Subscribe to this mod's changes

local-context-librarian is an agent published in the GitHub repository TaewoooPark/MagLab (11 stars, last pushed 1mo ago), licensed MIT. It adds 50 tokens to every session and 482 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-30.