Builds a searchable Asta document index from local PDFs by extracting text, chunking into segments, and writing a YAML index for semantic search.
Ships in asta-tools. 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.
Build a searchable Asta document index from a collection of local PDF files. Each PDF is converted to markdown, split into ~2000-character chunks, and written as documents to an asta-documents YAML index — enabling semantic search across the full text of the collection.
This skill includes standalone scripts in the assets/ directory:
| Script | Purpose |
|---|---|
assets/extract-pdfs.sh | Convert PDFs to markdown via asta pdf-extraction remote |
assets/chunk-and-index.py | Chunk markdown files and write the YAML index directly |
assets/warm-cache.sh | Run an initial search to build the search cache |
Locate the assets directory relative to this skill file. The scripts are self-contained and can be copied to the working directory or run in place.
Before starting, ask the user for four things:
my-papers, cs-reading-list).Suggest a directory layout where the PDFs and markdown live as siblings under a common parent, with the index file alongside them. For example, if the PDFs are at /data/papers/pdfs/:
/data/papers/ # DATASET_ROOT — parent of everything
├── pdfs/ # PDF_DIR (user already has this)
├── markdown/ # MARKDOWN_DIR (suggested: sibling of pdfs/)
│ ├── paper1.md # without --images: flat .md files
│ ├── paper2.md
│ ├── paper3/ # with --images: per-PDF subdirectories
│ │ ├── paper3.md
│ │ └── img-0.jpeg
│ └── ...
└── index.yaml # INDEX_PATH (auto-created here)
This layout matters because the index stores relative paths to the markdown files. Keeping everything under one root makes the index portable and git-friendly.
Key rules for the suggestion:
.asta.DATASET_ROOT is the parent directory that contains both PDF_DIR and MARKDOWN_DIR.DATASET_ROOT/index.yaml./home/user/research/pdfs, suggest /home/user/research/markdown and /home/user/research/index.yaml.Once the user confirms (or provides their own paths), set these variables:
PDF_DIR="/data/papers/pdfs" # user-provided
MARKDOWN_DIR="/data/papers/markdown" # user-confirmed
DATASET_ROOT="/data/papers" # parent of both
INDEX_PATH="$DATASET_ROOT/index.yaml" # derived
COLLECTION="my-papers" # user-chosen
IMAGES=false # true if user wants images
PDF_COUNT=$(find "$PDF_DIR" -name "*.pdf" -type f | wc -l)
TOTAL_SIZE=$(find "$PDF_DIR" -name "*.pdf" -type f -exec du -ch {} + | tail -1 | awk '{print $1}')
echo "Found $PDF_COUNT PDFs ($TOTAL_SIZE total)"
Present this estimate to the user before proceeding:
| Metric | Estimate |
|---|---|
| PDFs found | N files |
| Total size on disk | X MB |
| Extraction time | ~2-5 min per 10-page PDF (remote API); faster with olmocr for batches >20 |
| Chunking + indexing | ~1-2 seconds per PDF |
| Index storage | ~2-3x the extracted text size (markdown files + YAML with chunk text) |
| Cache warm-up | 5-30 seconds (one-time, after indexing) |
| Total estimated time | Dominated by extraction: roughly N_papers x 3 min |
Ask the user to confirm before starting, especially for large collections (>20 PDFs).
# Without images (flat layout: markdown/paper.md)
bash /path/to/assets/extract-pdfs.sh "$PDF_DIR" "$MARKDOWN_DIR"
# With images (per-PDF subdirectories: markdown/paper/paper.md + images)
bash /path/to/assets/extract-pdfs.sh --images "$PDF_DIR" "$MARKDOWN_DIR"
Pass --images only if the user opted in during Step 0. When --images is used, each PDF gets its own subdirectory under MARKDOWN_DIR to avoid image filename collisions across PDFs. The chunking script in Step 3 handles both layouts automatically.
The script:
For large batches (>20 PDFs), asta pdf-extraction olmocr with --workers is significantly faster. See the pdf-extraction skill for details.
uv run --with pyyaml python3 /path/to/assets/chunk-and-index.py "$COLLECTION" "$MARKDOWN_DIR" --index-path "$INDEX_PATH" --pdf-dir "$PDF_DIR"
The --index-path argument is required. The script:
url field — making the index portable across machines. The indexed document is the markdown: its url points at the .md file.url; safe to re-run).md by iterating --pdf-dir and matching on basename (the per-PDF subdirectory name, or the flat file stem) — it finds the PDF actually on disk rather than assuming a filename. A .md with no matching PDF is indexed without a source_pdf and warned about.extra): collection, plus source_pdf (a relative/file:// pointer to the upstream PDF) only when --pdf-dir is given and a matching PDF is foundchunk_index, total_chunks, chunk_chars, chunk_offset, file_chars (in extra)<collection-name>, plus pdf-index for PDF-derived markdown or md-index for raw markdownOptions:
--chunk-size 2000 — adjust chunk size (default 2000 chars)--pdf-dir "$PDF_DIR" — directory of upstream source PDFs. Omit it when indexing authored markdown (see Indexing raw markdown below).bash /path/to/assets/warm-cache.sh "$DATASET_ROOT"
The argument is required:
$DATASET_ROOT — the root directory containing index.yamlThis step is required. The first search after indexing builds the internal BM25 + embedding indexes. Without warming, the user's first real search will be unexpectedly slow.
asta documents --root "$DATASET_ROOT" list --tags="$COLLECTION"
asta documents --root "$DATASET_ROOT" show
Tell the user:
DATASET_ROOT pathINDEX_PATHasta documents --root "$DATASET_ROOT" search --summary="query" --tags="COLLECTION"After building, search across all indexed PDFs:
# Semantic search within the collection
asta documents --root "$DATASET_ROOT" search --summary="neural network architecture" --tags="my-papers"
# With relevance scores
asta documents --root "$DATASET_ROOT" search --summary="attention mechanism" --tags="my-papers" --show-scores
# Filter by source PDF
asta documents --root "$DATASET_ROOT" search --extra=".source_pdf contains some-paper"
# List all documents in the collection
asta documents --root "$DATASET_ROOT" list --tags="my-papers"
If your corpus is already markdown (authored .md docs, exported notes, an
investigation record, a wiki), there is nothing to extract — skip Steps 1–2 and
point the chunker straight at the markdown directory. Just omit --pdf-dir:
COLLECTION="my-notes"
MARKDOWN_DIR="/data/notes" # a tree of .md files (rglob, nested OK)
INDEX_PATH="/data/notes/index.yaml"
uv run --with pyyaml python3 /path/to/assets/chunk-and-index.py \
"$COLLECTION" "$MARKDOWN_DIR" --index-path "$INDEX_PATH"
bash /path/to/assets/warm-cache.sh "$(dirname "$INDEX_PATH")"
asta documents --root "$(dirname "$INDEX_PATH")" search \
--summary="your query" --tags="$COLLECTION" --show-scores
The markdown is the source: each document's url points at the .md, the
secondary tag is md-index, and extra.source_pdf is absent (there is no
upstream PDF). Chunking, relative-path URLs, and resumability are identical to
the PDF path — the only difference between the two is whether extra.source_pdf
is present.
| Collection size | Approx. index size | Approx. markdown size |
|---|---|---|
| 10 PDFs (~10 pp each) | 2-5 MB | 1-3 MB |
| 50 PDFs (~10 pp each) | 10-25 MB | 5-15 MB |
| 100 PDFs (~10 pp each) | 20-50 MB | 10-30 MB |
Total storage is roughly 2-3x the extracted text (markdown files + index YAML with chunk text in the summary field).
| Stage | Per PDF | Notes |
|---|---|---|
| Extraction (remote) | 2-5 min / 10 pages | API-bound; 50-page limit per call |
| Extraction (olmocr) | 10-20 sec / page, parallel | Better for >20 PDFs |
| Chunking + indexing | 1-2 seconds | Single YAML write, fast |
| Cache warming | 5-30 seconds total | One-time after indexing |
asta documents search --summary=... builds the search index. Always run the warm-cache script after indexing.index.yaml first.pyyaml. Install with pip install pyyaml or uv pip install pyyaml if not available.markdown/paper.md) so the dataset is portable. This requires the markdown directory to be under the same directory as the index file.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
/asta-tools:local-paper-indexfrom asta-tools
npx claudepluginhub allenai/asta-plugins --plugin asta-tools17 skills in this plugin
/analyze-dataThis skill should be used when the user asks to "analyze this dataset", "run datavoyager", "run data voyager", "explore this data", "what's in this CSV", "statistical analysis of", "find patterns in", or wants an AI-driven, code-executing analysis of a tabular dataset that answers a specific research question./artifactsUse this skill to export and open A2A agent task outputs — "export the task results", "convert the task output to HTML", or work with the structured artifacts produced by an A2A agent task run./asta-cliInstall or update the `asta` CLI to the version pinned by this plugin. Invoke whenever `asta` is not on PATH (e.g. `command not found` for `asta`) or when a subcommand/flag appears missing — that signals a stale install needing an update./asta-documentsLocal document metadata index for files used by Asta skills and tools. Use this skill when the user asks to store a document "in Asta" or retrieve "from Asta". Use it when the user references an "Asta document" or anything with an `asta://` URI./autodiscoveryCreate, configure, and monitor AutoDiscovery runs — either via the hosted service (`asta autodiscovery`) or via the local CLI (`auto-discovery`). Use when the user asks about their runs, experiments, discoveries, wants to check status, or wants to start a new discovery run./check-claimsJudge whether factual claims in an evidence-backed research write-up are substantiated — which claims assert something checkable with no evidence attached, and whether an attached quote supports the claim as worded. Works over whatever scope the request names — a pull request diff, your own uncommitted change, one file, or a whole project audited end to end. Triggers on "check my claims", "is this claim supported", "evidence review", "audit the evidence", or review of research prose using `.ev` evidence.Other plugins' skills for the same job