Build an AI Co-Scientist in Claude Code

Build a multi-agent workflow that ranks citation-checked hypotheses from arXiv.

Introduction

30 Second Summary

A promising research question can quickly lead to thousands of papers. The hardest part is tracing each new idea back to evidence you can check.

In this project, you will build a small AI co-scientist in Claude Code. A reusable Claude Code skill will coordinate three specialist subagents through visible file handoffs.

What You'll Build

One research question in Claude Code produces a visible trail from real paper abstracts to a citation-checked ranking of testable hypotheses.

By the end of this project, you'll have:

  • An evidence file with exactly eight arXiv papers. You can inspect each paper's exact title plus abstract.
  • A visible agent trail showing how five hypotheses move from generation through critique into pairwise ranking.
  • A citation-checked report ranking five hypotheses best first. Every cited arXiv ID shows PASS or FAIL beside it.
  • Secret Mission: Add a head-to-head Elo tournament that compares its order with the original ranking. Confirm that five ratings still total 6000.

Are there any prerequisites?

You need an internet-connected Mac or Windows PC. Your Claude account must include Claude Code access.

The project requires no coding knowledge because it includes complete installation guidance.

Before We Start

Before any hands-on work, lock in the question your co-scientist will investigate. This is your commitment to producing hypotheses to test while checking that every citation supports the report.

Install Claude Code

Claude Code is the workspace that powers every later stage of your file-based co-scientist.

It creates the project files. It also runs the subagents.

Its built-in tools fetch the research. This path needs no Python, SDK, Git repository, or API key.

In this step, get ready to:
  • Open Terminal on macOS or PowerShell on Windows. A command prompt is ready.
  • Install Claude Code. Its version check prints a version number.
  • Create my-research-team. The Claude Code welcome screen shows it as the working folder.
Open your terminal

A terminal gives you a place to install and launch Claude Code with typed commands. The app differs between macOS and Windows.

macOS

  • Press Command and Space to open the search bar.
  • Type Terminal into the search bar.
  • Press Return to start Terminal.

You should see a prompt ending in % or $.

Windows

  • Open the Start menu.
  • Type PowerShell into the search field.
  • Press Enter to start PowerShell.

You should see a prompt beginning with PS.

You should now see a terminal window with a command prompt ready for input.

Install and verify Claude Code

Claude provides a native installer for each operating system. A fresh terminal session then loads the installation path used by the claude command.

macOS

  • Install Claude Code on your Mac by running this command:
curl -fsSL https://claude.ai/install.sh | bash

What does this command do?

This command downloads Claude Code's native installer from Claude's website. Your shell then runs the installer.

Windows

  • Install Claude Code on your Windows PC by running this command:
irm https://claude.ai/install.ps1 | iex

What does this command do?

This command downloads Claude Code's native PowerShell installer from Claude's website. PowerShell then runs the installer.

You should see the installer finish without a failure message.

  • Close the terminal window.
  • Start a fresh terminal session.

macOS

  • Press Command and Space to reopen the search bar.
  • Type Terminal into the search bar.
  • Press Return to start a fresh Terminal session.

Windows

  • Open the Start menu.
  • Type PowerShell into the search field.
  • Press Enter to start a fresh PowerShell session.

You should see a fresh command prompt. This session can now use the installation path added by the installer.

Before you run the version check, what result would prove that the fresh terminal can find Claude Code?

  • Check the Claude Code installation by running this command:
claude --version

What does this command do?

The command asks the installed Claude Code program to print its version. A version number confirms that your terminal can find the installation.

You should see a version number. That is the first gate cleared: Claude Code is installed and available in your fresh terminal.

✔️ I see a version number

Your installation is working. Keep this terminal open for the project folder setup.

ⓧ Command not found

Your terminal has not picked up the Claude Code command yet.

Still seeing a missing command?

  • Close every open terminal window.
  • Start a new Terminal or PowerShell session through your operating system's search.
  • Repeat the installer command for your operating system if the command is still unavailable.
  • If macOS reports command not found: claude or Windows reports that claude is not recognized, ask for help checking the installation path.
Create the project folder and sign in

Claude Code treats the terminal's current folder as its working directory. Starting it inside my-research-team keeps every later file in one visible workspace.

macOS

  • Move to your Desktop by running this command:
cd ~/Desktop

What does this command do?

The cd command changes the terminal's current location. The ~/Desktop path points to your Desktop folder.

  • Create the my-research-team folder and enter it by running these commands:
mkdir my-research-team
cd my-research-team

What do these commands do?

  • The mkdir command creates the local project folder.
  • The cd command makes that folder the terminal's current location.

