Converts an arxiv paper into a minimal, citation-anchored Python implementation.

MITAuto-check passedResearch & Science

Install Paper2code

skills CLI
$ npx skills add PrathamLearnsToCode/paper2code --skill paper2code -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install PrathamLearnsToCode/paper2code paper2code --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/PrathamLearnsToCode/paper2code.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/paper2code .claude/skills/paper2code && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
paper2code
GitHub stars
1.5k
Token cost
~1.3k tokens
SKILL.md length
520 words
Files
57 (incl. scripts)
Skills in repo
1
Repo updated
First seen
Licence
MIT

At a glance

Converts an arxiv paper into a minimal, citation-anchored Python implementation.

  • Works in 5 steps: Paper Acquisition and Parsing → Contribution Identification → Ambiguity Audit → …
  • User runs /paper2code with an arxiv URL
  • SKILL.md covers Parse arguments, Set up working directory, Install dependencies and Execute pipeline, plus 5 more sections
  • Runs Python scripts from its folder; calls python and pip; reaches arxiv.org

What it does

Paper2code is an agent skill from PrathamLearnsToCode/paper2code. Converts an arxiv paper into a minimal, citation-anchored Python implementation. Trigger when user runs /paper2code with an arxiv URL or paper ID, says "implement this paper", or pastes an arxiv link asking for implementation. Flags all ambiguities honestly. Never invents implementation details not stated in the paper.

Its SKILL.md is about 1.3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 60 other files, including scripts (for example `guardrails/badly_written_papers.md`, `guardrails/hallucination_prevention.md` and `guardrails/scope_enforcement.md`).

It sits in Research & Science, covering Academic paper search and Citation management. It works with arXiv and Python. The repository describes itself as: Agent skill to turn any arxiv paper into a working implementation. The licence is MIT.

When your agent uses it

  • User runs /paper2code with an arxiv URL
  • Says implement this paper
  • Pastes an arxiv link asking for implementation

Example prompts

  • “implement this paper”
  • “Use the paper2code skill to convert an arxiv paper into a minimal, citation-anchored Python implementation”
  • “/paper2code”

Requirements

  • Python 3

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. Paper Acquisition and Parsing
  2. Contribution Identification
  3. Ambiguity Audit
  4. Code Generation
  5. Walkthrough Notebook

What it can do on your machine

Read from SKILL.md and the folder at commit fcffce7. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (Python, from the files we listed), which the agent can run.

    Shell commands in SKILL.md call:

    • python
    • pip

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • arxiv.org

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Paper2code loads about 1.3k tokens when it runs. Until then it costs about 83 tokens; SKILL.md has 520 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~83
When it runs · the whole SKILL.md, loaded when a task matches
~1.3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from PrathamLearnsToCode/paper2code at commit fcffce7, republished under its MIT licence (© PrathamLearnsToCode). 520 words, ~1,326 tokens.

