/ralph-knowledge:setup [directory1,directory2,...]from ralph-knowledge
Set up or rebuild the ralph-knowledge index from markdown documents. Use when setting up ralph-knowledge for the first time, reindexing after adding new documents, rebuilding a corrupted knowledge DB, or when knowledge_search returns empty results. Also use when the user mentions "index thoughts", "reindex", "set up knowledge", or "knowledge search not working".
Ships in ralph-knowledge. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Interactive setup and reindex skill for the ralph-knowledge plugin. Indexes markdown documents from one or more directories into a SQLite database with full-text search and semantic embeddings.
The ralph-knowledge MCP server must be running. If knowledge_search and knowledge_traverse tools aren't available, tell the user:
The ralph-knowledge MCP server isn't connected.
To install:
1. Add to .claude/settings.local.json:
"enabledPlugins": { "ralph-knowledge@ralph-hero": true }
2. Restart Claude Code
3. Run this skill again
If an argument was provided, use it as the thoughts directory path.
Otherwise, look for a thoughts/ directory in these locations (in order):
./thoughts/ (current project root)../thoughts/ (parent directory, for worktree setups)If found, confirm with the user:
Found thoughts directory: [path]
Contains [N] markdown files
Proceed with indexing?
If not found, ask the user for the path.
After confirming the thoughts directory, check if RALPH_KNOWLEDGE_DIRS is set in the environment. If it contains additional directories beyond the one found in Step 1, note them:
Also indexing from RALPH_KNOWLEDGE_DIRS: docs/plans, docs/adr
If RALPH_KNOWLEDGE_DIRS is NOT set, ask:
Would you like to index additional directories alongside thoughts/?
Common choices: docs/, docs/plans/, docs/adr/
Enter comma-separated paths (relative to project root), or press Enter to skip:
If the user provides additional directories, validate each exists. Combine all directories into a single list for Step 3.
If the user wants to persist this, suggest:
To persist, add to .claude/settings.local.json:
{
"env": {
"RALPH_KNOWLEDGE_DIRS": "thoughts,docs/plans"
}
}
The default DB path is ~/.ralph-hero/knowledge.db. The directory is auto-created if it doesn't exist.
If RALPH_KNOWLEDGE_DB is set in the environment, that overrides the default. Use it instead.
Pass the resolved DB path to the reindex script in Step 3.
The reindex script is bundled in the npm package. Install it to a temp location and run:
cd /tmp && npm install --no-save ralph-hero-knowledge-index@latest 2>&1 | tail -3
node /tmp/node_modules/ralph-hero-knowledge-index/dist/reindex.js [dir1] [dir2] ... [db-path]
Pass all directories as separate arguments, followed by the database path (ending in .db).
Display the output as it runs. The script will:
.md files recursively (skipping dot-directories)## Prior Work relationships (builds_on, tensions, superseded_by)The first run downloads the embedding model (~80MB) which takes a minute. Subsequent runs are faster.
This step is OPTIONAL — if the user only wanted to reindex, they can stop after Step 3. If they want the full dream-loop wiring (memory config, launchd nightly schedule, smoke ingest), continue here.
Ask the user:
Reindex complete. Would you also like to run the dream-loop bootstrap?
This writes ~/.ralph/knowledge.config.json, renders + loads the launchd
nightly plist, probes Gemma, and runs a smoke ingest.
(yes/no, default yes)
If yes (or no answer), invoke the bootstrap script. It is the single source of truth for setup logic — when something changes about dream-loop wiring, edit bootstrap.sh, not this skill:
bash "$CLAUDE_PLUGIN_ROOT/../../scripts/dream/bootstrap.sh"
(If $CLAUDE_PLUGIN_ROOT resolution to the repo root is unclear, fall back to discovering the repo: git -C $(pwd) rev-parse --show-toplevel then bash <repo-root>/scripts/dream/bootstrap.sh.)
The bootstrap script is idempotent:
OK <step> or SKIP <step> (already configured)gemma-up hint to stderr but continues)Display the bootstrap output as it runs. The script prints a tier-count summary and a next-steps banner on completion.
After indexing completes, verify the tools work by running a test search:
knowledge_search(query="recent research", limit=3)
Display the results. If results come back, setup is complete. If results are empty or an error occurs:
~/.ralph-hero/knowledge.db — if overriding, ensure RALPH_KNOWLEDGE_DB matches the path passed to reindex./reload-plugins or restart Claude Code./reload-plugins or restart Claude Code.Print a final summary that includes the tier-count rollup from the bootstrap step (if it was run):
Knowledge Index Ready
=====================
Documents indexed: [N]
Database: [db-path]
Directories indexed:
- thoughts/
- docs/plans/
Tier counts (from `sqlite3 [db] "SELECT memory_tier, COUNT(*) FROM documents GROUP BY memory_tier"`):
doc=[N]
raw=[N]
reflection=[N]
wiki=[N]
Tools available:
- knowledge_search: Keyword + semantic search across documents
- knowledge_recall: Role-aware retrieval (researcher/planner/implementer/...)
- knowledge_traverse: Walk relationship edges between documents
To reindex after adding new documents:
/ralph-knowledge:setup
To re-run dream-loop bootstrap (idempotent):
bash scripts/dream/bootstrap.sh
Then suggest:
Want to browse your knowledge documents in Obsidian?
Run /ralph-knowledge:setup-obsidian to set up navigational indexes and vault config.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
5 skills in this plugin
/captureCapture — In-Flow Memory CaptureCapture an insight, decision, or session learning as a raw memory in ralph-knowledge — the in-flow "remember this" surface. Distills what just happened (an exchange, a debugging breakthrough, a whole session) into 1-3 atomic raw memories via the knowledge_remember MCP tool, so the nightly dream-loop reflection pass can synthesize them. Use when the user says "remember this", "capture this", "save this insight", "make a memory of this", "don't let me forget", "TIL", "turn this session into memories", or wants to bank a learning without leaving flow. Not for curated knowledge — wiki promotion is the human-gated /ralph-knowledge:curate surface./curateCurate the personal wiki tierCurate the personal wiki tier — the third memory tier above raw and reflection. Iterates through atomic axiom candidates one at a time, fact-checks each against the corpus, external sources, and code, applies governance gates (outside-code-surface, atomicity, lede-writability, MUSTIE, domain freshness), and presents fully-evidenced candidates for the user to gate y/n/edit. Use whenever the user mentions "curate the wiki", "promote to wiki", "find canonical entries", "add to my wiki", "wiki tier", "wiki axioms", or wants to grow their thoughts/wiki/ directory. Also trigger when the user wants to distill recurring patterns from their thoughts/ corpus into canonical entries, synthesize reflections into wiki-grade material, or when they ask to "find atomic axioms" in their notes. The wiki resists growth — the gate is biased toward rejection./dream-loopDream-Loop — Memory Consolidation (memorykeepers)Run, bootstrap, or verify the dream-loop — the nightly memory-consolidation pipeline that ingests the last window of raw activity (Gemma lab logs, git history, llm-cli transcripts, Claude Code sessions) as memory_tier=raw documents, then clusters them and synthesizes one memory_tier=reflection per cluster. This is the memorykeepers surface that orchestrates the existing scripts/dream/ infra (ingest.py + reflect.py + logrotate.sh). Use when the user mentions "dream", "dream-loop", "dream-now", "consolidate memories", "run reflection", "memorykeepers", "ingest raw memories", or wants to manually trigger the memory tiers (raw to reflection) without waiting for the 03:00 launchd fire. Also use for machine wiring and health checks — "bootstrap the dream loop", "set up dream-loop", "install the nightly schedule", "check dream-loop status", "verify the dream loop ran", "did the dream loop ingest anything" — via --mode bootstrap and --mode verify./setup-obsidianRalph Knowledge — Obsidian SetupSet up Obsidian as the browsing UI for ralph-knowledge documents. Provisions .obsidian/ config, updates .gitignore, and runs reindex with index note generation. Use when users want to browse thoughts/ in Obsidian, set up Obsidian integration, or ask about viewing knowledge documents.npx claudepluginhub cdubiel08/ralph-hero --plugin ralph-knowledge