Windows

  • Move to your Desktop by running these commands:
$Desktop = [Environment]::GetFolderPath("Desktop")
Set-Location $Desktop

What do these commands do?

The first command finds the Desktop folder for your Windows account. The second command moves PowerShell to that folder.

  • Create the my-research-team folder and enter it by running these commands:
mkdir my-research-team
cd my-research-team

What do these commands do?

  • The mkdir command creates the local project folder.
  • The cd command makes that folder the terminal's current location.

Before you launch Claude Code, which folder name do you expect its welcome screen to show?

  • Start Claude Code inside the current project folder by running this command:
claude

What does this command do?

The command starts an interactive Claude Code session in the current folder. That folder becomes the workspace for the project.

Sign-in uses your existing eligible Claude account. This project does not require an API key.

  • Complete the sign-in on the page Claude Code presents.
  • On the sign-in page, choose the account linked to your eligible Claude plan.
  • Return to the terminal after the sign-in completes.

You should see the Claude Code welcome screen with my-research-team as the working folder. Your local co-scientist workspace is now ready to create files and run research tasks.

Claude Code is installed inside a dedicated workspace. Next, you will fetch eight real arXiv abstracts into the project's first evidence file.

Fetch Eight Papers

Claude Code is now running inside my-research-team. Your co-scientist needs real arXiv abstracts before it can generate hypotheses.

Without a saved evidence file, an agent can invent sources.

In this step, get ready to:
  • Fix the research question to claims supported by arXiv abstracts.
  • Save eight complete arXiv records in papers.md.
  • Confirm papers.md has eight entries with eight abstracts.
Set the research question

A fixed research question gives every later agent the same boundary. Every claim must stay within the saved abstracts.

  • Give Claude Code the exact research question by pasting this prompt:
Use this exact research question for the project: Why do large language models hallucinate, and what reduces it? Keep the scope to claims that can be supported by arXiv abstracts. Reply with the research question only.

What does this prompt do?

The prompt fixes one research question for the project. It also limits the evidence boundary to arXiv abstracts.

  • Submit the prompt by pressing Enter.

You'll see Claude Code repeat Why do large language models hallucinate, and what reduces it? with no additional text.

Fetch and save the abstracts

WebFetch lets Claude Code request the arXiv API directly. Saving the response in papers.md makes the evidence visible to every later agent.

  • Create papers.md from one arXiv request by pasting this prompt into Claude Code:
Use WebFetch once to get this arXiv API URL: https://export.arxiv.org/api/query?search_query=all:%22large+language+models%22+AND+all:hallucination&max_results=8&sortBy=relevance

Create `papers.md`. Save exactly 8 entries, numbered 1 through 8. For each entry, copy the arXiv ID, exact title, and exact abstract from the API response. Add the abstract-page link in the form `https://arxiv.org/abs/{id}`. Keep all later claims limited to these abstracts. Do not fetch or read any PDF.

What does this prompt do?

The prompt allows one WebFetch request to retrieve eight relevance-sorted results. It saves the source metadata in a Markdown file.

The abstract-only boundary keeps the evidence set consistent. It also prevents later agents from adding claims found only in PDFs.

Claude Code may pause for permission before contacting arXiv.

  • Submit the prompt by pressing Enter.
  • Approve export.arxiv.org for future WebFetch requests if Claude Code asks.
  • In Claude Code's permission prompt, select the option that approves future requests to export.arxiv.org.

You'll see Claude Code report that it created papers.md with eight numbered papers.

Each entry includes an arXiv ID. It also includes the exact API title.

Each entry includes the exact API abstract. It also includes a link in the form https://arxiv.org/abs/{id}.

The exact IDs can vary because arXiv sorts the live response by relevance.

Fewer Than Eight Entries?

  • Ask Claude Code to broaden the arXiv search terms when papers.md has fewer than eight entries.
  • Repeat one WebFetch request after Claude Code updates the query.
  • Wait at least three seconds before retrying when arXiv returns 429 or an empty response.
  • Still stuck? Help me diagnose the arXiv fetch.
Inspect the evidence file

Counting the numbered entries catches an incomplete response. Checking every abstract confirms that later agents have evidence they can actually use.

Before the check, consider whether all eight entries will pass.

  • Ask Claude Code to count the entries by pasting this prompt:
Read `papers.md`. Report the number of numbered paper entries, then list only each arXiv ID and exact title. Confirm that every entry also has an abstract. Do not edit the file and do not fetch any PDF.

What does this prompt do?

This prompt checks the evidence file without changing it. It also confirms that the saved records include all eight abstracts.

  • Submit the inspection prompt by pressing Enter.

