Kontrol: Instructions file for Codex

AGENTS.md

Kontrol AGENTS.md is an instructions file for Codex, OpenCode from B-A-M-N/Kontrol. It costs 13,363 tokens per session, scanned A, original, MIT.

Project instructions for Kontrol, a system that lets AI assistants work with approved local development folders through MCP, a standard way for tools to connect to AI assistants.

In plain words
What is it for?
They are for AI-assisted development in Kontrol workspaces, including direct project work and bounded tasks assigned to a local coding agent.
Why use it?
They explain how to open a project workspace and use file, code-search, editing, and shell tools safely and consistently.

Instructions file for CodexOpenCode

Written for Codex and OpenCode: the file is AGENTS.md. Also seen: mentions AGENTS.md; mentions Codex.

This is B-A-M-N/Kontrol's own configuration. It tells Codex and OpenCode how to work on Kontrol 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 Kontrol configures →

Reuse

Borrowing it

Nothing to install: this file belongs to B-A-M-N/Kontrol. 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/B-A-M-N/Kontrol/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/B-A-M-N/Kontrol

Made for: Codex, OpenCode.

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 Kontrol AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/b-a-m-n/kontrol/agents-md/github.svg)](https://agentmods.dev/instructions/b-a-m-n/kontrol/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/b-a-m-n/kontrol/agents-md"><img src="https://agentmods.dev/badge/instructions/b-a-m-n/kontrol/agents-md/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 Kontrol AGENTS.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/b-a-m-n/kontrol/agents-md"><img src="https://agentmods.dev/badge/instructions/b-a-m-n/kontrol/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 13,363 This file is loaded in full into every session.
When invoked 13,363 The same file — it is already loaded in full.
Security scan A 1 finding. 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.13363 $0.13363
Opus 5.5 $0.05345 $0.05345
Sonnet 5.5 $0.02673 $0.02673
Haiku 4.5 $0.01336 $0.01336

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

Security

Grade A, and why

Kontrol AGENTS.md scanned grade A with 1 finding 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.

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

is not a spawn unless it reaches the `node:child_process` API.
AGENTS.md · 877 lines

How it starts

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

Kontrol

This project exposes local development workspaces over MCP so ChatGPT, Claude, or another MCP-capable host can operate on this machine's approved development directories. It supports two complementary workflows:

  • Direct MCP workspace operations, where the host calls tools that read files, edit files, search code, and run shell commands against an opened workspace.
  • Delegated ACP worker runs, where Kontrol dispatches a bounded task to a registered local coding agent and routes completion through a human-reviewed Ralph/Nelson loop.

Pi's SDK is currently used as the backend adapter for mature local coding primitives such as read, edit, write, grep, find, ls, and bash. Kontrol wraps those primitives behind a remote Streamable HTTP MCP interface, suitable for use through a Cloudflare Tunnel.

Workspace records identify the shared project/root and checkpoint state; conversation-sensitive instruction discovery, skill activation, active work-session attribution, and UI selection belong to the owning MCP session context. A shared workspace ID must not cross that boundary.

The model-facing workflow is workspace based. MCP clients should call open_workspace once per local project directory or worktree, then reuse the returned workspaceId for subsequent tool calls in that same folder. Do not call open_workspace again for the same folder unless the workspaceId is rejected as unknown, the client switches folders/worktrees or checkout/worktree mode, or the user explicitly asks to reopen. AGENTS.md files are returned automatically by open_workspace and by later tool calls when the requested path enters a directory with instructions that have not been loaded for that workspace.

ACP review workflow:

  • Reviewer tools and worker tools are separate. Workers must never approve their own work or operate on a work session they are not bound to.
  • Reviewer and delegation routing: the active WebUI model is the primary reviewer, orchestrator, and inspector. Review, audit, diagnosis, architecture, and code-edit work starts directly in the opened workspace. ACP workers are optional bounded assistance only; call discover_agents before delegation, dispatch only a currently dispatchable healthy role: agent peer, and when optional assistance is unavailable return to direct workspace work without trying an alternate ACP path. When the caller platform is identifiable, prefer its healthy registered native harness (for example ChatGPT/OpenAI to Codex); otherwise use any healthy registered ACP peer. agentName is an explicit override. The platform hint affects routing only, never authority. A normal review must not enter supervised work. Ordinary non-Git directories are valid checkout workspaces; Git is required only for managed worktrees.
  • Review checkpoints are backend-neutral: Git workspaces use immutable Git snapshots, while ordinary directories use content-addressed filesystem snapshots without initializing or mutating Git. Submissions, approval, and verification bind to snapshotKind plus snapshotRef; any patch is only a bounded presentation of that exact snapshot. Structured read-only read, grep, glob, and ls remain public even in codex tool mode.
  • submit_to_coding_agent and supervised mission tools create durable work sessions. A worker submits changes with submit_for_review, then blocks on await_review_feedback.
  • A reviewer provides approval, rejection, or structured change requests through the WebUI/MCP tools. Change requests create durable continuations; approval is bound to the exact submission hash, review epoch, and workspace snapshot.
  • begin_supervised_work, inspect_supervised_work, continue_supervised_work, and approve_supervised_work are the mission control plane for acceptance-criterion-driven work.
  • Cancellation is durable and must stop the logical work session, supersede pending continuations, and request cancellation from the remote worker. The record remains in cancelling until worker shutdown or a confirmed missing remote run, then becomes terminal; workspace leases stay fenced meanwhile.

Read the full file on GitHub · 877 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 · +451 lines · +7,603 tokens per session f3fc69cfb0b2
  2. 24d ago Changed · +30 lines · +422 tokens per session aa12fa449913
  3. 28d ago Changed · +35 lines · +517 tokens per session 9a054c1cba6e
  4. 29d ago Changed · +74 lines · +1,100 tokens per session c199da8afa35
  5. 1mo ago Changed · +36 lines · +474 tokens per session e81ed887e4d1
  6. 1mo ago Changed · +177 lines · +2,477 tokens per session 3e4ab7935295
  7. 2mo ago First seen · 74 lines · 770 tokens per session scan A 2f3abd70f803

Subscribe to this mod's changes

Kontrol AGENTS.md is an instructions file published in the GitHub repository B-A-M-N/Kontrol (0 stars, last pushed yesterday), licensed MIT. It adds 13,363 tokens to every session, about $0.0535 per session on Opus 5.5. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

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).

microsoft/vscode · 9,715 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,461 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, cache eligibility and rollout and applying the notice (cutover).

microsoft/vscode · 5,262 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,680 tokens

vscode copilot-instructions.md

Copilot instructions for microsoft/vscode, covering vs code copilot instructions, project overview, root folders, core architecture (src/ folder) and built-in extensions (extensions/ folder).

microsoft/vscode · 2,750 tokens

deno copilot-instructions.md

Copilot instructions for denoland/deno, covering deno development guide for github copilot, network access, high level overview, key directories and key files to understand first.

denoland/deno · 3,077 tokens