Help us improve
Share bugs, ideas, or general feedback.
Share bugs, ideas, or general feedback.
Share bugs, ideas, or general feedback.
By qiuyanxin
Capture one-line insights or conversation knowledge into a typed, tagged sp-context base with auto-inferred titles and related doc searches; sync high-value claude-mem observations like decisions and bugs; run sp doctor for automated health checks fixing tags, links, metadata, staleness, indexing, and git commits to maintain a clean company knowledge repository.
npx claudepluginhub qiuyanxin/sp-contextAuto-sync high-value knowledge from claude-mem to sp-context. Uses claude-mem MCP tools to find unsynced decisions/discoveries and batch import. Triggers: /sp-context:sp-harvest, '同步知识', 'sync from claude-mem', 'harvest knowledge'
Run knowledge base health check and auto-fix actionable issues. Triggers: /sp-context:sp-health, 'check knowledge base', '知识库健康检查', 'sp doctor fix'
Low-friction knowledge capture. AI auto-infers type/tags from content and pushes to sp-context. Triggers: /sp-context:sp-quick, '记住这个', '沉淀一下', 'save this to knowledge base', 'TIL'
Check sp-context dependencies (claude-mem, git, bun) and guide installation. Use when sp-context features are degraded or user wants to set up knowledge sync. Triggers: /sp-context:sp-setup, 'sp setup', 'install claude-mem', 'knowledge sync setup'
Auto-sync high-value knowledge from claude-mem to sp-context. Finds unsynced decisions/discoveries and batch imports them.
Run knowledge base health check and auto-fix actionable issues. Runs sp doctor, fixes tags, broken links, missing metadata automatically.
Low-friction one-line knowledge capture. Auto-infers type/tags and pushes to sp-context knowledge base.
Check sp-context dependencies (claude-mem, git, bun) and guide installation. Use when session-start reports missing dependencies or user wants to set up knowledge sync.
Share bugs, ideas, or general feedback.
Own this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge.
Sign in to claimOwn this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge.
Sign in to claimBased on adoption, maintenance, documentation, and repository signals. Not a security audit or endorsement.
AI-powered knowledge base management - Capture conversation learnings, maintain topic-specific KB files, Obsidian-compatible knowledge graph, structured dynamic context loading, and institutional knowledge in CLAUDE.md
Knowledge base skills for Claude Code — capture, search, and synthesize project knowledge
Persistent knowledge workspace for Claude Code — structured files, versioning, search, and knowledge graph across sessions
Extended Second Brain that learns as you work in Claude Code
Persistent memory across Claude Code sessions using Cognis
Governed team memory — deterministic policy, lifecycle, team sharing via qmd
Your AI agent starts every session knowing nothing about your team. This fixes that.
sp-context is a CLI that gives any AI coding agent (Claude Code, Codex, Cursor, etc.) persistent access to your team's knowledge — decisions, architecture, playbooks, lessons learned — through a simple Git repo.
No vector database. No embeddings. No RAG pipeline. Just Git + BM25 + about 100 tokens per session for the catalog overview.

Ask your agent anything → it searches your knowledge base → returns the answer with sources.
| Approach | sp-context |
|---|---|
| Vector DB + embeddings | Git repo + BM25 search |
| MCP server (schema overhead) | CLI (zero schema, any agent) |
| Hosted service (vendor lock-in) | Local-first, your own Git repo |
| Complex infra to maintain | bun install and done |
| Costs money at scale | Free forever |
Progressive loading: On session start, a hook injects a short directory overview (on the order of ~100 tokens). Your agent knows what knowledge exists without loading it all. It pulls full docs on demand via sp get.
# 1. Install
git clone https://github.com/qiuyanxin/sp-context.git ~/sp-context-plugin
cd ~/sp-context-plugin && bun install
# 2. Initialize your knowledge repo
sp init ~/my-team-context
# Creates a Git repo with starter templates: company mission, tech stack, glossary
# 3. Put `sp` on your PATH (pick one)
cd ~/sp-context-plugin && bun link # recommended: global `sp` command
# or: echo 'alias sp="bun run ~/sp-context-plugin/src/cli.ts"' >> ~/.zshrc && source ~/.zshrc
# 4. Verify
sp --version
sp search "architecture"
Add to ~/.claude/settings.json:
{
"hooks": {
"SessionStart": [{
"matcher": "",
"hooks": [{
"type": "command",
"command": "$HOME/sp-context-plugin/hooks/session-start.sh",
"timeout": 5000
}]
}]
}
}
Now every Claude Code session starts with your team's context automatically loaded.
# ── Read ──
sp search <query> # BM25 + CJK search
sp search <query> --type <t> --tags a,b # Filter by type / tags
sp search <query> --limit 20 --mode or # Max hits; OR = any term matches
sp search <query> --snippet # Keyword context snippets
sp get <path> # Read full document
sp list <category> [--project <name>] # Browse: context, decisions, …, clients, people
# ── Write ──
sp push --title <t> --type <type> --content <text> # Add knowledge (auto-dedup)
sp push --title <t> --type <type> --file <path> # Body from file (or stdin)
sp push --title <t> --type status --ttl 30d # TTL → expiry in frontmatter
sp push --title <t> --type personal --category notes # people/ sub-folder (research, drafts, notes)
# ── Claude-mem ──
sp import --query "auth" --limit 20 # Search observations → import
sp import --ids 101,102 # Import by observation IDs
# ── Governance ──
sp doctor # Quality check (duplicates, stale, broken links)
sp schema # Introspect types, tags, stats
sp gc [--yes|-y] # Archive expired docs
# ── File ops ──
sp add <file|dir> [--to <path>] [--yes] # Add local files to knowledge repo
sp delete <path> # Delete document (alias: sp rm)
sp move <path> --to <dir> # Move document (alias: sp mv)
# ── Sync ──
sp sync # Pull + rebuild index
sp config list|add|switch # Manage multiple repos
Session start → Tier 0: hook injects directory overview (~100 tokens)
On-demand → Tier 1: sp search returns summaries (~95 tokens/hit)
Deep read → Tier 2: sp get loads full document
| Type | Directory | What goes here |
|---|---|---|
reference | context/ | Company info, product specs, competitors |
decision | decisions/ | Architecture, product, business decisions |
learning | experience/ | Lessons learned, best practices |
meeting | meetings/ | Meeting notes |
status | plans/ | Plans, progress, weekly updates |
playbook | playbook/ | SOPs, workflows |
personal | people/ | Personal workspace (optional --category for sub-folders) |