Download SKILL.mdSave it as .claude/skills/paper2code/SKILL.md (or your agent's skills folder). This skill also uses 56 other files; get the full folder from GitHub.
name
paper2code
description
Converts an arxiv paper into a minimal, citation-anchored Python implementation. Trigger when user runs /paper2code with an arxiv URL or paper ID, says "implement this paper", or pastes an arxiv link asking for implementation. Flags all ambiguities honestly. Never invents implementation details not stated in the paper.

paper2code — Orchestration

You are executing the paper2code skill. This file governs the high-level flow. Each stage dispatches to a detailed reasoning protocol in pipeline/. Do NOT skip stages. Do NOT combine stages. Execute them in order.

Parse arguments

Extract from the user's input:

  • ARXIV_ID: the arxiv paper ID (e.g., 2106.09685). Strip any URL prefix.
  • MODE: one of minimal (default), full, educational.
  • FRAMEWORK: one of pytorch (default), jax, numpy.

If the user provided a full URL like https://arxiv.org/abs/2106.09685, extract the ID 2106.09685. If the user provided a versioned ID like 2106.09685v2, keep the version.

Set up working directory

Create a temporary working directory: .paper2code_work/{ARXIV_ID}/ This is where intermediate artifacts go. The final output goes in the current directory under {paper_slug}/.

Install dependencies

Run via Bash:

bash
pip install pymupdf4llm pdfplumber requests pyyaml

Execute pipeline

Stage 1 — Paper Acquisition and Parsing

Read and follow: pipeline/01_paper_acquisition.md

Run the helper script to fetch and parse the paper:

bash
python skills/paper2code/scripts/fetch_paper.py {ARXIV_ID} .paper2code_work/{ARXIV_ID}/

Then run structure extraction:

bash
python skills/paper2code/scripts/extract_structure.py .paper2code_work/{ARXIV_ID}/paper_text.md .paper2code_work/{ARXIV_ID}/

Verify the outputs exist before proceeding. If extraction failed, follow the fallback protocol in pipeline/01_paper_acquisition.md.

The script also searches for official code repositories (in the paper text and on the arxiv page) and saves any found links to paper_metadata.json under the official_code key. Verify these links before relying on them — see Step 8 in pipeline/01_paper_acquisition.md.

Stage 2 — Contribution Identification

Read and follow: pipeline/02_contribution_identification.md

Read the parsed paper sections. Identify the single core contribution. Classify the paper type. Write the contribution statement. Save it to .paper2code_work/{ARXIV_ID}/contribution.md.

Stage 3 — Ambiguity Audit

Read and follow: pipeline/03_ambiguity_audit.md

Before reading this stage, also read: guardrails/hallucination_prevention.md

Go through every implementation-relevant detail. Classify each as SPECIFIED, PARTIALLY_SPECIFIED, or UNSPECIFIED. Save the audit to .paper2code_work/{ARXIV_ID}/ambiguity_audit.md.

Stage 4 — Code Generation

Read and follow: pipeline/04_code_generation.md

Before writing code, read:

  • guardrails/scope_enforcement.md — to determine what's in and out of scope
  • guardrails/badly_written_papers.md — if the paper is vague or inconsistent
  • The relevant knowledge files in knowledge/ for the paper's domain
  • The scaffold templates in scaffolds/ for the expected file structure

Determine the paper_slug from the paper title (lowercase, underscores, no special chars). Generate all files under {paper_slug}/ in the current working directory.

Show full SKILL.md (182 more words)Show less
Stage 5 — Walkthrough Notebook

Read and follow: pipeline/05_walkthrough_notebook.md

Generate the walkthrough notebook that connects paper sections to code with runnable sanity checks. Save to {paper_slug}/notebooks/walkthrough.ipynb.

Cleanup

Remove the .paper2code_work/ directory after successful completion.

Final output

Print a summary:

✓ paper2code complete for: {paper_title}
  Output directory: {paper_slug}/
  Files generated: {list of files}
  Unspecified choices: {count} (see REPRODUCTION_NOTES.md)
  Mode: {MODE} | Framework: {FRAMEWORK}

Mode-specific behavior

  • minimal (default): Core contribution only. Training loop only if contribution involves training. No data pipeline beyond Dataset skeleton.
  • full: Core contribution + full training loop + data pipeline + evaluation pipeline. More code, same citation rigor.
  • educational: Same as minimal but with extra inline comments explaining ML concepts, expanded walkthrough notebook with theory sections, and a PAPER_GUIDE.md that walks through the paper section by section.

Guardrails — always active

These apply at ALL stages. Read them if you haven't already:

  • guardrails/hallucination_prevention.md — the most important file in this skill
  • guardrails/scope_enforcement.md — what to implement and what to skip
  • guardrails/badly_written_papers.md — what to do when the paper is unclear

Knowledge base — consult as needed

Before implementing any of these components, read the corresponding knowledge file:

  • Transformer layers, attention, positional encoding → knowledge/transformer_components.md
  • Optimizers, LR schedules, batch size semantics → knowledge/training_recipes.md
  • Cross-entropy, contrastive loss, diffusion loss, ELBO → knowledge/loss_functions.md
  • Framework-specific pitfalls, notation mismatches → knowledge/paper_to_code_mistakes.md

© PrathamLearnsToCode, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 56 other files (scripts) in skills/paper2code of PrathamLearnsToCode/paper2code.

  • SKILL.md
  • guardrails/badly_written_papers.md
  • guardrails/hallucination_prevention.md
  • guardrails/scope_enforcement.md
  • knowledge/loss_functions.md
  • knowledge/paper_to_code_mistakes.md
  • knowledge/training_recipes.md
  • knowledge/transformer_components.md
  • pipeline/01_paper_acquisition.md
  • pipeline/02_contribution_identification.md
  • pipeline/03_ambiguity_audit.md
  • pipeline/04_code_generation.md
  • pipeline/05_walkthrough_notebook.md
  • scaffolds/config_template.yaml
  • scaffolds/data_template.py
  • scaffolds/evaluate_template.py
  • scaffolds/loss_template.py
  • … and 40 more

Open the folder on GitHubat commit fcffce7

Compare with similar skills

Paper2code next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Paper2code compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Paper2code this skillPrathamLearnsToCode/paper2code1.5k—~1.3kAutomated safety check: PassMIT
Citation ManagementK-Dense-AI/claude-scientific-writer2.4k3 repos~3.9kAutomated safety check: NotesMIT
Paper Research on arXivXiaomiMiMo/MiMo-Code14k1 repos~1.5kAutomated safety check: PassMIT
Hugging Face Paper Publisherhuggingface/skills11k5 repos~4.2kAutomated safety check: PassApache-2.0
Arxiv MCP Serverblazickjp/arxiv-mcp-server3.2k—~353Automated safety check: PassApache-2.0
Arxiv Paper Writeryunshenwuchuxun/latex-paper-skills265—~3.2kAutomated safety check: PassMIT

Similar skills

  • Citation Management

    K-Dense-AI/claude-scientific-writer

    Finds papers in OpenAlex, PubMed and Google Scholar, turns DOIs, PMIDs and arXiv IDs into clean BibTeX, and validates citations for a manuscript or thesis.

    2.4k GitHub starsUsed in 3 repos~3.9k tokens
    Research & ScienceAuto-check: notes
  • Paper Research on arXiv

    XiaomiMiMo/MiMo-Code

    Searches arXiv, fetches metadata, generates BibTeX, downloads PDFs and finds citations and related papers using a bundled Python script.

    14k GitHub starsUsed in 1 repo~1.5k tokens
    Research & ScienceAuto-check passed
  • Official

    Indexes research papers on the Hugging Face Hub from arXiv, links them to models and datasets, claims authorship and generates markdown research articles from templates.

    11k GitHub starsUsed in 5 repos~4.2k tokens
    Research & ScienceAuto-check passed
  • Arxiv MCP Server

    blazickjp/arxiv-mcp-server

    A skill your agent uses when finding, comparing, reading, or monitoring arXiv papers, including requests for abstracts, citation graphs, original LaTeX, section-level technical details, or…

    3.2k GitHub stars~353 tokensUpdated 2 days ago
    Research & ScienceAuto-check passed
  • Arxiv Paper Writer

    yunshenwuchuxun/latex-paper-skills

    Writes ML/AI review and survey papers for arXiv using the IEEEtran LaTeX template with verified BibTeX citations.

    265 GitHub stars~3.2k tokensUpdated 6 mo ago
    Research & ScienceAuto-check passed
  • Ref Downloader

    ltczding-gif/ref-downloader

    A skill your agent uses when the user asks to batch-download academic PDFs with ref-downloader — either ALL references of one paper (Mode A: DOI or PDF input), OR a custom batch of papers (Mode B…

    139 GitHub stars~5.9k tokensUpdated 4 mo ago
    Research & ScienceAuto-check passed

Works with

Questions about Paper2code

What does Paper2code do?

Converts an arxiv paper into a minimal, citation-anchored Python implementation. Paper2code is an agent skill from PrathamLearnsToCode/paper2code. Converts an arxiv paper into a minimal, citation-anchored Python implementation.

When should I use Paper2code?

Paper2code fits situations like: user runs /paper2code with an arxiv URL; says implement this paper; pastes an arxiv link asking for implementation.

How do I install Paper2code in Claude Code?

Run `npx skills add PrathamLearnsToCode/paper2code --skill paper2code -a claude-code`. Or copy the skill folder (skills/paper2code in PrathamLearnsToCode/paper2code) into .claude/skills/paper2code in your project. Claude Code loads it when a task matches its description.

How do I install Paper2code in Codex?

Run `npx skills add PrathamLearnsToCode/paper2code --skill paper2code -a codex`. Or copy the skill folder (skills/paper2code in PrathamLearnsToCode/paper2code) into .agents/skills/paper2code in your project. Codex loads it when a task matches its description.

Can I use Paper2code in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add PrathamLearnsToCode/paper2code --skill paper2code -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/paper2code, .gemini/skills/paper2code, .github/skills/paper2code and .opencode/skills/paper2code in your project.

What does Paper2code need to run?

Going by SKILL.md and its folder, Paper2code needs Python for the scripts in its folder and the command-line tools its instructions call (python and pip). Our summary lists: Python 3.

Does Paper2code access the network?

SKILL.md names 1 domain. In commands or code: arxiv.org; the agent is likely to contact it when it follows the instructions. This is read from the text; nothing was executed.

Is Paper2code safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Paper2code use?

Paper2code is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Paper2code use?

About 1.3k tokens (SKILL.md is roughly 5.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Paper2code?

Skills that share tags, products or a category with Paper2code: Citation Management (K-Dense-AI/claude-scientific-writer, 2.4k stars), Paper Research on arXiv (XiaomiMiMo/MiMo-Code, 14k stars), Hugging Face Paper Publisher (huggingface/skills, 11k stars) and Arxiv MCP Server (blazickjp/arxiv-mcp-server, 3.2k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Paper2code?

PrathamLearnsToCode (a GitHub user) maintains it in PrathamLearnsToCode/paper2code, which has 1,528 GitHub stars. The repository was last updated on April 3, 2026.

Source: PrathamLearnsToCode/paper2code on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.