/secondbrain:secondbrain-search-initfrom secondbrain
Initializes semantic search for a secondbrain project using qmd. Sets up configuration, builds index, and optionally registers hooks for automatic updates.
Ships in secondbrain. 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.
Read when SKILL.md points to them.
Set up qmd semantic search for an existing secondbrain project.
.claude/data/config.yamlwhich qmd# Check secondbrain exists
ls .claude/data/config.yaml
# Check qmd installation
which qmd
If secondbrain not found:
No secondbrain project found in current directory.
Run `/secondbrain-init` to create a new project first.
If qmd not installed:
## qmd Not Installed
qmd is required for semantic search. Install it:
### Using Bun (Recommended)
bun install -g qmd
### Using npm
npm install -g qmd
After installation, run this skill again.
**Note:** First run will download ~1.5GB of embedding models.
ls .claude/search/ 2>/dev/null
If search already initialized:
## Search Already Initialized
Search is already configured for this project.
**Index location:** .claude/search/
**Last indexed:** 2026-01-15 10:30
### Options
1. **Rebuild index** — Re-index all documents
`/secondbrain-search-init --rebuild`
2. **Search now** — Start searching
`/secondbrain-search "your query"`
3. **Check status** — View index statistics
`qmd status`
Create .claude/search/ directory and qmd config:
mkdir -p .claude/search
Generate qmd.config.json in project root:
{
"name": "{{project_name}}-secondbrain",
"paths": ["docs"],
"ignore": [
"**/node_modules/**",
"**/.vitepress/cache/**",
"**/.vitepress/dist/**",
"**/TEMPLATE.md"
],
"indexDir": ".claude/search",
"chunk": {
"size": 800,
"overlap": 0.15
},
"metadata": {
"extractFrontmatter": true,
"includeFileMetadata": true
}
}
Add search index to .gitignore (index should not be committed):
# Semantic search index (regenerate with /secondbrain-search-init)
.claude/search/
qmd.config.json
Run initial indexing:
qmd index
Show progress:
## Building Search Index
Scanning docs/...
Found 47 documents
Indexing:
[████████████████████░░░░░░░░░░] 35/47 documents
Downloading models (first run only):
- embedding-gemma-300M... done
- qwen3-reranker... done
Building embeddings:
[██████████████████████████████] 47/47 documents
Index built successfully!
- Documents: 47
- Chunks: 312
- Index size: 2.4 MB
- Location: .claude/search/
Ask user if they want automatic index updates:
## Automatic Index Updates
Would you like to automatically update the search index
when documents are modified?
[x] Yes, add PostToolUse hook (Recommended)
- Updates index incrementally on file changes
- Adds ~0.5s to Write/Edit operations
[ ] No, I'll rebuild manually
- Run `qmd index` or `/secondbrain-search-init --rebuild`
If yes, add hook to .claude/settings.local.json:
{
"hooks": {
"PostToolUse": [
{
"matcher": "Write|Edit",
"hooks": [
{
"type": "command",
"command": "python3 \"${CLAUDE_PROJECT_DIR}/.claude/hooks/search-index-update.py\"",
"timeout": 30000
}
]
}
]
}
}
Copy hook script:
cp "${CLAUDE_PLUGIN_ROOT}/hooks/search-index-update.py" .claude/hooks/
## Search Initialized Successfully!
**Project:** my-knowledge-base
**Documents indexed:** 47
**Index location:** .claude/search/
### Quick Start
Search your knowledge base:
/secondbrain-search "kubernetes deployment strategies"
Search with filters:
/secondbrain-search --entity=adrs "database"
/secondbrain-search --recent=30d "authentication"
### Index Management
Rebuild index:
qmd index --rebuild
Check status:
qmd status
View recent searches:
qmd history
### Automatic Updates
Index updates: Enabled (PostToolUse hook)
Documents in docs/ will be re-indexed on save.
Force rebuild of entire index:
qmd index --rebuild
Skip adding the automatic update hook:
/secondbrain-search-init --no-hook
If model download hangs:
# Clear cache and retry
rm -rf ~/.cache/qmd/models/
qmd index
If search returns errors:
# Remove and rebuild
rm -rf .claude/search/
qmd index
For large document sets (>500 docs):
--batch-size=50 for progress visibilityWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
secondbrain, semantic-search, qmd, search-index, project-setup
11 skills in this plugin
/secondbrain-adrThis skill should be used when the user asks to "create ADR", "document decision",
"architecture decision", "add decision record", or mentions needing to record a
technical decision with status tracking and category organization.
/secondbrain-discussionThis skill should be used when the user asks to "document discussion", "save meeting notes",
"record conversation", "capture meeting", or mentions needing to document team discussions
with participants, decisions, and action items.
/secondbrain-entityThis skill should be used when the user asks to "add entity", "create custom entity",
"new entity type", "define entity", or mentions wanting to add a new trackable data type
to their secondbrain project beyond the predefined ADR, Note, Task, and Discussion types.
/secondbrain-freshnessThis skill should be used when the user asks for "freshness check", "freshness report",
"what needs attention", "stale items", "review backlog", or mentions wanting to see
what secondbrain content needs review or updating.
/secondbrain-initThis skill should be used when the user asks to "create a secondbrain", "scaffold knowledge base",
"init documentation portal", "set up second brain", "create TDA project", or mentions wanting to
build a personal knowledge management system with VitePress and microdatabases.
/secondbrain-noteThis skill should be used when the user asks to "create note", "capture thought",
"save this", "document idea", "write note", "jot down", "quick note", "remember this",
"capture this", or mentions wanting to save knowledge, ideas, or learnings for later
reference in their secondbrain.
npx claudepluginhub sergio-bershadsky/ai --plugin secondbrainOther plugins' skills for the same job