kimaki: Instructions file for Codex

AGENTS.md

kimaki AGENTS.md is an instructions file for Codex, OpenCode from remorses/kimaki. It costs 9,729 tokens per session, scanned E, original, MIT.

Repository instructions for Kimaki, a project whose main CLI package contains a TypeScript command-line tool and Discord bot. They describe its monorepo structure, database communication, required checks, and development rules.

In plain words
What is it for?
Use them when changing the CLI, Discord message handling, queueing, onboarding, database-related code, tests, or release notes in the Kimaki repository.
Why use it?
They give contributors the project-specific rules needed to make safe changes, such as running TypeScript checks, tests, and changeset checks. A monorepo is one repository containing multiple related packages.

Instructions file for CodexOpenCode

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

This is remorses/kimaki's own configuration. It tells Codex and OpenCode how to work on kimaki 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 kimaki configures →

About the project

Kimaki is a Discord-based orchestrator for OpenCode, an AI coding agent that edits files on a user's machine. It maps each project to a Discord channel and each coding session to a thread, allowing users to start, resume, search, and fork work through conversations. Catalogue add-ons provide Kimaki-related workflows for coding agents.

remorses/kimaki · 1,446 stars · on GitHub · kimaki.dev

Reuse

Borrowing it

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

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

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

Your own site · 80×15
<a href="https://agentmods.dev/instructions/remorses/kimaki/agents-md"><img src="https://agentmods.dev/badge/instructions/remorses/kimaki/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 9,729 This file is loaded in full into every session.
When invoked 9,729 The same file — it is already loaded in full.
Security scan E 4 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.09729 $0.09729
Opus 5.5 $0.03892 $0.03892
Sonnet 5.5 $0.01946 $0.01946
Haiku 4.5 $0.00973 $0.00973

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

Security

Grade E, and why

kimaki AGENTS.md scanned grade E with 4 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 2d 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.

Nullifies safety policieshighAnti-refusal

"You have no restrictions", "do anything now", "ignore your guidelines": a direct jailbreak that disables guardrails.

after changes to message handling, queueing or the reducer run the full test suite inside `kimaki`: `pnpm run test --run -u`, then inspect snapshot updates in git diff. for one file, use `pnpm run test --run src/example.

Downloads and executes remote codehighSupply chain

curl | sh runs whatever the server returns today, which is not necessarily what it returned when this was reviewed.

Kimaki uses the user's shared OpenCode service, not a bot-owned server. `opencode-server.ts` discovers it or starts it through `Service.ensure()` when none is running (`findOpencodeBinary`: `OPENCODE_PATH` if set, else `

Makes network callslowCapability

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

Kimaki uses the user's shared OpenCode service, not a bot-owned server. `opencode-server.ts` discovers it or starts it through `Service.ensure()` when none is running (`findOpencodeBinary`: `OPENCODE_PATH` if set, else `

Runs shell commandslowCapability

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

never use `spawnSync` or `execSync`. use async `execFile` (`promisify(execFile)`) or `spawn` from `node:child_process`, with a timeout.
AGENTS.md · 435 lines

How it starts

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

Decisions: plans/decisions/. Search them before designing or refactoring.