You'll see Claude Code report exactly 8 numbered entries.

You'll see eight arXiv IDs with their exact titles. Claude Code also confirms that every entry has an abstract.

You have the evidence foundation in place. Every later agent now starts from the same eight saved abstracts.

Your evidence set is ready. Next up, you'll create three subagents that pass their work through files.

Create the Subagents

Your eight saved abstracts now give the project a fixed evidence base. The next challenge is splitting idea generation from evaluation.

Three Claude Code subagents isolate generation, criticism, and ranking so one model does not grade its own work inside one conversation.

In this step, get ready to:
  • Create a generator subagent that writes five hypotheses grounded in papers.md.
  • Create a critic subagent that scores all five hypotheses against the saved abstracts.
  • Create a ranker subagent and confirm all three definitions use the correct names and tools.
Create the generator subagent

Each non-fork subagent starts with an isolated context. Its definition must contain every instruction it needs because it cannot see your main conversation.

YAML frontmatter can feel fiddly because its field names and boundary lines must be exact. The generator definition keeps its evidence boundary inside papers.md.

  • Ask Claude Code to create .claude/agents/generator.md using exactly this content:
---
name: generator
description: Generates five testable hypotheses from the arXiv abstracts saved in papers.md.
tools: Read, Write
---

Read `papers.md`. Treat the saved abstracts as the complete evidence set. Do not fetch PDFs or use claims that are absent from the abstracts.

Overwrite `hypotheses.md` with exactly five distinct hypotheses. For each hypothesis include:

1. A number and short title.
2. A one-sentence claim.
3. A `Based on:` line containing only arXiv IDs found in `papers.md`.
4. A `Test:` line describing one observable result that could prove the claim wrong.

Do not invent an arXiv ID. Do not present a hypothesis as a finding. Finish by reporting that `hypotheses.md` contains five hypotheses.

What does this agent do?

  • The frontmatter registers the agent as generator and restricts it to Read and Write.
  • The evidence rule limits every claim to the abstracts already stored in papers.md.
  • The output rules require five testable hypotheses with traceable arXiv IDs and a result that could disprove each claim.
  • Ask Claude Code to show the YAML frontmatter from .claude/agents/generator.md and confirm the file path.

You should see name: generator and tools: Read, Write in the frontmatter. Your first specialist now has a narrow job and a fixed evidence boundary.

✔️ Awesome, I've got everything!

Your generator definition is saved with the required name, tools, evidence rules, and output format.

ⓧ I'd like to double check the full code

  • Compare .claude/agents/generator.md with this complete definition.
---
name: generator
description: Generates five testable hypotheses from the arXiv abstracts saved in papers.md.
tools: Read, Write
---

Read `papers.md`. Treat the saved abstracts as the complete evidence set. Do not fetch PDFs or use claims that are absent from the abstracts.

Overwrite `hypotheses.md` with exactly five distinct hypotheses. For each hypothesis include:

1. A number and short title.
2. A one-sentence claim.
3. A `Based on:` line containing only arXiv IDs found in `papers.md`.
4. A `Test:` line describing one observable result that could prove the claim wrong.

Do not invent an arXiv ID. Do not present a hypothesis as a finding. Finish by reporting that `hypotheses.md` contains five hypotheses.

Generator file not recognized?

  • Check that the path is exactly .claude/agents/generator.md inside the active my-research-team folder.
  • Confirm that the frontmatter begins and ends with --- on separate lines.
  • Still stuck? Help me check why my generator subagent definition is not being recognized.
Create the critic subagent

The critic checks each generated claim against the same evidence file. Separate scores for evidence, novelty, and testability make its judgment visible inside critique.md.

  • Ask Claude Code to create .claude/agents/critic.md using exactly this content:
---
name: critic
description: Critiques five hypotheses against the exact abstracts saved in papers.md.
tools: Read, Write
---

Read `papers.md` and `hypotheses.md`. Do not fetch PDFs. Judge claims only against the saved abstracts.

Overwrite `critique.md` with one review for each of the five hypotheses. For each review include:

1. Evidence score from 1 to 5.
2. Novelty score from 1 to 5.
3. Testability score from 1 to 5.
4. A brief abstract-grounded justification.
5. An `Unsupported claims:` line that lists every claim not supported by the cited abstracts, or `None`.

A novelty score or high total is not proof. Finish by reporting that all five hypotheses were reviewed.

