Parchment
โ† Back to posts

Agentic Wiki

omerโ†’ยทApr 05, 2026ยท7 min readยท10

#ai#web-dev#agents

The AI Knowledge Base System

A persistent, Wikipedia-style wiki that lives in your codebase and travels with your AI agents


The Problem

If you've used Claude Code, Cursor, or GitHub Actions AI agents for more than a few sessions, you've hit this wall:

The agent doesn't remember anything.

Every new session, every new agent run โ€” it starts completely cold. It rediscovers your file structure, re-reads your conventions, re-figures out your tech stack. It makes the same mistakes that burned you last week. It wastes the first several turns just getting oriented. And if you're running agents in CI (like Claude Code GitHub Actions), they have zero memory of what went wrong last time.

This isn't just annoying. It's expensive โ€” in tokens, in time, and in failed agent runs.


The Solution: A Two-Tier Wiki System

The idea is simple: give the agent a Wikipedia it can read before doing anything.

Not a README. Not a CLAUDE.md. A living, hyperlinked knowledge base that agents actively maintain and update โ€” so every future agent starts smarter than the last one.

Two tiers

~/.claude/wiki/              โ† Global wiki (local machine only)
  index.md                   โ† Master catalog of all your projects
  about-you.md               โ† Your work style, preferences, frustrations
  patterns/                  โ† Cross-project patterns (testing, git, agents)
  sessions/                  โ† Cross-project session logs
  projects/                  โ† Per-project summary cards

{repo}/WIKI/                 โ† Project wiki (lives in the repo, in version control)
  index.md                   โ† Project entry point โ€” architecture, key files, data flow
  gotchas.md                 โ† Real failures that happened, documented with cause + fix
  agents.md                  โ† Agent-specific context (env, test setup, required steps)
  decisions/                 โ† Architecture decision records
  sessions/                  โ† Session logs for this project
  tags/                      โ† Tag index pages linking related content

The global wiki lives on your machine. It's for your local Claude Code sessions. It knows who you are, how you work, and gives any session a cross-project view.

The project wiki lives in the repo. It travels with the code. GitHub Actions agents can read it because they check out the repo. It's version controlled, so it grows with the project.


What Problems This Solves

1. Agent dementia

Agents no longer start from zero. Before doing any work, they read WIKI/index.md (60 seconds) and WIKI/gotchas.md. They know the architecture, the conventions, the things that have gone wrong.

2. Repeated failures

The gotchas.md file is a permanent record of every surprising thing that happened โ€” missing dependencies, wrong API inputs, workflow bugs, rate limits. Each entry has a date, a symptom, a cause, and a fix. Agents read this and don't repeat history.

3. Token waste on context discovery

Instead of an agent spending its first 10 turns reading files to understand the codebase, you pre-embed the relevant source files directly into the agent's prompt at dispatch time. The agent arrives with full context already loaded.

4. No institutional memory

Session logs capture what was built, what decisions were made, and why. Next week's agent (or next month's you) can read the session log and understand the full story โ€” not just what the code looks like now, but how it got there.

5. Cross-project pattern drift

The global wiki stores patterns that apply everywhere: how to write tests, how to use git, what agent workflow bugs to avoid. These patterns are automatically available to any project session.


How Agents Use It

The wiki is wired into the system at multiple levels:

  1. CLAUDE.md references the wiki at the top โ€” the first thing any agent reads
  2. WIKI/gotchas.md is injected directly into every GitHub Actions agent prompt at dispatch time
  3. GitHub Actions agents auto-commit a session log entry after every run (success or failure)
  4. At the end of every session, Claude updates the wiki โ€” appending to the session log, adding new gotchas, updating status

The result: the wiki gets smarter after every agent run, automatically.


The Structure in Practice

Here's what a project wiki looks like after a few sessions:

WIKI/
  index.md          โ†’ What the app does, data flow diagram, key files table,
                       design tokens, KV keys, environment variables, conventions
  
  gotchas.md        โ†’ "2026-04-05 โ€” @testing-library/react not installed:
                       agent claimed success but PR had no code because it spent
                       all turns fighting import errors. Fix: always install the
                       package before kicking off an agent run."
  
  agents.md         โ†’ Required GitHub Actions permissions, test setup, mocks
                       needed, exact steps every agent must complete before
                       pushing (tests, type check, commit, push)
  
  decisions/
    agent-workflow.md โ†’ Full debugging history of the 4 bugs we hit setting
                         up claude-code-action, so we never fix them twice
  
  sessions/
    2026-04-05.md   โ†’ Timeline of everything built that day, decisions made,
                       gotchas discovered

Setup: One Prompt

Getting this set up for a new project takes one command in Claude Code:

/setup-wiki

That's it. Claude reads your codebase, understands the stack, and generates all the wiki files with project-specific content โ€” not generic templates. It also updates the global catalog so cross-project context stays current.

For existing projects, it takes about 2 minutes of Claude reading and writing. For new projects, you run it right after initial setup.


The Compounding Effect

This is the key insight: the wiki gets better automatically over time.

  • Every agent run adds a session log entry
  • Every failure adds a gotchas entry
  • Every architecture decision gets documented
  • Every session leaves the next agent smarter

You're not writing documentation. You're building a knowledge base that AI agents actively maintain on your behalf โ€” and that compounds across every project you work on.


Who This Is For

  • Developers using Claude Code for active development
  • Anyone running AI agents in GitHub Actions (claude-code-action)
  • Teams who want AI agents to have real context, not just a README
  • Anyone who's watched an agent burn tokens rediscovering things it should already know

Want the full setup guide? See wiki-knowledge-base-detailed.md

Related posts