Workshop: Building Research Websites with Claude Code
Claude Code can do most of the mechanical work of a research website: scaffolding the site, drafting pages, building tables and diagrams, and fixing build errors. This workshop shows how to start one in about an hour, and how to keep its content trustworthy afterwards.
Setup instructions last checked against the Claude Code, Astro and Vercel documentation on 15 October 2026.
About this workshop
Section titled “About this workshop”Organized by the Quantified Uncertainty Research Institute (QURI). For background, see the LongTermWiki pages on AI-assisted knowledge management, LongTermWiki itself and QURI.
A live session has three parts: a short presentation on how Claude Code builds research websites and which topics suit the approach, a hands-on session where you start your own site, and a closing round to share progress and problems. The slides are online. A version of this workshop was given at MOX SF in January 2026.
What we’re building
Section titled “What we’re building”You’ll start a research mini-website: a structured knowledge base, mini-textbook or wiki on a topic in prioritization research, EA cause areas, or a related field. A finished site takes longer, but an hour gets you a solid start.
- You choose the topic, the structure and the editorial direction.
- Claude Code does the heavy lifting: scaffolding, drafting, creating pages, fixing build errors.
- You review, edit and iterate.
What is Claude Code?
Section titled “What is Claude Code?”Claude Code is Anthropic’s agentic coding tool. It reads and edits the files in your project, runs commands and searches the web, all from a conversation: you describe what you want, and Claude does it. It runs in the terminal, in VS Code and JetBrains IDEs, in the Claude desktop app, and in the browser at claude.ai/code. This walkthrough assumes the terminal; the web guide covers the browser.
Demo projects
Section titled “Demo projects”All of these were built mainly with Claude Code:
| Project | What it is |
|---|---|
| LongTermWiki | AI safety knowledge base: risks, interventions, organizations, key uncertainties. Has a YAML data layer and custom components. |
| Delegation Risk | Mini-textbook with theory, case studies and interactive tools |
| Evaluation Engineering | Small book with numbered chapters on systems that produce evaluations at scale |
| Robust Reasoning Processes | Working notes on reasoning processes that resist corruption |
LongTermWiki’s source is at github.com/quantified-uncertainty/longterm-wiki. It took months of iteration, but its basic structure was scaffolded in a single session. The other three live in the CAIRN repository, and this handbook describes how that repository works.
Rough time budget (hands-on session)
Section titled “Rough time budget (hands-on session)”| Phase | Time | What you’re doing |
|---|---|---|
| Setup & scaffold | ~10 min | Create the project, start the dev server, open Claude Code |
| Initial structure | ~10 min | Create the page structure with one large prompt |
| Content | ~35 min | Expand pages, iterate on content, add detail |
| Polish | ~10 min | Cross-references, fixes, appearance |
| Wrap-up | ~5 min | Commit, discuss deployment |
Installing Claude Code
Section titled “Installing Claude Code”The native installer is the recommended method. It needs no Node.js and updates itself.
curl -fsSL https://claude.ai/install.sh | bashirm https://claude.ai/install.ps1 | iexYou don’t need to run it as Administrator. Installing Git for Windows is recommended, because it gives Claude Code a Bash shell; without it, Claude Code uses PowerShell.
brew install --cask claude-codeHomebrew installs don’t update themselves. Run brew upgrade claude-code now and then.
winget install Anthropic.ClaudeCodeWinGet installs don’t update themselves either. Run winget upgrade Anthropic.ClaudeCode now and then.
Open a new terminal, then run claude --version to check the install and claude to log in through your browser. An npm package also exists (npm install -g @anthropic-ai/claude-code, Node.js 22 or later). If you use it, never run it with sudo; Anthropic’s docs warn this causes permission and security problems. See the setup docs for other platforms and for install troubleshooting.
Key resources
Section titled “Key resources”- Claude Code docs, including the quickstart and best practices
- github.com/anthropics/claude-code
- VS Code extension and desktop app, if you’d rather not work in a terminal
Terminal setup: the multi-window workflow
Section titled “Terminal setup: the multi-window workflow”Run several terminal windows at once:
| Window | Purpose | What’s running |
|---|---|---|
| Window 1 (large) | Claude Code | claude |
| Window 2 | Dev server | npm run dev, a live preview of your site |
| Window 3 | General terminal | Git commands, file browsing, manual edits |
Keep your browser open at http://localhost:4321. It reloads as Claude changes files, so you can look at the result, then go back and tell Claude what to fix.
- Cmd+D: split pane vertically
- Cmd+Shift+D: split pane horizontally
- Cmd+[ / Cmd+]: switch between panes
A good layout is Claude Code in a tall left pane, the dev server top right and a general terminal bottom right.
Split the built-in terminal with Cmd+\ (Ctrl+Shift+5 on Windows/Linux), or use the Claude Code extension with Claude in the sidebar and terminals below.
- Alt+Shift+D: duplicate pane
- Alt+Shift+Plus: split vertically
- Alt+Shift+Minus: split horizontally
- Alt+Arrow: switch panes
Choosing a framework
Section titled “Choosing a framework”| Framework | Best for | Scaffold command |
|---|---|---|
| Astro + Starlight | Wikis and research docs (our choice) | npm create astro@latest -- --template starlight |
| Docusaurus | Docs and blogs | npx create-docusaurus@latest my-wiki classic |
| VitePress | Vue-based docs | npx vitepress init |
| MkDocs Material | Python-based docs | pip install mkdocs-material && mkdocs new . |
We use Starlight because pages are plain Markdown/MDX files, which Claude Code edits directly. Search, sidebar, dark mode and mobile layout work out of the box, the output is a fast static site, and React components are available when you need interactivity. The Claude Code workflow is the same for any of these frameworks.
Non-code alternatives
Section titled “Non-code alternatives”| Tool | AI integration | Publishing | Best for |
|---|---|---|---|
| Obsidian + Quartz | AI plugins, local-first | Quartz builds a static site from your vault | Personal research wikis, interlinked notes |
| Notion | Built-in Notion AI | Notion Sites or public sharing | Team wikis, collaborative docs |
| Google NotebookLM | Built in, grounded in your sources | Export only | Q&A over a fixed set of documents |
These are quicker to start if you don’t want to manage code, but harder to customize. The code approach suits a site you want full control over, with custom components, that will keep growing.
Workshop walkthrough
Section titled “Workshop walkthrough”-
Pick your research topic
Choose a topic in prioritization research, EA cause areas, or a related field that you know something about. For the hands-on session, aim for 3–5 sections of 2–4 pages each.
Examples of a good scope:
- “Key uncertainties in AI governance” (Policy Approaches, Technical Standards, International Coordination, Key Debates)
- “Guide to the biosecurity funding landscape” (Major Funders, Funding Gaps, Grant Mechanisms, Emerging Priorities)
- “S-risk research overview” (Definitions & Scope, Key Scenarios, Interventions, Open Questions)
- “Forecasting methods for cause prioritization” (Base Rates, Expert Elicitation, Prediction Markets, Model Comparison)
- “Animal welfare intervention cost-effectiveness” (Factory Farming, Wild Animal Welfare, Measurement Challenges, Key Organizations)
Too broad: “Everything about existential risk”. Too narrow: “One specific Metaculus question”, which is a page, not a wiki.
-
Scaffold the project
Either option works for the workshop.
Terminal window npm create astro@latest -- --template starlight my-wikiAnswer Yes to “Install dependencies?” and “Initialize a new git repository?”, then
cd my-wiki.Windows users: avoid paths with spaces (e.g.
C:\Users\John Smith\...). Use a short path such asC:\projects\my-wiki.Our starter adds Mermaid diagrams, KaTeX maths, React components and a
CLAUDE.md:Terminal window npx degit quantified-uncertainty/cairn/starters/research-wiki my-wikicd my-wikinpm installgit initIt includes example pages showing each feature. Delete them once you have your own content.
Checkpoint: a
my-wiki/folder containingsrc/content/docs/,astro.config.mjsandpackage.json. -
Start the dev server (Window 2)
Terminal window npm run devOpen
http://localhost:4321. The starter shows a “My Research Wiki” splash page; vanilla Starlight shows “Welcome to Starlight”. If port 4321 is taken, runnpm run dev -- --port 4322and open that port instead. -
Start Claude Code (Window 1)
Terminal window claude -
Create the whole page structure in one prompt
Give Claude one detailed prompt that creates the skeleton of the wiki. Shift+Enter inserts a newline in most terminals; if it doesn’t in yours, type
\then Enter, or run/terminal-setuponce. Enter submits.Here is a worked example you can adapt:
I'm building a research wiki about key uncertainties inAI governance. Create the following structure:Sections:1. Policy Approaches — pages: compute-governance,licensing-regimes, liability-frameworks,international-treaties2. Technical Standards — pages: model-evaluations,safety-benchmarks, deployment-standards,red-teaming-requirements3. International Coordination — pages:us-china-dynamics, eu-ai-act, global-governance-gaps,multilateral-proposals4. Key Debates — pages: open-vs-closed-source,pace-of-regulation, voluntary-vs-mandatory,frontier-vs-broad-regulationFor each page:- Create an MDX file in src/content/docs/ withappropriate subdirectories- Include frontmatter with title and description- Write a 2-3 paragraph introduction covering thecurrent state of debate- Add 3-4 section headers outlining what the pagewill cover (e.g., Background, Key Arguments,Open Questions, Further Reading)- Include at least one Markdown table where relevant(e.g., comparing policy proposals, listing keyactors, summarizing positions)Also:- Remove the default/example pages that came withthe template (e.g., the example/ directory)- Update astro.config.mjs to use autogenerate foreach section directory, like:{ label: 'Policy Approaches',autogenerate: { directory: 'policy-approaches' } }- Update the site title to"AI Governance: Key Uncertainties"- Use .mdx extension for all files.I'm building a research wiki about [TOPIC]. Createthe following structure:Sections:1. [Section 1] — pages: [page-a], [page-b], [page-c]2. [Section 2] — pages: [page-d], [page-e]3. [Section 3] — pages: [page-f], [page-g], [page-h]4. [Section 4] — pages: [page-i], [page-j]For each page:- Create an MDX file in src/content/docs/ withappropriate subdirectories- Include frontmatter with title and description- Write a 2-3 paragraph introduction- Add section headers for what the page will cover- Include at least one Markdown table where relevantAlso:- Remove the default/example pages that came withthe template- Update astro.config.mjs to use autogenerate foreach section directory- Update the site title to "[YOUR WIKI NAME]"- Use .mdx extension for all files.I'm building a mini-textbook about [TOPIC]. Createthe following chapter structure:Chapters:1. [Chapter 1 Title] — 3 pages covering [subtopics]2. [Chapter 2 Title] — 3 pages covering [subtopics]3. [Chapter 3 Title] — 2 pages covering [subtopics]4. [Chapter 4 Title] — 2 pages covering [subtopics]Each chapter should have an index.mdx overview pageplus individual topic pages. Write in a clear,analytical tone aimed at researchers and policyprofessionals.For each page, include:- A clear introduction explaining why this matters- Key concepts with explanations and evidence- At least one concrete example or case study- An "Open Questions" section where relevantAlso:- Remove the default/example pages that came withthe template- Update astro.config.mjs to use autogenerate foreach chapter directory- Update the site title to "[YOUR TEXTBOOK NAME]"- Use .mdx extension for all files.Checkpoint: after a few minutes, the browser shows every section in the sidebar, with stub pages that have introductions.
-
Check the browser and start expanding
Pick a page and fill it in:
Expand the page at src/content/docs/policy-approaches/compute-governance.mdxwith detailed content. Include the key proposals (chip export controls, computethresholds, KYC for cloud), a table comparing approaches by feasibility andeffectiveness, and a section on open questions.Or react to what you see:
The intro on the licensing-regimes page is too vague. Add specific examplesof existing licensing proposals (EU AI Act tiers, proposed US frameworks),a comparison table, and the key arguments for and against.Claude Code can search the web, which matters for research content: “Search for recent papers on [topic] and add a literature summary to this page.” To draft several pages at once, ask it to use subagents: “Draft these four pages in parallel using subagents.”
Quality comes from iterating in layers. The first prompt gives a scaffold; the next two or three make it good:
Turn You say What improves 1 ”Create a page about compute governance” A generic overview 2 ”Too surface-level. Add the specific proposals: chip export controls (Oct 2022 BIS rules), compute thresholds (10^25 FLOP), KYC for cloud. Include a table comparing them by feasibility and effectiveness.” Specific proposals and a structured comparison 3 ”The Open Questions section is weak. Add: (1) Does compute governance become less relevant as algorithmic efficiency improves? (2) How do you enforce thresholds when distillation makes smaller models more capable?” The questions researchers actually care about 4 ”Add cross-references to the licensing-regimes and international-coordination pages.” A connected knowledge base instead of isolated pages The most common mistake is creating 15 shallow pages instead of making 5 good ones.
-
If you’re stuck, try these prompts
What you want Prompt Deepen a page ”Expand [page] with specific evidence, key arguments from the literature, and quantitative estimates where available” Add structure ”Add a comparison table to [page] covering the major positions/proposals/interventions” Connect pages ”Add cross-references between related pages — link from each page to relevant others” Sharpen analysis ”Rewrite the intro of [page] to be more analytically precise. State the key cruxes upfront.” Add a diagram ”Add a Mermaid diagram to [page] showing the causal chain from [intervention] to [outcome]“ Create a page ”Create a new page at src/content/docs/[section]/[name].mdx about [topic]“ Fix something broken ”The dev server is showing an error. Read the terminal output and fix whatever is wrong.” Research and write ”Search the web for [topic], then update [page] with current information and citations” Add a literature review ”Add a ‘Key Papers’ section to [page] summarizing the 3-5 most important papers on this topic” Create an overview ”Create an index page at src/content/docs/index.mdx that summarizes the research area and links to all sections” -
Customize the appearance (about 2 minutes)
Customize this site: change the title to "[Your Research Topic]",add a tagline "[your tagline]", and change the accent colorto [blue/green/purple/orange]. Also update the hero sectionon the landing page.Starlight supports theme customization of colours, fonts and CSS.
-
Save your progress (Window 3)
Terminal window git add -A && git commit -m "workshop: initial research wiki"Commit after the scaffold, after expanding content and before changing the appearance.
git diffshows what changed, andgit restore <file>reverts one file. Inside Claude Code, Esc Esc (or/rewind) rolls back Claude’s own edits and the conversation to an earlier point.Checkpoint: a multi-section research site with several fleshed-out pages, cross-references and your own branding.
Claude Code tips
Section titled “Claude Code tips”Essential commands
Section titled “Essential commands”| Command | What it does |
|---|---|
claude | Start Claude Code in the current directory |
claude "prompt here" | Start with an initial prompt |
claude --continue | Reopen the most recent conversation in this directory |
claude --resume | Pick an earlier conversation to reopen |
| Shift+Enter | New line (or \ then Enter; /terminal-setup fixes Shift+Enter in some terminals) |
| Shift+Tab | Cycle permission modes: Manual, Accept edits, Plan, Auto |
| Esc | Stop Claude mid-response, keeping the work so far |
Esc Esc / /rewind | Restore code and conversation to an earlier checkpoint |
/clear | Start a fresh conversation with empty context |
/compact | Summarize the conversation so far to free up context |
/context | Show how full the context window is |
/init | Generate a CLAUDE.md for the project |
| Ctrl+D (twice) | Exit |
| Situation | Use |
|---|---|
| Claude is confused or keeps repeating a mistake | /clear, then restate the task. Put lasting corrections in CLAUDE.md. |
| A long session is losing track of earlier instructions | /compact. Claude Code also compacts automatically as the context fills up. |
| Switching to an unrelated task | /clear or a new claude session |
The docs list everything else; feature names change often, so check there rather than relying on this table.
Working effectively
Section titled “Working effectively”Give feedback, not just instructions. Look at the result in the browser and say what’s wrong:
“The analysis is too surface-level. Add specific numbers, cite key papers, and state the key uncertainties.”
Name specific files:
“Read src/content/docs/key-debates/open-vs-closed.mdx and improve it — the arguments section needs steel-manned versions of both sides.”
When Claude asks about something you don’t care about, say “your call” to keep moving.
If Claude creates files in the wrong place (e.g. docs/ instead of src/content/docs/), give exact paths in the prompt and add the convention to CLAUDE.md.
CLAUDE.md: teaching Claude about your project
Section titled “CLAUDE.md: teaching Claude about your project”Claude Code reads CLAUDE.md in the project root at the start of every session. It is a standing brief: the project’s structure, commands and conventions. The QURI starter includes one. Otherwise, run /init to generate one, or ask:
Create a CLAUDE.md for this project. Include the dev command,build command, project structure, content conventions, and thesidebar autogenerate pattern we're using.A minimal hand-written version:
# My Research Wiki
## Commands- `npm run dev` — Start dev server at localhost:4321- `npm run build` — Build for production
## Structure- `src/content/docs/` — All wiki pages (MDX format)- `astro.config.mjs` — Site config and sidebar- `public/` — Static assets (images, etc.)
## Conventions- Use .mdx extension for all pages- Use Markdown tables for comparisons- Keep pages focused on one topic each- Escape $ signs in MDX: \$100- Use autogenerate for sidebar sections in astro.config.mjs- Put images in public/images/ and reference as /images/name.png
## Content Style- Analytical and evidence-based tone- Cite sources where possible- Include "Open Questions" sections- Use tables for comparing positions/proposalsWithout CLAUDE.md, every session rediscovers your project from scratch. With one, Claude knows your commands and conventions from the first message, which matters once you work across many sessions.
Prompting for research content
Section titled “Prompting for research content”What works
Section titled “What works”Be specific about structure:
“Create a page about X with: a background section, a ‘Key Arguments’ section with the major positions, a comparison table, an ‘Open Questions’ section, and a ‘Further Reading’ section.”
Use an existing page as a template:
“Look at src/content/docs/section-1/page-a.mdx and create a similar-style page for [new topic].”
Use web search for current data:
“Research the latest developments in [topic] and write a page with current figures, recent papers, and links to sources.”
Iterate in layers: get the structure right, then fill in detail.
“The section on X is too vague. Add specific estimates, cite Ord/Cotra/Davidson/etc., and state the key cruxes.”
What to watch for
Section titled “What to watch for”- Invented facts and citations. Check numbers, dates, quotes and paper citations. Never trust a URL Claude produces without opening it; ask it to search for real links instead.
- Plausible but wrong numbers. Check any specific dollar figure, percentage or date.
- Lopsided “Key Arguments” sections. Claude tends to strengthen mainstream views and weaken minority ones. Check that each side is stated as its proponents would state it.
- US/Western-centric content. Ask for other perspectives if the topic needs them.
- MDX quirks.
<,{and$in text need escaping. If the build breaks, paste the error to Claude. - Quantity over quality. Ten well-researched pages beat thirty shallow ones.
Reviewing content
Section titled “Reviewing content”Scaffold broadly, then review narrowly. Generate the full structure in the first 20 minutes, then spend the rest of the time improving 3–5 pages.
For pages you want to trust:
- Spot-check citations. If Claude names a paper, organization or statistic, confirm it exists: “Search the web to verify whether [claim] is accurate.”
- Ask for a self-audit. “Read this page and list any claims you’re less than 80% confident are correct.” This is a useful first pass, not a substitute for checking sources.
- Ask what’s missing. “What important perspectives or counterarguments are missing from this page?”
- Look for false precision. Exact percentages, confident timelines and precise costs with no source are typical of LLM drafts. Source them or soften them.
For a site you plan to publish, the Review Workflow page describes the heavier audit-and-verify process used on the CAIRN wikis.
Useful patterns
Section titled “Useful patterns”Auto-generated sidebar
Section titled “Auto-generated sidebar”Instead of listing every page in astro.config.mjs, generate sidebar sections from directories:
sidebar: [ { label: 'Policy Approaches', autogenerate: { directory: 'policy-approaches' } }, { label: 'Key Debates', autogenerate: { directory: 'key-debates' } }, { label: 'Open Questions', autogenerate: { directory: 'open-questions' } },]Pages within a section are sorted alphabetically by filename. To set the order, add sidebar: { order: 1 } to each page’s frontmatter. Numeric filename prefixes such as 01-intro.mdx also sort, but the number ends up in the page’s URL. For a book with numbered chapters, an explicit sidebar list is clearer; two of the CAIRN wikis use one (see Adding a Wiki).
Images
Section titled “Images”Put images in public/ and reference them from the site root:
Tables over paragraphs
Section titled “Tables over paragraphs”For comparisons, positions or structured data, a table is usually clearer than prose:
| Approach | Feasibility | Effectiveness | Key Proponents ||----------|-------------|---------------|----------------|| Compute governance | High | Medium | Brundage, Heim || Licensing regimes | Medium | Medium-High | EU, NIST || Voluntary commitments | High | Low | Industry |Cross-references
Section titled “Cross-references”Links between pages are what make a wiki more than a set of essays:
See [the compute governance page](/policy-approaches/compute-governance/) for details.Deployment (after the workshop)
Section titled “Deployment (after the workshop)”Make sure npm run build succeeds locally first; a hosting platform fails on the same errors.
- Push the repository to GitHub.
- Sign up at vercel.com with GitHub (there is a free tier).
- Open vercel.com/new and select the repository. Vercel detects Astro; click Deploy.
- The site is live at
your-project.vercel.app.
After that, each push to main updates the live site, and each other branch or pull request gets its own preview URL.
- Push the repository to GitHub.
- Sign in at netlify.com with GitHub.
- Add new project → Import an existing project, then select the repository.
- Build command
npm run build, publish directorydist/. - Deploy. The URL looks like
your-site.netlify.app.
- Push the repository to GitHub.
- Go to pages.cloudflare.com.
- Connect the repository, with build command
npm run buildand output directorydist/.
If you’re using Claude Code on the web, see that guide’s working loop, which uses Vercel preview deployments.
After the workshop
Section titled “After the workshop”- Deploy it. A live URL is motivating.
- Run
/initif you don’t have aCLAUDE.mdyet. - Improve before you expand. Make existing pages good before adding more.
- Learn Starlight. The docs cover theming, components and more.
- Turn repeated patterns into components. If you keep writing the same kind of box or table, ask Claude to make it a reusable MDX component.
What scaled projects look like
Section titled “What scaled projects look like”LongTermWiki eventually added content validators (link checking, quality scoring), a YAML data layer with cross-referenced entities, custom React components and automated improvement pipelines. The CAIRN wikis use a lighter setup: an explicit sidebar, generated llms.txt files and a link checker that CI runs after every build (see Build & Tooling). You need none of this to start.
Quick reference links
Section titled “Quick reference links”| Resource | URL |
|---|---|
| Workshop slides | Google Slides |
| QURI | quantifieduncertainty.org |
| Claude Code docs | code.claude.com/docs/en/overview |
| Claude Code setup | code.claude.com/docs/en/setup |
| Claude Code best practices | code.claude.com/docs/en/best-practices |
| Starlight docs | starlight.astro.build |
| Starlight frontmatter reference | starlight.astro.build/reference/frontmatter |
| Astro docs | docs.astro.build |
| MDX docs | mdxjs.com |
| QURI starter | npx degit quantified-uncertainty/cairn/starters/research-wiki my-wiki |
| CAIRN source | github.com/quantified-uncertainty/cairn |
| LongTermWiki source | github.com/quantified-uncertainty/longterm-wiki |
Troubleshooting
Section titled “Troubleshooting”Setup and installation
Section titled “Setup and installation”Node.js too old or missing
- Run
node --version. You need 22.12 or later. Install the LTS version from nodejs.org. - With
nvm:nvm install --lts && nvm use --lts.
claude: command not found after installing
- Open a new terminal window first. If it still isn’t found, the install directory isn’t on your
PATH; see the install troubleshooting docs.
Permission errors (EACCES) when installing
- These come from a global npm install. Use the native installer instead. Don’t use
sudo npm install -g.
Login fails
- Run
claude auth logout, thenclaudeagain. - Check that a corporate VPN or proxy isn’t blocking Anthropic’s servers.
- If the browser doesn’t open, copy the login URL from the terminal into a browser.
npm create astro or npx degit hangs
- Usually the network, especially on crowded workshop Wi-Fi. Run
npm cache clean --forceand retry, orgit clonethe starter instead.
Port 4321 already in use
- Another process, perhaps an old dev server, holds the port. Stop it (
lsof -i :4321, thenkill <PID>on macOS/Linux), or runnpm run dev -- --port 4322.
Build and content errors
Section titled “Build and content errors”Build fails after creating pages
- Usually invalid frontmatter YAML or unescaped special characters (
$,<,{). Paste the error to Claude: “The build failed with this error: [paste]. Fix it.”
Frontmatter YAML errors (bad indentation and similar)
- Usually a colon in an unquoted title. Quote it:
title: "AI: Key Questions".
Build fails with a schema error about title
- Every page needs a
titlein its frontmatter:---/title: "Page Title"/---.
MDX import or syntax errors
- Keep all
importlines together directly after the frontmatter, outside any JSX, and check that each imported component is spelled the same where it’s used. Otherwise, paste the error to Claude.
Claude writes .md files instead of .mdx
- Plain Markdown works for pages without components. If you want
.mdxthroughout, say so inCLAUDE.md.
A component is used without being imported
- Ask Claude to add the import, e.g.
import { Aside } from '@astrojs/starlight/components';at the top of the file.
Mermaid diagrams or maths don’t render
- Vanilla Starlight doesn’t include them. Use the QURI starter, or ask Claude to “add Mermaid diagram and KaTeX math support to this Starlight project”.
Sidebar and navigation
Section titled “Sidebar and navigation”New pages don’t appear in the sidebar
- With
autogenerate, thedirectoryinastro.config.mjsmust match the folder name undersrc/content/docs/. - If a whole section is missing, Claude probably didn’t add it to the config. Ask it to check.
Pages are in the wrong order
- Add
sidebar: { order: 1 }(2, 3, …) to the pages’ frontmatter, or list the pages explicitly in the sidebar config.
Links between pages return 404
- URLs follow the file layout:
src/content/docs/section/page.mdxbecomes/section/page/, with a trailing slash. Folder and file names are case-sensitive.
Images don’t show
public/images/foo.pngis referenced as/images/foo.png, withoutpublic/.
Claude Code sessions
Section titled “Claude Code sessions”Claude seems confused or repetitive
- Use
/clearand restate the task, and make sure you startedclaudefrom the project root, not a subdirectory.
Claude keeps making the same mistake
- Add the correction to
CLAUDE.md, e.g. “Always escape $ signs in MDX files”.
Claude edited the wrong file
- Esc Esc or
/rewindrestores an earlier checkpoint.git diffshows what changed, andgit restore <file>reverts a file. This is why committing after each phase matters.
Terminal crashed or disconnected
- Run
claude --continue. Your files are on disk regardless of the session.
“You’ve hit your session limit” or “weekly limit”
- A subscription usage limit. The message says when it resets;
/usageshows where you stand. Max plans have higher limits.
Dev server
Section titled “Dev server”Dev server crashed
- Restart it with
npm run dev. The usual cause is an MDX syntax error; paste the terminal error to Claude.
Hot reload stopped working
- Restart the dev server (
Ctrl+C, thennpm run dev) and hard-refresh the browser (Cmd+Shift+R/Ctrl+Shift+R).
A page looks garbled
- Usually unescaped characters or an unclosed tag in the MDX. Ask Claude: “The page at [path] looks broken in the browser. Read it and fix the MDX syntax.”
Content quality
Section titled “Content quality”All pages sound the same
- Give Claude a voice (“Write in the style of a GiveWell cost-effectiveness analysis”) and vary the depth (“This is a major page, about 1500 words” vs. “a brief overview, 300 words at most”).
Claude invents organizations, papers or statistics
- Ask it to search before writing factual sections: “Search the web for real organizations working on X, then write this section.”
Claude won’t take a position
- “State which position has stronger evidence and why, while noting the key uncertainties.”
Tables are generic
- Give the exact columns: “Create a table with columns: Proposal, Lead Organization, Implementation Status, Estimated Cost, Key Criticism.”
Deployment
Section titled “Deployment”Build works locally but fails on Vercel or Netlify
- Usually a Node.js version mismatch. Set the Node version in the platform’s settings to match
node --version, or add"engines": { "node": ">=22.12" }topackage.json.
Every page 404s on the deployed site
- Check
baseinastro.config.mjs. At a domain root (the usual case on Vercel and Netlify), omit it or set it to'/'.
The site loads but styles or images are missing
- Usually the site is served from a subpath that
basedoesn’t match.basecontrols asset paths;sitesets the canonical URL and sitemap and doesn’t affect them.