What does this agent do?

  • The critic reads both papers.md and hypotheses.md so it can compare every proposed claim with its cited evidence.
  • The three scores separate evidence strength, novelty, and testability instead of hiding them inside one total.
  • The Unsupported claims: line exposes any part of a hypothesis that reaches beyond the saved abstracts.
  • Ask Claude Code to show the YAML frontmatter from .claude/agents/critic.md and confirm the file path.

You should see name: critic and tools: Read, Write in the frontmatter. That gives every hypothesis a dedicated reviewer before ranking begins.

✔️ Awesome, I've got everything!

Your critic definition is saved with five review criteria and a strict abstract-only evidence rule.

ⓧ I'd like to double check the full code

  • Compare .claude/agents/critic.md with this complete definition.
---
name: critic
description: Critiques five hypotheses against the exact abstracts saved in papers.md.
tools: Read, Write
---

Read `papers.md` and `hypotheses.md`. Do not fetch PDFs. Judge claims only against the saved abstracts.

Overwrite `critique.md` with one review for each of the five hypotheses. For each review include:

1. Evidence score from 1 to 5.
2. Novelty score from 1 to 5.
3. Testability score from 1 to 5.
4. A brief abstract-grounded justification.
5. An `Unsupported claims:` line that lists every claim not supported by the cited abstracts, or `None`.

A novelty score or high total is not proof. Finish by reporting that all five hypotheses were reviewed.

Critic definition looks incomplete?

  • Confirm that the body tells the critic to read both papers.md and hypotheses.md.
  • Check that all five review requirements appear before the final warning about proof.
  • Still stuck? Help me compare my critic definition with the required artifact.
Create the ranker and inspect all three

The ranker receives the evidence trail after generation and criticism are complete. Pairwise comparisons force it to explain why one hypothesis outranks another before it writes report.md.

  • Ask Claude Code to create .claude/agents/ranker.md using exactly this content:
---
name: ranker
description: Compares the critiqued hypotheses pairwise and writes the final ranked report.
tools: Read, Write
---

Read `papers.md`, `hypotheses.md`, and `critique.md`. Do not fetch PDFs.

Compare the five hypotheses two at a time. For each comparison, pick a winner and record a one-line reason grounded in `critique.md`. Use the complete set of comparisons to overwrite `report.md` with exactly five hypotheses ranked best first.

For each ranked hypothesis include:

1. Rank and hypothesis.
2. One-line ranking reason.
3. Every cited arXiv ID as a link in the form `https://arxiv.org/abs/{id}`.
4. One falsifiable test.

End with this statement: `These are hypotheses to test, not scientific findings. This ranking is the system's judgment, not proof.`

What does this agent do?

  • The ranker reads papers.md, hypotheses.md, and critique.md before comparing the five ideas.
  • Each pairwise decision receives a one-line reason grounded in the critic's review.
  • The final statement keeps the ranked output framed as hypotheses and system judgment instead of scientific proof.
  • Ask Claude Code to show the YAML frontmatter from .claude/agents/ranker.md and confirm the file path.

You should see name: ranker and tools: Read, Write in the frontmatter. The project now has separate specialists for proposing, challenging, and ordering its hypotheses.

✔️ Awesome, I've got everything!

Your ranker definition is saved with pairwise comparison rules and a five-item report format.

ⓧ I'd like to double check the full code

  • Compare .claude/agents/ranker.md with this complete definition.
---
name: ranker
description: Compares the critiqued hypotheses pairwise and writes the final ranked report.
tools: Read, Write
---

Read `papers.md`, `hypotheses.md`, and `critique.md`. Do not fetch PDFs.

Compare the five hypotheses two at a time. For each comparison, pick a winner and record a one-line reason grounded in `critique.md`. Use the complete set of comparisons to overwrite `report.md` with exactly five hypotheses ranked best first.

For each ranked hypothesis include:

1. Rank and hypothesis.
2. One-line ranking reason.
3. Every cited arXiv ID as a link in the form `https://arxiv.org/abs/{id}`.
4. One falsifiable test.

End with this statement: `These are hypotheses to test, not scientific findings. This ranking is the system's judgment, not proof.`

Ranker definition missing a requirement?

  • Confirm that the ranker reads all three input files before the comparison instructions.
  • Check that the final statement matches the reference definition exactly.
  • Still stuck? Help me verify my ranker definition against the required file.

Before you inspect the full set, which three agent names do you expect Claude Code to report?

  • Ask Claude Code to read the YAML frontmatter from .claude/agents/generator.md, .claude/agents/critic.md, and .claude/agents/ranker.md.
  • Ask Claude Code to report each name value without editing any file.
  • Ask Claude Code to confirm that every tools field is exactly Read, Write.

