km

km is a command for coding agents 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

Part of the octo plugin — 69 skills, 106 commands, 10 agents, 20 hooks shipped together

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,045 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.

agentmods
npx agentmods add commands/nyldn/claude-octopus/km
Clone the repo
git clone --depth 1 https://github.com/nyldn/claude-octopus

Or install octo, the plugin that ships this one along with the rest of its 69 skills, 106 commands, 10 agents, 20 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.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.svg" alt="Measured on agentmods" 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. Scan, not verified.
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 $0.00007 $0.00342
Sonnet 5 $0.00003 $0.00137
Haiku 4.5 $0.00001 $0.00068

Measured today against content hash 41171c7201b9, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, 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 today.

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. today 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,045 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. 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.