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.
npx agentmods add instructions/kocoro-lab/kocoro/agents-mdgit clone --depth 1 https://github.com/Kocoro-lab/KocoroWrote 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.
[](https://agentmods.dev/instructions/kocoro-lab/kocoro/agents-md)<a href="https://agentmods.dev/instructions/kocoro-lab/kocoro/agents-md"><img src="https://agentmods.dev/badge/instructions/kocoro-lab/kocoro/agents-md.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.06007 | $0.06007 |
| Opus 5 | $0.03003 | $0.03003 |
| Sonnet 5 | $0.01201 | $0.01201 |
| Haiku 4.5 | $0.00601 | $0.00601 |
Grade A, and why
Kocoro AGENTS.md 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 yesterday.
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.
How it starts
The opening of the file, as written. The whole thing — 412 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Kocoro Project Guide (AGENTS.md)
Condensed mirror of CLAUDE.md — rules + greppable symbols. If they
disagree, CLAUDE.md and the code win.
Keep this file under 24 KB (CI asserts) — cut prose, not rules. Within 1 KB of the ceiling, adding bytes requires cutting at least as many from this file (CI asserts).
Kocoro is the Go CLI/runtime (shan) for Shannon agents. Production: daemon +
Desktop + Cloud. Also TUI, one-shot CLI, MCP, schedules.
Layout: cmd/ (Cobra) + internal/<pkg>/; daemon/ drives agent/.
Working Rules
go.modis the source of truth for the Go version.- Prefer existing repo patterns over new abstractions; keep changes tied to the task.
- Verify API response bodies, not just status codes.
- No parallel
_enhancedvariants — update existing code in place. - Risky behavior changes keep operator-visible flags, rollback paths, focused tests.
- Test locally before pushing dependency or generated-code changes.
- New
const max[A-Z]\w+ = <small_int>: the comment MUST name (1) the workload, (2) the symptom when it binds, (3) the override path. Preferviper.SetDefault(...)for liftable caps. Re-check small-int caps on model-family upgrades — 200K-era defaults bind silently at 1M.
Doc Co-Maintenance
Feature changes update README.md, CLAUDE.md, and this file.
The bundled kocoro skill is the AI-facing source of truth for the daemon HTTP
API. Every mux.HandleFunc(...) in daemon/server.go the agent calls
needs a matching skills/bundled/skills/kocoro/references/*.md entry in
the SAME PR. Desktop-only transport endpoints stay out; their contract lives in
docs/desktop-wire-fixtures/.
Tools
- Required fields: every
Run()MUST check eachToolInfo.Requiredfield is non-zero right afterjson.Unmarshaland returnagent.ValidationError(...), NOT a bareToolResult{IsError: true}(Go can't tell missing from zero). The[validation error]prefix is load-bearing:LoopDetector.isValidationErrorSigforce-stops on 3 consecutive. - Priority: local > MCP > gateway, deduped by name. MCP-vs-MCP collisions
resolve to the alphabetically-first server (
RebuildRegistryForHealth); the shadowed tool is logged, never registered. - Exposure (
agent/exposure.go EffectiveToolExposure): explicitToolExposurefirst, then source default — local Direct; MCP/gateway/ integration Deferred.ask_user_questionis explicitly Direct.web_search/web_fetch/x_searchare Direct only whenToolSource()==SourceGateway(tools/exposure.go ServerTool.ToolExposure); a same-named MCP or integration tool keeps its Deferred default so a third-party catalog cannot widen the base schema surface. GUI/process automation and calendar/schedule mutations are Deferred; calendar/schedule reads stay Direct. tool_searchuses deterministic BM25 (agent/toolsearch_index.go,toolSearchDefaultLimit8) with exactselect:lookup. The 16K Direct-schema budget is a regression diagnostic and MUST NEVER reclassify tools at runtime.- Skill
allowed-toolsis execution-time denial, NOT schema filtering — the tools array stays byte-stable for the prompt cache.agent.SkillExempt(think,tool_search,use_skill) is for pure infrastructure only; do NOT exempt side-effecting tools. - Concurrency: the dispatcher batches by
IsConcurrencySafeCall, notIsReadOnlyCall; tools without aConcurrencySafeCheckerfall back to theirIsReadOnlyCallvalue.BashToolimplements it intools/bash_concurrency.go, gated byagent.bash_concurrency_enabled(default true): only a strict read-only leading token AND no shell metacharacters (incl.\n/\r) is eligible; everything else stays in a size-1 serial batch. tool_statusrunning/completed carrytool_use_id(capabilitytool_use_id_events).set_work_plan(daemon/work_plan.go): full-snapshot 2–8-step checklist, daemon non-ephemeral runs only. Runtime owns plan_id/revision/lifecycle/close_reason; closure comes fromLastRunStatus, never a model claim, and bumps the revision.work_plan.updatedfires only after the covering save. Not dup-exempt;SkillExempt; never journaled. Capabilitywork_plan_v1.- Every
RequiresApproval()==truetool needs adescription(5-15 words, model-written). The daemon does NOT block on a missing one; UI clients MUST usedescription?.trim() || fallback, NOT nullish coalescing. - Integration
requires_approval=true→ normal approval flow (daemon.auto_approvebypasses); Always Allow persistence refused —DisallowsAlwaysAllowPersistencegates flag/broker/persist/runtime; stalealways_allow_toolsentries ignored. Config writes (incl. agent-sync pull) drop denied entries (dropRegistryDeniedAlwaysAllow, registry miss keeps);RefreshIntegrationTools+resetIntegrationToolsForPrincipalprune after rebuild (pruneDeniedAlwaysAllowGrants). Drop skips the LWW stamp; both prunes push on write. Absent=false; Cloud gates marked schemas onintegration_requires_approval. - Trusted
material_side_effect=falsepermits observational batching without the journal; absent is fail-closed. Stablerequest_id; material calls addIdempotency-Key. Onlyprovider_unavailable/provider_rejectedare known-no-effect. Preserve provider/model/unit/cost viaToolResult/EmitUsage. Exhaustedcall_in_progress→outcome_unknown: never resend under a new ID. - Outcome-unknown material results narrate as ordinary tool errors; the
same-turn latch (
agent/unknown_outcome_gate.go) blocks byte-identical tool+args repeats until the next user message. - SourceIntegration is identity-scoped. Key mutation invalidates generations
before source clear, without the dispatch writer. Failed new-identity listing
leaves it empty; same-identity refresh failure keeps it. ServerTool binds list
credential/principal generation; stale clones fail pre-dispatch, caches can't
revive them. Auth/integration/MCP-health/reload swaps share one lock. Auth
rebuilds both overlays: credential-bound cloud/publish/image drop,
calendar/non-auth tools survive.
cloud_delegate, publish/list/retract, and generate/edit lease generation through allRunretries. Serialize auth across accounts/keys. - X publishing only via Cloud X tools (
x_prepare_postremoved).browser/computer_use/builtin Playwright block X composer/publish controls; Playwright omitsbrowser_run_code/browser_evaluate; CDP: any X target blocks mutation; non-CDP: no claim; shell/custom MCP unguarded.
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.
- yesterday Changed · +1 lines · -12 tokens per session 1a734767dbc0
- 5d ago First seen · 411 lines · 6,019 tokens per session scan A 88b7ed3e068c
Kocoro AGENTS.md is an instructions file published in the GitHub repository Kocoro-lab/Kocoro (406 stars, last pushed 2d ago), licensed MIT. It adds 6,007 tokens to every session, about $0.0300 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other instructions, from other repositories
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).
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.
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.
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).
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.
deepseek-harness AGENTS.md
AGENTS.md instructions for deepseek-ai/deepseek-harness, covering agents.md, pre-stable apis and released session data, repository layout, commands and host sandbox failures.