Repository navigation
feat(sidebar): write a Claude Code prompt that reimplements the paper's model or system - #18
Merged
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
A new Implement tab in the sidebar, next to Q&A, so the Q&A panel stays as it was.
web_search(5 uses) andweb_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.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 afterpause_turn, retrying once on a malformed reply) is now a sharedaskJson.findSystemsandwriteImplementationuse it too. Prompts, schemas and validators are inshared/implement.js.askport routesask/systems/implementrequests.shared/models.jsgets awebFetchtool version per model (web_fetch_20260209, orweb_fetch_20250910for Haiku and unknown models), matchingwebSearch.web_fetch_tool_resultblocks are recorded as verified sources.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.pngcan replace one of the five listed screenshots.How it was tested
npm run checkpasses.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 sendsweb_search_20260209+web_fetch_20260209, the target, the other systems and the notes, and resumes afterpause_turnpast aweb_fetch_tool_result. It checks the prompt, the verified sources (a made-up URL is dropped), the status counts and the.mddownload. 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.parseSystems/parseImplementation: page clamping, source filtering, rejecting malformed replies.🤖 Generated with Claude Code