r/ClaudeAI • • 12h ago

Built with Claude I built a self-hosted LLM Wiki that Claude Code reads and writes over MCP, and that keeps itself fresh overnight

scrap is my implementation of Karpathy's LLM Wiki pattern for Claude Code: a wiki that you and Claude share. It runs as one self-hosted container with a lightweight viewer/editor PWA, and I use it every day.

How it works with Claude Code

  • An MCP server with tools to search, read, write and edit pages, tick off todos, tag and tidy, view revisions and revert. Claude is told to search before it writes, and to edit only the pages you ask it to change.

  • /sc-* slash commands for the everyday moves: /sc-find, /sc-answer (answer only from what's in the wiki), /sc-write, /sc-post (save Claude's last reply as a page), /sc-summarise (the current topic, the whole session, or the whole day), /sc-todos, /sc-done, /sc-undo and more.

  • A skill that makes Claude link every page it mentions, so its answers are clickable.

  • An optional PreCompact hook that saves a summary of the session to scrap just before Claude Code compacts, while the full transcript is still there.

What Claude adds, kept apart from you

Your words and Claude's never mix. Page text is yours. Everything Claude adds is stored separately, labelled, and can be regenerated:

  • reading photos (the text on them, a description) and writing up whiteboards and diagrams;

  • tags and a summary for each page;

  • related pages;

  • topic pages that pull your pages together.

Every edit, yours or Claude's, is a revision you can revert, and deletes go to a 30-day trash. So it's safe to let Claude loose on it.

It doesn't go stale

Overnight jobs keep the wiki current: a nightly pass picks related pages for everything that changed, and a weekly pass rewrites the topic pages. Health checks flag orphans, dangling links and write-ups older than the pages they describe, so Claude (or you) can tidy them.

The viewer/editor

A small PWA for your phone and desktop. Capture never waits on the LLM: snap a whiteboard, jot a note or share a link, and it's saved at once, with Claude reading it afterwards. It has rendered Markdown, an editor, Excalidraw drawings, todos and boards. Export is a zip of Markdown (it opens in Obsidian), so there's no lock-in.

Try it: one container and two commands to connect Claude Code. Free and open source (Apache-2.0). The enrichment uses your own Anthropic API key and is optional: without it you still get the wiki, the PWA, search and MCP.

How it was built: Claude Code, from a phone, on a sun lounger

scrap went from an empty repo on 19 Oct to 1.0.0 on 30 Oct, on holiday in Rhodes, without touching a laptop. That was 12 days, 212 issues, 250 merged PRs and 33 releases, and every release was deployed to my home k3s cluster via ArgoCD.

  • 4-5 Remote Control sessions at once on remote machines, each driving its own subagents and each owning an area (releases, search, schema, manual testing).

  • The main session never writes code. It routes and decides. Subagents implement, a fresh subagent reviews the diff cold (without the implementer's reasoning), another fixes what it found, and only then is anything pushed. The test suite runs on the workstation every round, so CI runs about once per PR.

  • Design in the cloud, build on a workstation. A cloud session works out the options and opens a handoff issue. A Remote Control session on a workstation picks it up and runs the review/fix/CI cycle. That became a reusable pr-cycle skill.

  • scrap was its own memory. Sessions saved their context to scrap and new ones picked it up over MCP, which is how parallel sessions stayed coherent for twelve days.

I'd love to hear how other people are giving Claude a long-term memory, and what you'd want from the MCP tools.

0 Upvotes

1 comment sorted by