Skip to main content

Commands Reference

Version: 0.5.10.5 | All commands use the /kmgraph: prefix in Claude Code. Other platforms access equivalent functionality through kg_* MCP tools — see INSTALL.md for details.

KMGraph session-summary demo — snapshot of captured lessons and open plans

Essential​

CommandDescriptionKey flags
/kmgraph:kmg-initInitialize a new knowledge graph with wizard-based setup; discovers locally running Ollama and LM Studio instances and offers to configure them for tier mapping—
/kmgraph:kmg-statusDisplay the resolved KG's health, file counts, and warnings--minimal, --json
/kmgraph:kmg-recallFull-text search across lessons, ADRs, KG entries, sessions, and the authoritative profile files (~/.kmgraph/rules.md, ~/.kmgraph/me.md, knowledge/rules.md, knowledge/me.md)--scope=all|active|personal-only, --user, --project, --named=<kg>, --format=detailed|paths
/kmgraph:kmg-capture-lessonGuided interview to document a problem solved, pattern discovered, or bug fixed--user, --project, --named=<kg>

Examples:

/kmgraph:kmg-init
/kmgraph:kmg-status
/kmgraph:kmg-recall "database timeout"
/kmgraph:kmg-recall "auth patterns" --scope=all
/kmgraph:kmg-capture-lesson

Capture & Document​

CommandDescriptionKey flags
/kmgraph:kmg-capture-lessonDocument lessons learned with git metadata, duplicate detection, and optional KG extraction--user, --project, --named=<kg>
/kmgraph:kmg-create-adrCreate Architecture Decision Records with auto-numbering, index update, and automatic capture of implementation commit + subject line--user, --project, --named=<kg>
/kmgraph:kmg-session-summarySummarize the active session; supports lightweight mid-session snapshot mode--auto, --snapshot, --snapshot --git, --user, --project, --named=<kg>
/kmgraph:kmg-extract-chatExport Claude and Gemini chat logs to dated markdown files; extract Codex CLI sessions with --source codex (outputs YYYY-MM-DD-codex.md; not included in --source all yet)--today, --date=YYYY-MM-DD, --after=, --before=, --project=, --source claude|gemini|codex|all, --output-dir=, --rebuild, --incremental, --claude-projects-dir=
/kmgraph:kmg-handoffGenerate a handoff package (thin START-HERE pointer, DOCUMENTATION-MAP, ARCHITECTURE-SNAPSHOT)--output-dir=
/kmgraph:kmg-rules-captureDetect and route a behavioral correction to rules.md or me.md (project or personal scope)—

Examples:

/kmgraph:kmg-create-adr "Use PostgreSQL for primary database"
/kmgraph:kmg-session-summary --snapshot
/kmgraph:kmg-extract-chat --today
/kmgraph:kmg-extract-chat -claude --after=2026-04-01
/kmgraph:kmg-handoff --output-dir=./backup/

Search & Recall​

CommandDescriptionKey flags
/kmgraph:kmg-recallSearch all project memory systems; automatically includes personal KG when registered--scope=all|active|personal-only, --user, --project, --named=<kg>, --format=detailed|paths
/kmgraph:kmg-statusHigh-level KG overview: file counts, last sync, MEMORY.md warnings--minimal, --json
/kmgraph:kmg-backfillIndex existing lessons/decisions/chat-history into the knowledge graph, drafting candidates for confirmation before writing[path], --date=<YYYY-MM-DD>, --after=<date>, --before=<date>, --delegate knowledge-extractor

Examples:

/kmgraph:kmg-recall "workflow patterns" --scope=personal-only
/kmgraph:kmg-recall "auth patterns" --user
/kmgraph:kmg-backfill
/kmgraph:kmg-backfill --after=2026-08-01 --before=2026-08-31

Session Management​

CommandDescriptionKey flags
/kmgraph:kmg-session-summaryCreate or append a session summary; snapshot mode skips the review gate--auto, --snapshot, --user, --project, --named=<kg>

Examples:

/kmgraph:kmg-session-summary --auto

Configuration​

