km

km is a command for Claude Code from nyldn/claude-octopus. It costs 14 tokens per session (684 once invoked), scanned A, a copy of octo-km, MIT.

A command that switches between Dev Work Mode and Knowledge Work Mode by updating a project setting. The setting is stored in a local Claude configuration file.

In plain words
What is it for?
Use it to turn Knowledge Work Mode on or off and confirm the current working mode.
Why use it?
It avoids manually editing the mode setting and preserves other configuration values during a switch.

Command for Claude Code

Written for Claude Code: disable-model-invocation in frontmatter.

Part of the octo plugin — 70 skills, 108 commands, 10 agents, 18 hooks shipped together

Good fit Use it to turn Knowledge Work Mode on or off and confirm the current working mode.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/nyldn/claude-octopus/km
About the project

Claude Octopus is an orchestration project that sends research, design, and coding tasks to Claude Code and other AI model providers so their results can be compared. Developers use it for multi-model work, disagreement detection, reviews, persistent context, and an optional workflow that moves from discovery through delivery. The catalogue entries are its commands, skills, agents, instructions, hooks, plugins, and settings.

nyldn/claude-octopus · 4,339 stars · on GitHub · reddit.com

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/nyldn/claude-octopus

Made for: Claude Code.

Or install octo, the plugin that ships this one along with the rest of its 70 skills, 108 commands, 10 agents, 18 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for km

README.md
[![agentmods](https://agentmods.dev/badge/commands/nyldn/claude-octopus/km/github.svg)](https://agentmods.dev/commands/nyldn/claude-octopus/km)
Your own site
<a href="https://agentmods.dev/commands/nyldn/claude-octopus/km"><img src="https://agentmods.dev/badge/commands/nyldn/claude-octopus/km/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for km

Your own site · 80×15
<a href="https://agentmods.dev/commands/nyldn/claude-octopus/km"><img src="https://agentmods.dev/badge/commands/nyldn/claude-octopus/km.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 14 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 684 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin 91% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00014 $0.00684
Opus 5.5 $0.00006 $0.00274
Sonnet 5.5 $0.00003 $0.00137
Haiku 4.5 $0.00001 $0.00068

Measured 1mo ago against content hash 41171c7201b9, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

km scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

This is a copy

91% identical to octo-km — 8 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

commands/km.md · 63 lines

How it starts

The opening of the file, as written. The whole thing — 63 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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

/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

Read the full file on GitHub · 63 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 63 lines · 14 tokens per session scan A 41171c7201b9

Subscribe to this mod's changes

km is a command published in the GitHub repository nyldn/claude-octopus (4,339 stars, last pushed today), licensed MIT. It adds 14 tokens to every session and 684 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. It is 91% identical to octo-km, differing in 8 lines, and is treated as a copy.