Help us improve
Share bugs, ideas, or general feedback.
Codebase intelligence, semantic memory, and multi-provider routing for Claude Code
npx claudepluginhub sashabogi/foundation-pluginUnified codebase intelligence, semantic memory, and multi-provider LLM routing
Share bugs, ideas, or general feedback.
"The future is not set, but it can be guided." -- Hari Seldon

Codebase intelligence and semantic memory for Claude Code, inspired by Asimov's Foundation universe.
Foundation is a Claude Code plugin that gives your AI assistant persistent memory, deep codebase understanding, and automatic session lifecycle management. It is not an MCP server that dumps hundreds of tool definitions into your context window. It is a plugin -- hooks fire on lifecycle events at zero token cost, skills load instructions only when you invoke them, and only 7 essential MCP tools are registered.
The naming comes from Isaac Asimov's Foundation series. In the novels, Hari Seldon created the Foundation to preserve human knowledge through the collapse of the Galactic Empire -- a millennia-long dark age where everything would otherwise be forgotten. This plugin does the same thing for your development work: it preserves architectural decisions, codebase understanding, and project context across sessions, projects, and tools, so nothing is lost when a conversation ends or a context window resets.
Three core systems power the plugin:
/foundation:providers skill.# Add the marketplace
claude plugin marketplace add sashabogi/foundation-plugin
# Install the plugin
claude plugin install foundation
# Restart Claude Code
That's it. No environment variables required for core functionality. Open Brain cloud memory is optional (see setup below).
"I have been watching for 20,000 years."
Demerzel creates a structural understanding of your codebase without requiring Claude to read every file. When you generate a snapshot (via /foundation:snapshot), Demerzel walks your project tree, parses imports and exports, builds a symbol index, maps the dependency graph, and writes a compact representation to .foundation/snapshot.txt.
From that snapshot, Claude can:
The snapshot captures: file paths, line counts, import/export relationships, symbol locations, and the full dependency graph (both import graph and reverse export graph). Search operations against the snapshot are free -- they cost zero tokens beyond the results themselves.

| Tool | Context Cost | What It Does |
|---|---|---|
demerzel_search | FREE | Regex pattern search across the snapshot. Optionally filter by glob pattern. |
demerzel_find_symbol | FREE | Find the file where a symbol (function, class, type, variable) is exported. |
demerzel_find_importers | FREE | Find all files that import a given module. |
demerzel_execute | Truncated | Run shell, JavaScript, or Python in a subprocess sandbox. Output smart-truncated to 10KB. |
demerzel_fetch | Truncated | Fetch URLs with HTML-to-text stripping, JSON pretty-printing, and smart truncation (20KB limit). |
/foundation:snapshot | ~500 tokens | Generate a new codebase snapshot with import/export graphs and symbol index. |