How to build a self-improving knowledge base for customer support with Claude
Short answer. A self-improving support knowledge base keeps every answer your team gives as a short entry, records every question it couldn't answer as a gap, and flags entries when the code or page they came from changes. Claude does the writing and the upkeep: it builds the first version from your repo and docs, answers the gaps from the code, and merges duplicates. A person checks what reaches customers, and the chat on your site answers only from checked entries.
Since Andrej Karpathy described his "LLM wiki" in April 2026, building a knowledge base that Claude writes and keeps up has become a popular project. The idea is raw sources the model reads, pages the model writes, and regular passes where it looks for contradictions and gaps. Most people build one for themselves. Support may be the best use for it, because customers bring new questions every day, and each one shows exactly where the knowledge base is thin. It becomes your support chat's memory.
The loop
- Write the first version from what you already have. Claude reads your code, docs and site and writes short entries, each pointing at the files or page it came from.
- Answer from it, and hand over when it doesn't know. The chat on your site answers only from checked entries. When nothing covers a question, it passes the chat to a person instead of guessing.
- Keep the question. Every handover for missing knowledge becomes a gap, recorded in the customer's own words.
- Answer it once. A person answers, or Claude answers from the code, and the answer is saved as an entry. The next customer who asks gets it straight away.
- Flag what changed. When the files or page an entry came from change, the entry is marked stale until someone checks it.
- Clean up. Merge entries that say the same thing, and retire the ones that are wrong.
Steps 3 and 4 are what make it improve. Without them a knowledge base only gets older.
What it did on a live product
FanWake is a chat tool for creators, and its support chat has run on Afterchat since late October 2026. On 31 October a Claude Code session wrote its knowledge base from the product's own code and docs: 152 entries in 10 topics, which I read and approved as one batch.
Since then, 26 questions came in that no entry covered:
- 17 have been answered and saved as entries.
- 6 were dismissed as not worth an entry.
- 3 are still open.
Two of the 17 have since answered later customers, three times between them. Another 18 entries came straight from what was said in chats. The knowledge base now holds 164 checked entries, and 168 entries point at the code they were written from.
The upkeep works too. On 1 November FanWake changed the plans on its site. The next read of the site marked the three entries that still described the old plans as stale, with the new wording quoted next to each.
One thing hasn't happened yet: the share of chats it answers on its own hasn't climbed week by week. FanWake gets about ten chats a week, and most are questions nobody asked before. So for now the knowledge base grows faster than questions repeat. A product whose customers ask the same things more often would see that second half of the loop sooner.
Starting from your site: what we found on our own
We moved Afterchat's own support onto Afterchat on 20 November 2026. Reading our 7 site pages produced 103 entries, and most of the work was cleaning them up:
- The same answer came out of every page that repeats it: ten versions of "do replies go out without approval".
- The example conversation in our landing page's demo turned into a fact: "Annual plans can be refunded within 14 days". We don't sell annual plans.
- Topics were named after our pages instead of after what customers ask.
A Claude Code session connected over MCP did the cleanup:
- It merged or archived 45 entries and kept 58.
- It wrote 7 new entries from the code and our privacy notice, on things the site never said: installing the chat, identifying signed-in users, where data is stored.
I approved all of it in one pass: 65 checked entries in 8 topics, live the same day.
What keeps it from getting worse
A knowledge base that writes itself can drift as easily as it improves. Four rules keep it honest:
- Customers only hear checked entries. Drafts wait for a person, and anything about prices, limits or policy always does.
- Every entry keeps its source, so a wrong answer is one click from the entry that caused it.
- One entry per fact. A new answer updates the closest existing entry instead of adding a near copy.
- No customer details in entries. A note about one customer's account goes on that conversation, not into what the chat tells everyone.
Doing it with Claude
Afterchat is in Claude's connector directory. In Claude you add it from there and sign in, and in Claude Code it's one command in your repo. Either way Claude can:
- search the knowledge base
- list the gaps
- write entries with the files they came from
- check which entries a code change affects
- merge duplicates
By default, replies to customers wait for your yes. It's free while in early access. Setup: Claude Code, Claude.
Questions
What is a self-improving knowledge base?
A knowledge base that gets better as it's used. Questions it couldn't answer are recorded, answered once and saved, and entries are flagged when what they describe changes. In support, every chat your team answers can add to it.
Can Claude build a knowledge base from my codebase?
Yes. Claude Code reads your repo and writes short entries that each point at the files they came from. On FanWake one session wrote 152 entries in 10 topics. The work happens on your machine, so the support tool never sees your code.
How is this different from Karpathy's LLM wiki?
It's the same idea, a model writing and keeping pages you can read, applied to support. Two things differ: customers' questions decide what gets written next, and a person checks entries before customers hear them.
Does it learn from conversations on its own?
From the answers people give, yes. Once a reply is sent, the answer is in the vault, and the chat handles that question by itself from then on. It never turns a guess into an entry. Questions it couldn't answer wait as gaps until someone answers them.