Kocoro: Instructions file for Claude Code

CLAUDE.md

Kocoro CLAUDE.md is an instructions file for Claude Code from Kocoro-lab/Kocoro. It costs 22,632 tokens per session, scanned B, original, MIT.

A project instruction file for Kocoro, a Go command-line runtime that runs Shannon AI agents locally while connecting to Shannon Cloud and messaging channels.

In plain words
What is it for?
It guides development of the background service, terminal interface, command-line commands, WebSocket connection, message routing, scheduler, browser automation, database, and tool-server support.
Why use it?
It documents the technology choices, production path, project layout, and coding conventions. This helps agents understand which components matter most and how they fit together before making changes.

Instructions file for Claude Code

Written for Claude Code: the file is CLAUDE.md. Also seen: mentions CLAUDE.md; mentions AGENTS.md.

This is Kocoro-lab/Kocoro's own configuration. It tells Claude Code how to work on Kocoro itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything Kocoro configures →

Reuse

Borrowing it

Nothing to install: this file belongs to Kocoro-lab/Kocoro. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/Kocoro-lab/Kocoro/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/Kocoro-lab/Kocoro

Made for: Claude Code.

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 Kocoro CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/kocoro-lab/kocoro/claude-md.svg)](https://agentmods.dev/instructions/kocoro-lab/kocoro/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/kocoro-lab/kocoro/claude-md"><img src="https://agentmods.dev/badge/instructions/kocoro-lab/kocoro/claude-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 22,632 This file is loaded in full into every session.
When invoked 22,632 The same file — it is already loaded in full.
Security scan B 2 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found 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.22632 $0.22632
Opus 5 $0.11316 $0.11316
Sonnet 5 $0.04526 $0.04526
Haiku 4.5 $0.02263 $0.02263

Measured 3d ago against content hash d05566d8b35d, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade B, and why

Kocoro CLAUDE.md scanned grade B with 2 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 3d 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.

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

- Skill secrets index: `~/.shannon/secrets-index.json` (chmod 600, flock-protected, names only); values in macOS Keychain (service `com.shannon.skill.<name>`)

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

`BashTool` implements `IsConcurrencySafeCall` via `internal/tools/bash_concurrency.go`. It is gated by `agent.bash_concurrency_enabled` (default `true` in Phase C — Desktop consumes the `tool_use_id_events` capability so
CLAUDE.md · 738 lines

How it starts

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

Kocoro — Project Guide

What This Is

Go CLI tool (shan) — the runtime for Shannon AI agents. Production stack is daemon + Kocoro Desktop + Shannon Cloud: the daemon connects to Cloud via WebSocket, receives channel messages (Slack, LINE, Feishu, Telegram, webhook), runs the agent loop locally with full tool access, and streams results back. Also supports interactive TUI, one-shot CLI, MCP server, and local scheduled tasks.

Tech Stack

  • Go 1.25.7go.mod is source of truth
  • Cobra — CLI (cmd/)
  • gorilla/websocket — daemon WS client (primary production path)
  • Bubbletea + Bubbles — TUI (internal/tui/)
  • adhocore/gronx — cron validation
  • modernc.org/sqlite — pure-Go SQLite, FTS5 session index
  • chromedp — browser automation (isolated profile)
  • mcp-go — MCP client/server
  • adrg/frontmatter — YAML frontmatter for SKILL.md

Project Structure

Use Glob/Grep — the layout is cmd/ (Cobra entry points) plus internal/<pkg>/. A file-by-file tree used to live here; it was only a projection of the code and is not maintained.

Primary production path is internal/daemon/ (HTTP API, WS client, routing, approvals/questions, scheduler) driving internal/agent/ (the loop, tool batching, compaction, deferred loading). Cross-package invariants that reading one file will NOT tell you are written down below under Key Conventions — notably Voice Front-Brain Authority (internal/koe), Provider Architecture (internal/executionprofile), and Cross-Platform Support (internal/keychain, internal/fslock).

Key Conventions

Doc Co-Maintenance

Feature changes update README.md (user-facing), CLAUDE.md (this file, developer-facing), and AGENTS.md (external-agent-facing: the rules and the greppable symbols, not a second copy of this file). AGENTS.md is capped at 24576 bytes (CI asserts — harnesses truncate it from the tail silently), and within 1 KiB of that ceiling any addition must cut at least as many bytes from AGENTS.md in the same PR (also CI-asserted).

Read the full file on GitHub · 738 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. 3d ago Changed · +82 lines · +1,418 tokens per session d05566d8b35d
  2. 8d ago First seen · 656 lines · 21,214 tokens per session scan B bf8b10871d09

Subscribe to this mod's changes

Kocoro CLAUDE.md is an instructions file published in the GitHub repository Kocoro-lab/Kocoro (407 stars, last pushed 2d ago), licensed MIT. It adds 22,632 tokens to every session, about $0.1132 per session on Opus 5. A static security scan graded it B with 2 findings (asks for root, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other instructions, from other repositories

codex AGENTS.md

AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.

openai/codex · 5,182 tokens

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 6,785 tokens

next.js AGENTS.md

AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,296 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,469 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).

microsoft/vscode · 5,001 tokens

spec-kit AGENTS.md

AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.

github/spec-kit · 7,104 tokens