CommandDescriptionKey flags
/kmgraph:kmg-initCreate a new KG with wizard; optionally backfills from existing project context; discovers locally running Ollama and LM Studio instances and offers to configure them for tier mapping—
/kmgraph:kmg-init-personal-kgCreate a personal KG at ~/.kmgraph/ for cross-project lessons—
/kmgraph:kmg-upgradeCheck for and apply pending upgrades (new directories, templates, config fields, backfix categories) without the full init wizard--named=<kg>, --preview
/kmgraph:kmg-add-categoryAdd a new category directory and KG entry file to an existing knowledge graph--prefix <p>, --git ignore|commit
/kmgraph:kmg-listList all configured knowledge graphs from ~/.kmgraph/kg-config.json--names-only, --json
/kmgraph:kmg-config-sanitizationInstall a pre-commit hook for sensitive-data detection with interactive pattern wizard—
/kmgraph:kmg-check-sensitiveScan the resolved KG's files for emails, API keys, and internal URLs before sharing--user
/kmgraph:kmg-update-docUpdate plugin or project documentation with standards validation and diff preview--user-facing
/kmgraph:kmg-setup-platformDetect installed AI tools and configure KMGraph integrations per platform—

Examples:

/kmgraph:kmg-init-personal-kg
/kmgraph:kmg-add-category security
/kmgraph:kmg-add-category ml-ops --prefix ml- --git ignore
/kmgraph:kmg-check-sensitive
/kmgraph:kmg-update-doc COMMAND-GUIDE.md --user-facing
/kmgraph:kmg-upgrade
/kmgraph:kmg-upgrade --named=knowledge-graph

Advanced​

CommandDescriptionKey flags
/kmgraph:kmg-start-issue-trackingStructured issue tracking: documentation templates, implementation plan, and Git branch—
/kmgraph:kmg-meta-issueTrack complex multi-attempt problems with attempt folders and root-cause evolution--add-attempt <N> "<desc>", --update-understanding "<text>", --status
/kmgraph:kmg-update-issue-planSync KG extraction with active plans and post a progress comment to GitHub Issues--auto, --pr=<N>
/kmgraph:kmg-link-issueManually link an existing lesson or ADR to a GitHub Issue with bidirectional references--issue <N>, --pr <N>
/kmgraph:kmg-handoffGenerate a handoff package before transitions, context resets, or onboarding--output-dir=

Examples:

/kmgraph:kmg-start-issue-tracking "CLI flag parsing fails on quoted args"
/kmgraph:kmg-meta-issue "Authentication Redesign"
/kmgraph:kmg-meta-issue --add-attempt 002 "OAuth2 with JWT"
/kmgraph:kmg-meta-issue --status
/kmgraph:kmg-update-issue-plan --pr=42
/kmgraph:kmg-link-issue knowledge/lessons-learned/process/my-lesson.md --issue 42

Advanced Flags​

These flags appear across multiple commands and share consistent behavior.

FlagCommandsBehavior
--autosession-summary, update-issue-planSkip confirmation prompts; silent/non-interactive mode. Safe for use when called from another command.
--dry-runinit, init-personal-kgPreview changes without writing any files. Useful for verifying scope before committing.
--snapshotsession-summaryLightweight mid-session capture. Appends to today's session file without a review gate. Used automatically by capture-lesson, create-adr, and start-issue-tracking when the user opts in.
--targetKgMCP tools (kg_capture, kg_search)Target a specific knowledge graph by name instead of the one resolved from the working directory.
--delegateAdvanced usageSignals that execution should be handed off to the agent layer rather than handled inline. Applies to thin-dispatcher commands that route to agents/.
--usersession-summary, create-adr, capture-lesson, recallRoute capture or search to the personal KG (~/.kmgraph/). Bypasses kg_capture; writes directly via the Write tool. Natural-language equivalent: "user level" / "for the user".
--projectsession-summary, create-adr, capture-lesson, recallRoute to the current project's KG, resolved from the working directory. Natural-language equivalent: "for this project" / "project level".
--named=<kg>session-summary, create-adr, capture-lesson, recall, upgradeRoute to a specific named KG from kg-config.json. Natural-language equivalent: naming the KG directly (e.g., "career-ops").