You should see the names generator, critic, and ranker. Every definition should report tools: Read, Write.

Your three specialist roles are ready. Next, you'll connect their file handoffs to one reusable research command.

Run the Research Team

Your three subagents now have distinct jobs. You still need a reliable way to call them in the correct order. A reusable file-based workflow connects those roles through visible handoffs.

A reusable Claude Code skill turns the isolated roles into one ordered research workflow.

In this step, get ready to:
  • Create the reusable research-team skill. Its command becomes /research-team.
  • Run the workflow until papers.md, hypotheses.md, critique.md, and report.md contain 8, 5, 5, and 5 entries.
  • Inspect the ranked report. Assess whether its citations have been independently verified.
Create the research-team skill

A project skill stores a repeatable set of instructions inside the project. The skill receives a research question. It coordinates the evidence search before starting each specialist.

  • Create .claude/skills/research-team/SKILL.md by pasting this prompt into Claude Code:
Create `.claude/skills/research-team/SKILL.md`. Add valid YAML frontmatter with `name: research-team`, `description: Researches a question with arXiv abstracts and three subagents.`, `disable-model-invocation: true`, and allowed tools for `WebFetch`, `Read`, `Write`, `Edit`, `Agent(generator)`, `Agent(critic)`, and `Agent(ranker)`. In the Markdown body, use the literal `$ARGUMENTS` as the research question. Make the instructions self-contained.

The skill must build a valid arXiv `search_query` from the question. It must use one WebFetch request to `https://export.arxiv.org/api/query` with `max_results=8` and `sortBy=relevance`. It must overwrite `papers.md` with exactly eight numbered entries containing each paper's arXiv ID, exact title, exact abstract, and abstract-page link. It must not fetch PDFs. Keep all claims within the abstracts.

Then run the `generator` subagent. Wait until `hypotheses.md` exists with exactly five hypotheses. Run the `critic` subagent. Wait until `critique.md` exists with all five hypotheses scored. Run the `ranker` subagent. Wait until `report.md` exists with exactly five ranked hypotheses. The agents must pass work only through `papers.md`, `hypotheses.md`, `critique.md`, and `report.md`.

Finish by reporting the four file names and their required counts. After creating the skill, confirm its path and command name.

What does this prompt do?

The literal $ARGUMENTS receives the research question supplied after the command. This lets the same skill research a different question on a later run.

The WebFetch stage replaces papers.md with eight abstracts. Each subagent waits for the previous file before it begins.

You should see Claude Code confirm .claude/skills/research-team/SKILL.md as the path. It should identify /research-team as the command.

The complete skill file is available below for an exact comparison.

✔️ I'll try it first

Continue once Claude Code confirms the skill path and command name.

ⓧ Let me check my work

  • Compare .claude/skills/research-team/SKILL.md with this complete version:
---
name: research-team
description: Researches a question with arXiv abstracts and three subagents.
disable-model-invocation: true
allowed-tools:
  - WebFetch
  - Read
  - Write
  - Edit
  - Agent(generator)
  - Agent(critic)
  - Agent(ranker)
---

Research question: $ARGUMENTS

Complete every stage in order. Do not start a later agent until the expected file from the earlier agent exists and has the required count. The agents pass work only through `papers.md`, `hypotheses.md`, `critique.md`, and `report.md`.

## 1. Collect eight papers

Build a valid arXiv `search_query` from the research question using distinctive terms and `all:` fields. Make one WebFetch request to:

`https://export.arxiv.org/api/query?search_query={encoded-search-query}&max_results=8&sortBy=relevance`

Overwrite `papers.md` with exactly eight numbered entries. Copy each arXiv ID, exact title, exact abstract, and abstract-page link. Ask WebFetch for the exact titles and abstracts. Do not fetch PDFs. Keep all claims within the abstracts.

## 2. Generate hypotheses

Run the `generator` subagent. Wait for it to finish. Read `hypotheses.md` and continue only when it contains exactly five hypotheses.

## 3. Critique hypotheses

Run the `critic` subagent. Wait for it to finish. Read `critique.md` and continue only when all five hypotheses have evidence, novelty, and testability scores.

## 4. Rank hypotheses

Run the `ranker` subagent. Wait for it to finish. Read `report.md` and continue only when it contains exactly five ranked hypotheses.

Finish by reporting these required counts and files:

- `papers.md`: 8 papers
- `hypotheses.md`: 5 hypotheses
- `critique.md`: 5 critiques
- `report.md`: 5 ranked hypotheses
Run the complete workflow

