Commands Reference
All 28 ContextVault slash commands with usage examples.
Quick Reference
Use these as /ctx-* slash commands in Claude Code, or as ctx_* MCP tools in Cursor, Windsurf, Cline, and other MCP-compatible AI tools. Commands that create documents auto-route to the correct vault (global or project).
How to Use Commands
ContextVault commands work three ways:
| Method | Format | Works In |
|---|---|---|
| Slash Commands | /ctx-doc, /ctx-error, etc. |
Claude Code (native installer) |
| MCP Tools | ctx_doc, ctx_error, etc. |
Cursor, Windsurf, Cline, Claude Code, any MCP tool |
| Natural Language | "document this bug fix", "create a handoff" | Any AI tool with MCP server |
Setup & Status
/ctx-init ctx_init
Initialize ContextVault in the current project. Creates the
.claude/vault/ directory with an index file.
/ctx-init
# Creates: ./.claude/vault/index.md
# Creates: ./.claude/vault/index.md
/ctx-status ctx_status
Show vault status and statistics. Displays document counts, current mode, and health overview.
/ctx-status
# Shows: Global docs: 5, Project docs: 12, Mode: full
# Shows: Global docs: 5, Project docs: 12, Mode: full
/ctx-health ctx_health
Check vault health and fix issues. Verifies index consistency, finds orphan docs, detects code-drift (broken file references), and repairs problems.
/ctx-health
# Scans both vaults, checks file references, reports issues
# Scans both vaults, checks file references, reports issues
/ctx-help ctx_help
Show all ContextVault commands and their descriptions. Quick reference for available commands.
/ctx-help
# Lists all 28 commands with brief descriptions
# Lists all 28 commands with brief descriptions
Documentation Commands
/ctx-doc ctx_doc
Document a learning, exploration finding, or code snippet. Supports type=learning|intel|snippet.
Native: /ctx-doc
Native: /ctx-doc type=snippet
MCP: ctx_doc topic="Auth" content="Uses JWT"
MCP: ctx_doc topic="Pattern" content="..." type="snippet"
Native: /ctx-doc type=snippet
MCP: ctx_doc topic="Auth" content="Uses JWT"
MCP: ctx_doc topic="Pattern" content="..." type="snippet"
/ctx-error ctx_error
Document a bug fix or error resolution. Captures error message, root cause, and solution.
Native: /ctx-error
MCP: ctx_error error_message="401 error" root_cause="Token expired" solution="Added refresh"
MCP: ctx_error error_message="401 error" root_cause="Token expired" solution="Added refresh"
/ctx-decision ctx_decision
Document an architectural or technical decision. Records options considered, reasoning, and trade-offs.
Native: /ctx-decision
MCP: ctx_decision decision="Use Redis" reasoning="Need persistence" tradeoffs="Slower"
MCP: ctx_decision decision="Use Redis" reasoning="Need persistence" tradeoffs="Slower"
/ctx-plan ctx_plan
Document implementation plan for multi-step tasks. Track goals, steps, and progress.
/ctx-plan
# Creates: P00X_plan_taskname.md
# Includes: Goals, Steps checklist, Progress tracking
# Creates: P00X_plan_taskname.md
# Includes: Goals, Steps checklist, Progress tracking
Consolidated Commands v1.8.7
The following commands have been consolidated into
/ctx-doc with a type parameter:
- Snippets: Use
/ctx-doc type=snippet(defaults to global vault) - Intel: Use
/ctx-doc type=intel - Notes: Use
/ctx-update section="Notes"
Auto-Documentation
/ctx-bootstrap ctx_bootstrap
Auto-scan codebase and generate comprehensive documentation. Creates architecture doc and feature docs for the entire project.
/ctx-bootstrap
/ctx-bootstrap --interactive # Ask before each doc
# Creates: P001_architecture.md + P00X_feature_*.md
/ctx-bootstrap --interactive # Ask before each doc
# Creates: P001_architecture.md + P00X_feature_*.md
/ctx-handoff ctx_handoff
Create session handoff summary for continuity. Summarizes what was done and what's next for the following session.
Native: /ctx-handoff
MCP: ctx_handoff completed="Auth done" next_steps="Add tests"
MCP: ctx_handoff completed="Auth done" next_steps="Add tests"
Reading & Searching
/ctx-search ctx_search
Search across vault documents. Find existing documentation by topic, keyword, or related terms.
Native: /ctx-search auth
MCP: ctx_search query="database migration"
MCP: ctx_search query="database migration"
/ctx-read ctx_read
Read a document by ID. View the full content of a vault document.
Native: /ctx-read P001
MCP: ctx_read id="P001"
MCP: ctx_read id="P001"
Q&A Removed in v1.8.7
Natural language Q&A has been simplified. Use
/ctx-search to find relevant docs, then /ctx-read to view them.
Editing & Updates
/ctx-update ctx_update
Update an existing document by ID. Modify content while preserving history.
/ctx-update P003
# Opens document for editing, appends to history
# Opens document for editing, appends to history
/ctx-new ctx_new
Create a new document with guided routing. Interactive prompts help choose the right vault and format.
/ctx-new
# Guides you through: Topic, Vault, Template selection
# Guides you through: Topic, Vault, Template selection
/ctx-link ctx_link
Link related documents together. Create bidirectional references between docs.
/ctx-link P003 P007
# Adds "Related: P007" to P003 and vice versa
# Adds "Related: P007" to P003 and vice versa
Import & Export
/ctx-import ctx_import
Import external documentation into vault. Bring existing markdown files into the vault system.
/ctx-import ./docs/api-guide.md
# Converts and adds to vault with proper ID
# Converts and adds to vault with proper ID
Configuration
/ctx-mode ctx_mode
Switch between local, global, or full mode. Also set enforcement level.
/ctx-mode local # Project vault only
/ctx-mode full # Both vaults
/ctx-mode global # Global vault only
/ctx-mode enforcement strict # Set enforcement
/ctx-mode full # Both vaults
/ctx-mode global # Global vault only
/ctx-mode enforcement strict # Set enforcement
Maintenance
/ctx-upgrade ctx_upgrade
Upgrade project-level ContextVault files. Updates
./CLAUDE.md and .claude/settings.json with latest instructions. For global upgrade, re-run the installer.
/ctx-upgrade
# Updates project instructions (not global installation)
# Updates project instructions (not global installation)
/ctx-changelog ctx_changelog
View ContextVault changelog and version history. See what's new in each release.
/ctx-changelog
# Displays version history with changes
# Displays version history with changes
/ctx-quiz ctx_quiz
Test knowledge retention from vault docs. Quiz yourself on documented learnings.
/ctx-quiz
# Generates questions from your vault docs
# Generates questions from your vault docs
/ctx-archive ctx_archive
Archive a vault document. Moves deprecated or outdated docs to the archive folder with a reason, keeping your vault lean while preserving history.
/ctx-archive P005 "Feature removed in v2.0"
# Moves P005 to archive/ with reason header
# Moves P005 to archive/ with reason header
/ctx-review ctx_review
Run weekly curation review on vault. Finds stale docs, suggests merges for related topics, identifies candidates for archiving.
/ctx-review
# Reports: stale docs, short docs, merge candidates
# Reports: stale docs, short docs, merge candidates
Quick Reference Table
| Command | Purpose | Creates |
|---|---|---|
/ctx-init | Initialize vault | index.md |
/ctx-doc | Learning/Intel/Snippet | P/G00X_topic.md |
/ctx-error | Bug fix docs | P00X_error_*.md |
/ctx-decision | Architecture decisions | P00X_decision_*.md |
/ctx-plan | Task planning | P00X_plan_*.md |
/ctx-bootstrap | Auto-document project | Multiple docs |
/ctx-handoff | Session summary | P00X_handoff_*.md |
/ctx-search | Find docs | — |
/ctx-read | View doc | — |
/ctx-update | Edit doc | — |
/ctx-archive | Archive doc | — |
/ctx-review | Curation review | — |
/ctx-status | View stats | — |
/ctx-mode | Change mode | — |
/ctx-help | Show help | — |