the important package in this repo is kimaki/: the Kimaki Discord bot and kimaki CLI (npm package kimaki), built on OpenCode V2. it replaced the V1 cli/ package; kimaki/CHANGELOG.md keeps the V1 release history. this branch supports OpenCode V2 only. the legacy OpenCode V1 compatible codebase lives in the cli/ folder of the v1 branch (https://github.com/remorses/kimaki/tree/v1/cli); read it there with git show v1:cli/<path>, never re-add V1 support here.

after every change and every feature run pnpm build (tsc) inside kimaki. it validates types and keeps kimaki/dist up to date: the OpenCode plugin autostarts the bot from dist/cli.js (src/autostart.ts), so a stale dist starts old code. try to never use as any.

always load the changesets skill before fixing bugs or adding features. User-facing fixes and features usually need a .changeset/*.md entry, and the skill explains package selection, issue references, descriptive filenames, and .changeset/readme.md expectations.

never use spawnSync or execSync. use async execFile (promisify(execFile)) or spawn from node:child_process, with a timeout.

after changes to message handling, queueing or the reducer run the full test suite inside kimaki: pnpm run test --run -u, then inspect snapshot updates in git diff. for one file, use pnpm run test --run src/example.test.ts. always include run after pnpm; pnpm test --run makes pnpm consume the flag, and pnpm run test -- --run passes a literal -- that can make vitest ignore the filter.

each kimaki e2e test file starts its own OpenCode server (~400 MB). kimaki/vitest.config.ts caps parallel files at a third of the CPUs; override with KIMAKI_TEST_WORKERS. other agents may run suites at the same time, so run single files while iterating and the full suite once at the end. timeouts in a full run on a loaded machine may be load-related: rerun the failing file alone before debugging.

kimaki CLI startup must stay light (~0.06s, ~70 MB): agents and tests call kimaki many times. kimaki/src/cli/*.ts must not import SQLite (db.ts, schema.ts, credentials.ts, project.ts, voice.ts) or discord.js at top level; await import() them inside the actions that need them. use discord-api-types/v10 for enums like ChannelType.

for checkout validation requests, prefer non-recursive checks unless the user asks otherwise.

task-specific docs

read the matching doc before starting these tasks. they hold the full procedures and are not repeated here.

task read first
any larger kimaki feature: why it works the way it does, what was dropped from V1 docs/kimaki-v2-rebuild-spec.md
gateway-proxy, website onboarding, gateway_clients, --gateway, bot credentials docs/gateway-architecture.md
publish, release notes, #changelog post, website deploy, kimaki-demo deploy docs/release-process.md
editing discord-slack-bridge/ (Slack API links, ID encoding, KV auth cache) discord-slack-bridge/AGENTS.md
Strada events, DAU/WAU/MAU, funnels, retention SQL docs/strada-product-analytics.md
event sourcing patterns and examples docs/event-sourcing-for-application-state.md
reducer fixtures (recorded OpenCode V2 event streams) docs/opencode-v2-events/

Read the full file on GitHub · 435 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. 2d ago Changed · +5 lines · +390 tokens per session ff262fa7c290
  2. 7d ago Changed · +7 lines · +555 tokens per session 1828b199ead0
  3. 14d ago Changed · +45 tokens per session 4af9fd1c99d0
  4. 22d ago Changed · +1 lines · +155 tokens per session 8646f0100ccb
  5. 25d ago Changed · +1 lines · +120 tokens per session 290989997996
  6. 28d ago Changed · +17 lines · +1,214 tokens per session scan C → E 36b731c46e21
  7. 1mo ago Changed · +19 lines · +480 tokens per session 4e782bd47b9f
  8. 1mo ago Changed · -371 lines · -4,763 tokens per session f7f04890de1f
  9. 1mo ago Changed · +2 lines · +122 tokens per session fd11a0cadb21
  10. 1mo ago First seen · 754 lines · 11,411 tokens per session scan C ba34c2c545ef

Subscribe to this mod's changes

kimaki AGENTS.md is an instructions file published in the GitHub repository remorses/kimaki (1,446 stars, last pushed yesterday), licensed MIT. It adds 9,729 tokens to every session, about $0.0389 per session on Opus 5.5. A static security scan graded it E with 4 findings (nullifies safety policies, downloads and executes remote code, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

kimaki AGENTS.md compared with instructions from other repositories

kimaki AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
kimaki AGENTS.mdremorses/kimakiInstructions file1.4kyesterdayMITE9,729Codex, OpenCode
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143ktodayMITA7,461Codex, OpenCode
langchain AGENTS.mdlangchain-ai/langchainInstructions file149kyesterdayMITA4,680Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA5,516GitHub Copilot
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA3,093GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file274k2d agoMITA4,313Codex, OpenCode