Self-authoring LLM knowledge base

Prior to 6 months ago, I wouldn't trust an LLM to automatically manage my personal records. They were too dumb and too much of a liability. But recently, Claude Opus 4.6 has been phenomenal and has helped me delete a bunch of bespoke code I had written to organize and manage my knowledge base.

In an interesting case of convergent evolution, I discovered that various friends and I had all independently been building LLM-managed personal knowledge bases. The KB acts as a self-authoring memory system for agents to get the context they need to help with tasks. This saves a lot of time and tokens, makes things much more maintainable and automatable.

Recently, this idea has gotten more attention because Andrej Karpathy tweeted about it. Later, he followed up with a prompt to help people bootstrap their own wiki system.

As with all Karpathy tweets, there is a stampede of people engagement farming in the wake of his posts, which I am guilty of as I write this post. Karpathy's post inspired me to turn my workflow into a skill and to write about it. Previously, my KB management was a lot more ad-hoc. I had organized my KB in a very specific way, and new agents were smart enough to mimic the existing entries for the most part.

The stack

The knowledge base skill

I packaged my KB management workflow as a Claude Code plugin with two skills and a few safety hooks. The main skill is the vault-organizer, which runs a pipeline to keep the vault tidy.

To install it, run the following in Claude Code:

# Add the marketplace
claude plugin marketplace add crypdick/obsidian-knowledge

# Install the plugin
claude plugin install obsidian-knowledge@obsidian-knowledge

The vault-organizer

The organizer runs a single-pass pipeline over the vault. It does various things:

All moves and renames go through the Obsidian CLI, which updates internal links automatically.

The organizer maintains two persistent state files. CHANGELOG.md to keep an audit log of actions taken by the agent, and NEEDS_ATTENTION.md, a list of issues that require my judgment. The agent adds items here instead of making risky guesses.

Remembering conversations

The second skill is remember-conversations. A stop hook fires every few minutes reminding the agent to consider what's worth preserving: a diary entry narrating what happened, a convo note capturing analysis or decision rationales, a guide documenting a procedure, or just a changelog entry. It specifically prompts for gotchas β€” tricky configurations, non-obvious failure modes, things that cost time to figure out.

Session notes get saved in sessions/ subfolders, placed as close as possible to the relevant topic in the vault tree. The filename suffix (-diary or -convo) indicates the type. The changelog links out to these notes for detail rather than trying to document everything inline.

Preventing disasters

My vault contains important legal and financial docs which I cannot afford to lose. I store these in _sources/ directories throughout the vault. The agent can read them (to generate summaries or wiki pages), but it absolutely cannot modify, rename, move, or delete them.

This is enforced by a PreToolUse hook that fires before every Write, Edit, and Bash command. If an agent tries to write to anything inside a _sources/ folder, the hook blocks it and shows a denial message. It also guards against destructive commands like recursive rm or bulk mv operations on vault paths.

There's an escape hatch (I_AM_BEING_CAREFUL=1) for when I want to deliberately override the guard, and the agent is instructed to never self-authorize the escape hatch. It has to show me the blocked message and wait for me to confirm.

Automating maintenance

If you are on Mac or Windows, you can tell Claude to run the skill on a schedule. For example, Run the vault-organizer skill every morning.

Unfortunately, Claude Code Desktop for Linux doesn't exist yet, so the only automation is /loop, which is unfortunately session scopes. Also, Anthropic just killed 3rd part support for Claude Code, which makes my pynchy utility unusable with Claude.

Copyright Ricardo Decal. ricardodecal.com