The skill now has everything needed to coordinate the research team. One command supplies the question. The skill manages each file handoff.

  • Approve future WebFetch requests for export.arxiv.org if Claude Code asks for permission during the run.
  • Choose the permission option that remembers the approval for this domain.

Before you run the team, do you expect each subagent to wait until its input file is ready?

  • Start the research team by pasting this command into Claude Code:
/research-team Why do large language models hallucinate, and what reduces it?

What does this command do?

The /research-team command starts the project skill. The question after the command becomes the value of $ARGUMENTS.

The skill fetches eight abstracts before running generator, critic, and ranker in sequence.

That is the pipeline working. Claude Code should report papers.md with 8 papers. It should report hypotheses.md with 5 hypotheses. It should report critique.md with 5 critiques. It should report report.md with 5 ranked hypotheses.

Did a stage start too early?

  • Ask Claude Code to inspect the skill if critic starts before hypotheses.md exists. Each stage must wait for its required file and count.
  • Run /reload-skills if Claude Code cannot find /research-team after the file path has been confirmed.
  • Still stuck? Help me troubleshoot my research-team skill sequencing.
Test the report's citation confidence

The ranker has produced an ordered report from the evidence and critique files. Now you can test what that report can prove about its own citations.

Before you ask, do you think the report can prove that every cited ID exists on arXiv using only its current files?

  • Inspect the ranked hypotheses by pasting this prompt into Claude Code:
Read `report.md`. Confirm that it contains exactly 5 ranked hypotheses. For each one, show only its rank, cited arXiv IDs, and one-line test. Then state whether the report currently proves that every cited ID exists on arXiv. Do not edit any file.

What does this prompt do?

The prompt narrows the inspection to the ranking, cited IDs, and falsifiable tests. It also asks Claude Code to separate citations written in the report from citations independently confirmed by arXiv.

Claude Code should report exactly 5 ranked hypotheses. It should also recognize that the current report does not independently prove that every cited ID exists on arXiv.

That shortfall is intentional. The team can produce a convincing report before it has checked the cited records against the external source.

Before the final check, do you expect all four workflow files to contain their required number of entries?

  • Verify the complete workflow by pasting this prompt into Claude Code:
Read `papers.md`, `hypotheses.md`, `critique.md`, and `report.md`. Report only the number of papers, hypotheses, critiques, and ranked report entries. Confirm that the counts are 8, 5, 5, and 5. Do not edit any file.

What does this prompt do?

This checks the output contract for every stage without changing the files. The counts prove that each handoff completed before the next specialist began.

You should see 8 papers, 5 hypotheses, 5 critiques, and 5 ranked report entries. Your reusable research team now completes the full file-based workflow.

Your research team now moves from abstracts to a ranked report with one command. Next, you'll test a fake citation and close the report's trust gap.

Check Every Citation

Your research team now turns eight saved abstracts into five ranked hypotheses. The next goal is to make every source earn its place through one arXiv lookup.

A polished report can still cite a nonexistent paper. This step tests whether a convincing output is trustworthy.

In this step, get ready to:
  • Plant an intentional fake citation. hypotheses.md reaches exactly 6 hypotheses.
  • Add one citation-check stage. It marks 2502.99999 as FAIL before dropping its hypothesis.
  • Run the clean workflow again. The final report contains exactly 5 ranked hypotheses with PASS beside every retained citation.
Plant the expected failure

A controlled test gives the checker a known-bad input. The sixth hypothesis acts as that test fixture without changing papers.md.

  • Paste the following prompt into Claude Code:
Edit `hypotheses.md`. Add a sixth hypothesis titled `Citation Check Test`. Give it a one-sentence provisional claim, a `Based on:` line containing only arXiv ID `2502.99999`, and one falsifiable `Test:` line. Do not add this ID to `papers.md`. This fake citation is intentional and its failure is expected. Confirm that `hypotheses.md` now contains 6 hypotheses.

What does this prompt do?

The prompt adds one controlled citation test to hypotheses.md. It leaves the trusted evidence in papers.md unchanged.

That separation gives the new checker a clear question to answer. Does the added ID match a real paper in the saved evidence set?

Claude Code confirms that hypotheses.md now contains exactly 6 hypotheses.

Add and run the citation check

The citation stage checks every unique ID through one request. It also compares each returned title with the exact title already saved in papers.md.

The stage reads the result count plus the returned entries. A successfully loaded feed cannot prove that a requested paper exists.

Before you run the new stage, which result do you expect for the planted ID?

  • Add the citation stage and run it against the current files by pasting this prompt into Claude Code:
