km
The km command toggles between Dev Work Mode and Knowledge Work Mode by creating or updating a configuration file that activates research-focused personas such as ux-researcher and strategy-analyst. Use this command when switching from coding tasks to analytical work like user research, strategy analysis, or literature reviews.
mkdir -p ~/.claude/commands && curl -fsSL https://raw.githubusercontent.com/nyldn/claude-octopus/HEAD/.claude/commands/km.md -o ~/.claude/commands/km.mdkm.md
# Knowledge Mode Toggle Toggle between **Dev Work Mode** and **Knowledge Work Mode**. ## Implementation Instructions When this command is executed: 1. **Parse the argument:** - No argument or "on" → target mode = Knowledge Work (`knowledge_mode: true`) - "off" → target mode = Dev Work (`knowledge_mode: false`) 2. **Check current mode** via `.claude/claude-octopus.local.md`: - Target is Dev Work AND file does NOT exist → user is already in Dev Work Mode (default). **Do not create the file.** Show confirmation only, then exit. - File exists AND current `knowledge_mode` already equals the target → **Do not rewrite the file.** Show confirmation only, then exit. - Otherwise → proceed to step 3 (real transition needed). 3. **Switch modes** (only when a real transition is required): - Before writing, state one sentence: "Switching to Knowledge Work — creating `.claude/claude-octopus.local.md` (`knowledge_mode: true`)." (or the equivalent for Dev Work). - If the file does not exist, create it with minimal frontmatter containing only the fields being set. - If the file exists, update only the `knowledge_mode` field; preserve any other keys. - Confirm with the target mode's emoji (🎓 / 🔧) and active personas. **Rule (v9.30+):** Never create or rewrite `.claude/claude-octopus.local.md` when the user is already in the target mode. The v9.29 behavior over-executed — it wrote config for a state the user was already in, without explanation. Skip the Write tool entirely when there's nothing to change. See `agents/principles/write-intent.md` for the general principle. ## Usage ```bash /octo:km # Switch to Knowledge Work mode (default action) /octo:km on # Switch to Knowledge Work mode (explicit) /octo:km off # Switch to Dev Work mode (same as /octo:dev) ``` ## Two Work Modes **Dev Work Mode** 🔧 (default) - Best for: Building features, debugging code, implementing APIs - Personas: backend-architect, code-reviewer, debugger, test-automator **Knowledge Work Mode** 🎓 - Best for: User research, strategy analysis, literature reviews - Personas: ux-researcher, strategy-analyst, research-synthesizer Both modes use the same AI providers (Codex + Gemini), just optimized with different personas. ## Quick Switch - `/octo:dev` - Switch to Dev Work mode 🔧 - `/octo:km` - Switch to Knowledge Work mode 🎓 Your mode choice persists across sessions.
Backend architect for scalable API design, microservices, and distributed systems
Cloud architect for AWS/Azure/GCP infrastructure, IaC, FinOps, and multi-cloud strategies
Code review expert for quality analysis, security vulnerabilities, and production reliability
Database architect for data modeling, technology selection, schema design, and migration planning
Debugging specialist for errors, test failures, and unexpected behavior
Technical documentation architect for comprehensive system docs and architecture guides
Frontend developer for React, Next.js, responsive layouts, and accessible UI components
Performance engineer for optimization, observability, and scalable system performance