kilocode AGENTS.md

Repository instructions for working on Kilo Code, an open-source AI coding agent. They cover development commands, package-specific guidance, quality checks, worktrees, and release-related practices.

In plain words
What is it for?
Use them when developing, testing, type-checking, building, or running Kilo Code and its VS Code extension in the Kilo-Org/kilocode repository.
Why use it?
They give coding agents the project’s expected rules and commands, reducing mistakes caused by using the wrong workflow or modifying the wrong checkout.

Instructions file for CodexOpenCode

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 instructions/kilo-org/kilocode/agents-md
Clone the repo
git clone --depth 1 https://github.com/Kilo-Org/kilocode

Made for: Codex, OpenCode.

Per session 4,334 This file is loaded in full into every session.
When invoked 4,334 The same file — it is already loaded in full.
Security scan A 1 finding. Scan, not verified.
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 $0.04334 $0.04334
Opus 5 $0.02167 $0.02167
Sonnet 5 $0.00867 $0.00867
Haiku 4.5 $0.00433 $0.00433

Measured today against content hash 51a3746a7cdd, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

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

Makes network callslowCapability

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

- **Backend/SDK programmatic testing**: see [TESTING.md](./TESTING.md) for spawning the local main-branch backend (`bun dev serve`) and driving it via `curl` — use this instead of `kilo serve` (prod binary) when testing
AGENTS.md · 215 lines

How it starts

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

AGENTS.md

Kilo CLI is an open source AI coding agent that generates code from natural language, automates tasks, and supports 500+ AI models.

  • ALWAYS USE PARALLEL TOOLS WHEN APPLICABLE.
  • The default branch in this repo is main.
  • Prefer automation: execute requested actions without confirmation unless blocked by missing info or safety/irreversibility.
  • You may be running in a git worktree. All changes must be made in your current working directory — never modify files in the main repo checkout.

Build and Dev

  • Dev: bun run dev (runs from root) or bun run --cwd packages/opencode --conditions=browser src/index.ts
  • Dev with params: bun dev -- help
  • Extension: bun run extension (build + launch VS Code with the extension in dev mode). Pass --no-build to skip the build. When asked to run an isolated VS Code/Kilo environment, use the CLI scripts instead of interactive launch configs: bun run extension:isolated reuses .kilo-dev/, and bun run extension:isolated:clean clears .kilo-dev/ first. Pass an optional workspace path after --, for example bun run extension:isolated -- ../sample-project.
  • Typecheck: bun turbo typecheck (uses tsgo, not tsc). Includes the JetBrains plugin and requires Java 21; do not run java -version as a routine preflight. Only check Java when a Gradle/Java command fails with a Java-version or missing-Java error. If missing, install via SDKMAN: sdk install java 21-tem && sdk use java 21-tem. If SDKMAN is not installed, see https://sdkman.io/install.
  • Test: bun test from packages/opencode/ (NOT from root -- root blocks tests)
  • Single test: bun test ./test/tool/tool-define.test.ts from packages/opencode/
  • CLI build artifact size check: after bun run script/build.ts --single --skip-install in packages/opencode/, use du -h dist/*/*/bin/kilo (scoped package output lives under dist/@kilocode/)
  • SDK regen: After changing server endpoints in packages/opencode/src/server/, run ./script/generate.ts from root to regenerate packages/sdk/js/
  • Knip (unused exports): bun run knip from packages/kilo-vscode/. CI runs this — all exported types/functions must be imported somewhere. Remove or unexport unused exports before pushing.
  • Source links: After adding or changing URLs in packages/kilo-vscode/, packages/kilo-vscode/webview-ui/, or packages/opencode/src/, run bun run script/extract-source-links.ts from the repo root and commit the updated packages/kilo-docs/source-links.md. CI runs this check — the build fails if the file is stale.
  • kilocode_change check: bun run check-kilocode-change from packages/kilo-vscode/. CI runs this — kilocode_change is a marker for upstream merge conflicts and must not appear in packages/kilo-vscode/ or packages/kilo-ui/ (these are entirely Kilo Code additions). Remove the markers before pushing.
  • opencode annotation check: bun run script/check-opencode-annotations.ts --worktree from repo root when verifying local agent changes. CI runs bun run script/check-opencode-annotations.ts on PRs touching packages/opencode/ — every Kilo-specific change in shared opencode files must be annotated with kilocode_change markers. Exempt paths (no markers needed): packages/opencode/src/kilocode/, packages/opencode/test/kilocode/, and any path containing kilocode in the name.
  • Effect facade ratchet: Do not add runtime-backed Promise facades to shared packages/opencode/src Effect services; use service dependencies, AppRuntime, or Kilo-owned boundaries. Run bun run script/check-opencode-promise-facades.ts when touching service adapters.
  • workflow allowlist: bun run script/check-workflows.ts from repo root. CI runs this as part of the annotations workflow — any .yml / .yaml file added to or removed from .github/workflows/ must be reflected in the hardcoded list in script/check-workflows.ts. Prevents upstream-merged workflows from silently starting to run in our CI.
  • Backend/SDK programmatic testing: see TESTING.md for spawning the local main-branch backend (bun dev serve) and driving it via curl — use this instead of kilo serve (prod binary) when testing backend fixes.

Read the full file on GitHub · 215 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 Changed · +1 lines · +41 tokens per session 51a3746a7cdd
  2. 3d ago First seen · 214 lines · 4,293 tokens per session scan A fc30b06e84ca

Subscribe to this mod's changes

kilocode AGENTS.md is an instructions file published in the GitHub repository Kilo-Org/kilocode (27,119 stars, last pushed today), licensed MIT. It adds 4,334 tokens to every session, about $0.0217 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.