Edit `.claude/skills/research-team/SKILL.md` and add a final citation-check stage after the ranker. The stage must read `hypotheses.md`, `report.md`, and `papers.md`; collect every unique arXiv ID cited in `hypotheses.md` or `report.md`; and make exactly one WebFetch request for all IDs using `https://export.arxiv.org/api/query?id_list=ID1,ID2,...`, with the real comma-separated IDs in place of the example. Never make one request per ID. Respect arXiv's limit of one request every three seconds.

The check must read `opensearch:totalResults` and the returned entries, not merely whether the page loaded. A missing ID returns a normal page with `totalResults` equal to 0 when checked alone. Mark an ID `PASS` only when arXiv returns its entry and its exact title matches the title saved in `papers.md`; otherwise mark it `FAIL`. Update `report.md` so every citation has `PASS` or `FAIL` beside it. Remove every hypothesis with a failed citation from the main ranking, and append a `Citation Check` section naming each failed ID and why its hypothesis was dropped.

After editing the skill, run only this new citation-check stage on the current files. This is an expected-failure test. Show the line for `2502.99999` and confirm whether the sixth hypothesis was removed from the report.

What does this prompt do?

The prompt adds one bulk id_list lookup after the ranker finishes. The three-second pause keeps the search request separate from the citation request.

Each citation passes only when arXiv returns its entry. Its title must also match the exact title in papers.md.

Any failed citation removes its hypothesis from the main ranking. The appended Citation Check section preserves the reason.

Your known-bad fixture did its job. Claude Code prints 2502.99999: FAIL (not on arXiv).

The sixth hypothesis is absent from the main ranking. The Citation Check section records why it was dropped.

Fake citation passing?

  • Check that the stage reads opensearch:totalResults plus the returned entries. A loaded feed alone does not prove the ID exists.
  • Confirm that the stage sends all unique IDs through one comma-delimited id_list request.
  • Still stuck? Help me debug the citation check.

✔️ Awesome, I've got everything!

Great. Your skill now checks every citation after the ranker finishes.

ⓧ I'd like to double check the full code

  • Compare .claude/skills/research-team/SKILL.md with the complete file below:
---
name: research-team
description: Researches a question with arXiv abstracts, three subagents, and one citation-checking pass.
disable-model-invocation: true
allowed-tools:
  - WebFetch
  - Read
  - Write
  - Edit
  - Agent(generator)
  - Agent(critic)
  - Agent(ranker)
---

Research question: $ARGUMENTS

Complete every stage in order. Do not start a later agent until the expected file from the earlier agent exists and has the required count. The agents pass work only through `papers.md`, `hypotheses.md`, `critique.md`, and `report.md`.

## 1. Collect eight papers

Build a valid arXiv `search_query` from the research question using distinctive terms and `all:` fields. Make one WebFetch request to:

`https://export.arxiv.org/api/query?search_query={encoded-search-query}&max_results=8&sortBy=relevance`

Overwrite `papers.md` with exactly eight numbered entries. Copy each arXiv ID, exact title, exact abstract, and abstract-page link. Ask WebFetch for the exact titles and abstracts. Do not fetch PDFs. Keep all claims within the abstracts.

## 2. Generate hypotheses

Run the `generator` subagent. Wait for it to finish. Read `hypotheses.md` and continue only when it contains exactly five hypotheses.

## 3. Critique hypotheses

Run the `critic` subagent. Wait for it to finish. Read `critique.md` and continue only when all five hypotheses have evidence, novelty, and testability scores.

## 4. Rank hypotheses

Run the `ranker` subagent. Wait for it to finish. Read `report.md` and continue only when it contains exactly five ranked hypotheses.

## 5. Check every citation

Read `papers.md`, `hypotheses.md`, and `report.md`. Collect the unique arXiv IDs cited in either hypothesis file. Wait until at least three seconds have passed since the paper-search request. Make exactly one WebFetch request for the complete comma-delimited list:

`https://export.arxiv.org/api/query?id_list=ID1,ID2,...`

Do not make one request per ID. Read `opensearch:totalResults` and the returned entries. Do not treat a loaded page as proof that an ID exists.

For every cited ID:

- Mark `PASS` only when arXiv returns an entry for that ID and its exact title matches the title in `papers.md`.
- Mark `FAIL` when no entry is returned, the count is short, the ID is absent from the returned entries, or the title does not match.

Edit `report.md` so `PASS` or `FAIL` appears beside every citation. Remove each hypothesis with any failed citation from the main ranking. Append a `Citation Check` section that lists every failed ID and explains why the hypothesis was dropped. If no citation fails, say that every retained citation passed.

Finish by reporting these required counts and files:

- `papers.md`: 8 papers
- `hypotheses.md`: 5 hypotheses
- `critique.md`: 5 critiques
- `report.md`: 5 ranked hypotheses before any failed-citation removal
Run the clean workflow

The generator overwrites hypotheses.md whenever the complete skill runs. A clean run therefore replaces the six-entry test file with five fresh hypotheses before checking their citations.

Before you rerun the team, how many hypotheses do you expect the clean workflow to leave behind?

  • Run the clean workflow by pasting the same skill command into Claude Code:
/research-team Why do large language models hallucinate, and what reduces it?

What does this command do?

The command passes the research question into the skill through $ARGUMENTS. The skill reruns paper collection before starting each subagent in sequence.

The final stage checks every unique citation in one request. It then writes the citation result into report.md.

Claude Code reports 8 papers. It reports 5 hypotheses.

Claude Code reports 5 critiques. It reports 5 ranked hypotheses.

You have closed the trust gap in the workflow. The new report.md shows PASS beside every retained citation.

The temporary sixth hypothesis is gone. The final hypotheses.md contains exactly 5 fresh hypotheses.

Still seeing six hypotheses?

  • Confirm that you reran the complete skill with the original research question. Running only the citation stage leaves the temporary entry in hypotheses.md.
  • Check that the generator still overwrites hypotheses.md with exactly five hypotheses.
  • Still stuck? Help me restore the clean five-hypothesis workflow.

Secret mission

Add an Elo Tournament

Turn the ranker's hidden comparisons into a visible Elo tournament. You will record every head-to-head debate, preserve the rating total, and compare the tournament order with the citation-checked report.

Clean Up Your Resources

Clean Up Your Resources

This project created only local files, so it adds no ongoing resource costs beyond the Claude plan you already use. Choose whether to keep the workflow ready, pause your session, or delete the local project.

Resources you used:

  • The local my-research-team folder containing your complete research workflow.
  • The subagent files .claude/agents/generator.md, .claude/agents/critic.md, and .claude/agents/ranker.md.
  • The project skill at .claude/skills/research-team/SKILL.md.
  • The workflow files papers.md, hypotheses.md, critique.md, report.md, and elo.md.

Keep everything running

No action is needed. Choose this if you want to research new questions with the same subagents and citation-checking workflow.

  • Keep the my-research-team folder unchanged so every agent, skill, and report remains available.
  • Continue using /research-team with new research questions whenever you want another evidence trail.
  • Keep report.md and elo.md together so you can compare the citation-checked ranking with the Elo order.

Pause - I'll come back to this later

Pausing closes the current Claude Code session while preserving every local file for your next research question.

  • Exit Claude Code.

You return to your terminal prompt. Your complete workflow remains inside my-research-team for your next session.

Delete - I don't want to use this again

Deleting the project folder permanently removes the agents, skill, evidence, reports, and Elo results. Save anything you want to keep before you continue.

  • Save a copy of any report you want to keep outside the my-research-team folder.
  • Exit Claude Code.

macOS

  • Move out of my-research-team and delete the folder by running these commands:
# Move to the folder that contains my-research-team.
cd ..
# Delete the project folder and everything inside it.
rm -rf my-research-team
What do these commands do?

The first command leaves the active project folder. The second command permanently deletes the folder and every listed local resource inside it.

  • Open the parent folder in Finder.
  • Confirm that my-research-team is no longer listed.

You should no longer see the project folder. That clears every local resource created during the project.

Windows

  • Move out of my-research-team and delete the folder by running these commands in PowerShell:
# Move to the folder that contains my-research-team.
cd ..
# Delete the project folder and everything inside it.
Remove-Item -Recurse -Force my-research-team
What do these commands do?

The first command leaves the active project folder. The second command permanently deletes the folder and every listed local resource inside it.

  • Open the parent folder in File Explorer.
  • Confirm that my-research-team is no longer listed.

You should no longer see the project folder. That clears every local resource created during the project.

Nice Work!

Nice Work!

You did it. Your file-based AI co-scientist in Claude Code now turns eight arXiv abstracts into five ranked hypotheses with checked citations.

You've learned how to:

  • Design three isolated subagents whose focused roles pass work visibly through papers.md, hypotheses.md, critique.md, and report.md.
  • Orchestrate a reusable research skill with /research-team to collect exactly eight abstracts before producing five evidence-grounded hypotheses.
  • Use citation verification to catch 2502.99999 as FAIL through one id_list request. The final report keeps only citations marked PASS.
  • Complete the optional Secret Mission by adding an Elo tournament whose ten pairwise debates preserve a total rating of 6000.

Ready to quiz yourself?