Skip to content

feat(sidebar): write a Claude Code prompt that reimplements the paper's model or system - #18

Merged
mohph197 merged 1 commit into
mainfrom
feat/implementation-prompt
Oct 29, 2026
Merged

mohph197 merged 1 commit into
mainfrom
feat/implementation-prompt

Conversation

@mohph197

Copy link
Copy Markdown
Owner

What changed

A new Implement tab in the sidebar, next to Q&A, so the Q&A panel stays as it was.

  1. Write implementation prompt asks Claude which systems the paper implements (models, architectures, algorithms, tools). It lists only the paper's own contributions, merges variants of one model, and leaves out baselines.
  2. If there's exactly one, the prompt is written straight away. If there are several, the sidebar lists them (name, kind, summary, pages) and you pick one. Choose another system switches later.
  3. The prompt is a self-contained brief for Claude Code. It covers the goal, a full specification with page references (architecture, equations, hyperparameters, data, training, evaluation), the gaps the paper leaves open with a recommended choice for each, the expected results, a plan with milestones and checks, and working rules for the agent.
  4. Optional notes (e.g. "PyTorch, one GPU") and Search the web, on by default. With it on, the request includes web_search (5 uses) and web_fetch (8 uses), so Claude can find and read the official code, project page or appendix. Web pages are listed only if a search returned them or a fetch opened them.
  5. Copy prompt / Download .md. Systems, the prompt and the notes are cached per PDF (impl:<hash>); Clear cache on the options page removes them.

Internals:

  • askPaper's loop (structured output, falling back to prompt-only JSON when the model doesn't support it, resuming after pause_turn, retrying once on a malformed reply) is now a shared askJson. findSystems and writeImplementation use it too. Prompts, schemas and validators are in shared/implement.js.
  • The service worker's ask port routes ask / systems / implement requests.
  • shared/models.js gets a webFetch tool version per model (web_fetch_20260209, or web_fetch_20250910 for Haiku and unknown models), matching webSearch. web_fetch_tool_result blocks are recorded as verified sources.
  • No new permissions or dependencies. Requests still go only to api.anthropic.com.

Why

Many papers describe a model or system that readers want to rebuild. A detailed prompt that's faithful to the paper and marks what the paper doesn't say gives Claude Code a good starting point. A tab keeps this from crowding the Q&A list.

Docs

README (feature, how it works, file list, e2e coverage), PRIVACY.md (what the Implement tab sends and caches, web fetch), and store/LISTING.md (description, data usage). Store screenshots are regenerated for the tab bar. The new store/screenshot-6-implement.png can replace one of the five listed screenshots.

How it was tested

  • npm run check passes.
  • npm run test:e2e: all 20 steps pass, including a new one. With a mocked API, it lists two systems (an out-of-range page is dropped), checks that the listing request has no tools and caches the paper, and picks the second system. It then checks that the prompt request sends web_search_20260209 + web_fetch_20260209, the target, the other systems and the notes, and resumes after pause_turn past a web_fetch_tool_result. It checks the prompt, the verified sources (a made-up URL is dropped), the status counts and the .md download. After a reload, it checks the prompt, the notes and the open tab are restored from cache with no API call, and that the Q&A cards are unchanged.
  • A Node sanity check of parseSystems / parseImplementation: page clamping, source filtering, rejecting malformed replies.
  • Matcher and text extraction weren't touched.

🤖 Generated with Claude Code

…plement the paper

A new "Implement" tab next to Q&A. Claude first lists the systems
(models, architectures, algorithms) the paper implements; with several,
the reader picks one. Claude then writes a self-contained Claude Code
prompt: specification with page references, gaps with recommended
choices, expected results and milestones with checks. Optional notes and
"Search the web" (web search + web fetch, for official code and
appendices). Prompts can be copied or downloaded and are cached per PDF.

The JSON request loop (structured output, pause_turn resume, malformed
reply retry) is factored out of askPaper and shared by all requests, and
web fetch results count as verified web sources.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mohph197
mohph197 merged commit 3616a3b into main Oct 29, 2026
2 checks passed
@mohph197
mohph197 deleted the feat/implementation-prompt branch October 29, 2026 10:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant