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
/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
/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
/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

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"
/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"
/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"
/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
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-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"

Reading & Searching

/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"
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
/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

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
/ctx-share ctx_share
Export vault docs for sharing. Create shareable documentation bundles.
/ctx-share project
# Exports project vault as shareable archive

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

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)
/ctx-changelog ctx_changelog
View ContextVault changelog and version history. See what's new in each release.
/ctx-changelog
# 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
/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
/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

Quick Reference Table

Command Purpose Creates
/ctx-initInitialize vaultindex.md
/ctx-docLearning/Intel/SnippetP/G00X_topic.md
/ctx-errorBug fix docsP00X_error_*.md
/ctx-decisionArchitecture decisionsP00X_decision_*.md
/ctx-planTask planningP00X_plan_*.md
/ctx-bootstrapAuto-document projectMultiple docs
/ctx-handoffSession summaryP00X_handoff_*.md
/ctx-searchFind docs
/ctx-readView doc
/ctx-updateEdit doc
/ctx-archiveArchive doc
/ctx-reviewCuration review
/ctx-statusView stats
/ctx-modeChange mode
/ctx-helpShow help