/agent-loops:literature-searchfrom agent-loops
Provides scholarly literature retrieval via Semantic Scholar and arXiv for paper discovery, citation-graph traversal, full-text snippet search, and experimental-result extraction. Useful when a loop needs academic paper data.
Ships in agent-loops. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
This skill is not a loop — it is the literature-retrieval dependency several loops use for paper
discovery and novelty checks. It bundles tools/lit_search.py (a stdlib-only entrypoint) and the
tools/lit/ package: Semantic Scholar (S2) for semantic search + snippets + the citation graph and
arXiv for full-text reads (the keyless core), plus optional OpenAlex, Perplexity Sonar (ask), and
bgpt.pro (bgpt) when their keys are set. Every subcommand prints JSON; on a terminal failure it
prints {"error","fallback"} and exits non-zero so the caller degrades to its built-in
WebSearch/WebFetch. No installs, Python ≥3.9.
A consuming loop resolves these once at setup and reuses them:
<lit_skill_dir> — where this skill is installed. After cp -r loops/* ~/.claude/skills/ it
sits as a sibling of the calling loop, e.g. ~/.claude/skills/literature-search/ (adjust per
host). If it cannot be resolved, the caller falls back to WebSearch/WebFetch — depending on it never
hard-breaks a loop, it only enriches it.<lit> — the literature CLI as a single command token: <lit_skill_dir>/tools/lit_search.py.
The entrypoint is executable and carries a #!/usr/bin/env python3 shebang, so it runs directly with
no python3 prefix. To reuse a cache across calls, append --cache-dir <sandbox_root>/literature/.cache
after the subcommand (a per-subcommand flag, not global).<lit_py> — only needed for the fallback form on a host that doesn't honour the execute bit:
<lit_py> <lit_skill_dir>/tools/lit_search.py, with <lit_py> = python3 (any ≥3.9 interpreter).Invoke
<lit>as one command — keep it a single shell token. In particular zsh does not word-split unquoted variables, so storing the two-wordpython3 .../lit_search.pyin a variable and calling$VARtries to exec one long (nonexistent) filename. Use the executable single-token form above, call the script path directly, or split explicitly (${=VAR}in zsh).
| Subcommand | Use |
|---|---|
<lit> search "<q>" [--year 2020-] [--min-citations N] [--limit N] [--source s2|openalex|both] [--sort relevance|citations|recent] | semantic discovery — related papers (titles, TLDR, abstract, citations, arxiv_id). Defaults to --source s2 (relevance); add openalex/both to widen discovery |
<lit> snippet "<q>" [--limit N] | full-text passage search — pinpoint a verbatim fact/number without reading a paper |
<lit> cite <paperId> --direction references|citations|recommend | walk the citation graph (backward / forward / "more like this") |
<lit> fulltext <arxivId> [--mode auto|latex|pdf] | deep-read one paper's methods/results (HTML > LaTeX > PDF) |
<lit> ask "<question>" [--model sonar|sonar-pro|sonar-reasoning] | Perplexity Sonar synthesis — a cited high-level answer (needs OPENROUTER_API_KEY; else use WebSearch) |
<lit> bgpt "<q>" [--num N] [--days-back N] | bgpt.pro structured experimental-result/limitations extraction (free for 50 results, then BGPT_API_KEY) |
<lit> keys [--init] | report which API keys are present (booleans only); --init writes/extends keys.env |
The S2 + arXiv core (search/snippet/cite/fulltext) needs no keys. The optional extras
(search --source openalex|both, ask, bgpt) widen discovery and synthesis when their keys are set.
This skill is the canonical home for the project's key convention (it is the installed code that
implements it). Keys live in one gitignored keys.env at the project root (the nearest .git
ancestor of the working dir, else the CWD), shared by every skill in the project.
KEY=VALUE lines; # comments; blank lines ignored; 0600 perms.export).keys.env themselves; skills read only
presence as booleans, never values.Onboarding flow: <lit> keys (report what's present) → <lit> keys --init (create/append slots,
append-only, never overwrites; prints the path) → user opens keys.env and pastes the keys they want
(in-session: ! $EDITOR ./keys.env) → <lit> keys again, then proceed. Never block on keys.
S2_API_KEY (free) — the one most worth setting; a dedicated 1 req/s for search/snippet/cite.OPENALEX_EMAIL (free, any email) — OpenAlex "polite pool" for faster --source openalex|both.OPENROUTER_API_KEY (paid) — enables ask (Perplexity Sonar); without it ask is disabled.BGPT_API_KEY (free for 50 results, then paid) — enables bgpt beyond the free tier.python3.../ escapes, no docs/ links.{"error","fallback"} and exit non-zero
rather than raising, so callers degrade cleanly.tools/lit/__init__.py (opens in a new tab)tools/lit/cli.py (opens in a new tab)tools/lit/http.py (opens in a new tab)tools/lit/keys.py (opens in a new tab)tools/lit/normalize.py (opens in a new tab)tools/lit/sources/__init__.py (opens in a new tab)tools/lit/sources/arxiv.py (opens in a new tab)tools/lit/sources/bgpt.py (opens in a new tab)tools/lit/sources/openalex.py (opens in a new tab)tools/lit/sources/semantic_scholar.py (opens in a new tab)tools/lit/sources/sonar.py (opens in a new tab)tools/lit_search.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub gaasher/agent-loop-skills --plugin agent-loops25 skills in this plugin
/alpha-evolveUse when the user wants to evolve an ML model/program through population-based search rather than a single sequential refine loop — a generational evolution where parallel proposers each apply one small SEARCH/REPLACE diff to a parent, scored by a cascade-evaluated training run, and children are kept in a MAP-Elites archive across islands (with migration + checkpointing) so diverse high performers survive. A finite, bounded-parallelism re-creation of AlphaEvolve/OpenEvolve, bent for ML autoresearch. Runs to a fixed compute budget or until interrupted. Not for the sequential single-thread autoresearch loops (one change → measure → keep/revert), and not for verifying a known bug or external claim — this is parallel, diversity-preserving search over a program.
/anomaly-investigationUse when the user has a known, already-observed anomaly in their data — a metric spike or drop, an outlier, an unexpected number — and wants its root cause diagnosed, not guessed. Forms a slate of candidate causes, tests each against the data, and eliminates the ones the data refutes, narrowing the live candidates until exactly one survives refutation and passes a positive confirming test. The result is an investigation log with the confirmed root cause and the evidence that ruled out the alternatives. Not for open-ended discovery over a dataset with no specific anomaly in hand (that is data-analysis), and not for checking an external claim against sources (that is claim-verify) — this is reactive diagnosis of one anomaly you already know about.
/blue-teamUse when the user has concrete failing cases in code or a guardrail/classifier/filter/prompt/API they own — a red-team failure catalogue OR a CI/CD test-failure report (failing pytest/JUnit tests) — and wants the target patched until those failures are closed without breaking what already works. It points straight at the failed cases (normalize any source with tools/ingest.py), fixes one root-cause class per iteration, and re-checks with tools/verify.py — oracle mode against a red-team oracle, or tests mode against the test suite — keeping a patch only if it closes a class while nothing that passed before regresses, else reverting; loops until every class is closed (dry) or the budget runs out, then opens a pull request with the patch set. The defensive fixer half of a find→fix setup. Not for discovering new failures (that is red-team), and not for editing the oracle, tests, or holdout that define ground truth.
/claim-verifyUse when the user has a results draft or a set of data-backed claims and wants each one adversarially verified against the underlying dataset before publishing — a pre-publication red-team of the findings. Extracts the discrete checkable claims from the draft, reproduces each claim's number against the data, stress-tests it against the threats most likely to kill it (outliers, confounds, Simpson's reversals, tiny subgroups, alternative specifications), and marks it verified, fragile, or refuted; fragile and refuted claims are revised — hedged, scoped, or retracted — until every claim is verified or appropriately qualified. The result is a draft where every surviving claim has been reproduced and survived a stress test. Not for open-ended discovery of new findings over a dataset (that is a data-analysis task), and not for diagnosing a single known anomaly or pipeline failure — this is a gate over an existing draft.
/data-analysisUse when the user wants an iterative, self-checking exploratory analysis of a dataset — surfacing findings that are each verified by re-running the computation, not asserted. Proposes one specific hypothesis at a time, writes and runs analysis code to test it, and records the finding only if the numbers support it at a meaningful effect size; loops until no new verified finding appears or the budget is hit. The result is a findings report where every claim is backed by a reproducible number. Not for diagnosing a single known anomaly or pipeline failure, and not for verifying an external claim against sources (that is a claim-verification task) — this is open-ended discovery over a bound dataset.
/dueling-autoresearchUse when the user wants two approaches raced head-to-head on a single shared metric — e.g. a classical/algorithmic lane vs an ML/learned lane, or any two strategies for the same task. Each lane runs its own analysis-first research loop confined to its lane, the lanes share a scoreboard and may borrow ideas across the boundary without abandoning their identity, and a shared eval keeps the head-to-head honest; loops until interrupted, reporting the current leader. Not for improving a single approach in isolation (use a single-track research loop), and not for picking between two finished artifacts in one shot (that is a one-time comparison).
Other plugins' skills for the same job