Borrowing it
Nothing to install: this file belongs to ebibibi/ebi-agent-chat-relay. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/ebibibi/ebi-agent-chat-relay/main/AGENTS.mdgit clone --depth 1 https://github.com/ebibibi/ebi-agent-chat-relayWrote 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/ebibibi/ebi-agent-chat-relay/agents-md)<a href="https://agentmods.dev/instructions/ebibibi/ebi-agent-chat-relay/agents-md"><img src="https://agentmods.dev/badge/instructions/ebibibi/ebi-agent-chat-relay/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.
<a href="https://agentmods.dev/instructions/ebibibi/ebi-agent-chat-relay/agents-md"><img src="https://agentmods.dev/badge/instructions/ebibibi/ebi-agent-chat-relay/agents-md.svg" alt="Reviewed on agentmods" width="80" 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.1 | $0.07684 | $0.07684 |
| Opus 5.5 | $0.03074 | $0.03074 |
| Sonnet 5.5 | $0.01537 | $0.01537 |
| Haiku 4.5 | $0.00768 | $0.00768 |
Grade A, and why
ebi-agent-chat-relay 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 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.
Makes network callslowCapability
Not a fault in itself. Listed so you know the mod talks to something, and to what.
**REST API chosen because**: clean interface, independently testable, usable by external systems, already an established ccdb pattern (`ext/api_server.py`). Claude uses its Bash tool to `curl $CCDB_API_URL/api/tasks`. This is a copy
100% identical to superpowers AGENTS.md — 439 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.
How it starts
The opening of the file, as written. The whole thing — 425 lines — stays where its author put it; the contents beside it link to each section on GitHub.
claude-code-discord-bridge (ccdb)
Discord frontend for Claude Code CLI. This is a framework (OSS library), not a personal bot.
略称: ccdb (claude-code-discord-bridge)
Framework vs Instance
- claude-code-discord-bridge (this repo) = reusable OSS framework. No personal config, no secrets, no server-specific logic.
- Personal instances (e.g. EbiBot) use the custom Cog loader (
CUSTOM_COGS_DIR/--cogs-dir) to add their own Cogs. Seeexamples/ebibot/for the reference implementation. - When adding features: if it's useful to anyone → add here. If it's personal workflow → add as a custom Cog.
Zero-Config Principle (Critical)
Consumers must get new features by updating the package alone — no code changes required.
- New features should be enabled by default (auto-discovery, sensible defaults)
- New constructor parameters must have backward-compatible defaults (
= None) - If a feature requires consumers to wire something up, the design is wrong — fix it in ccdb
- Consumers should NEVER need to copy, wrap, or subclass ccdb Cogs. If they do, ccdb is missing an extension point
Architecture
- Python 3.12+ with discord.py v2
- Cog pattern for modular features
- Repository pattern for data access (SQLite via aiosqlite)
- asyncio.subprocess for Claude Code CLI invocation (never shell=True)
Key Design Decisions
- CLI spawn, not API: We invoke
claude -p --output-format stream-jsonas a subprocess, not the Anthropic API directly. This gives us all Claude Code features (CLAUDE.md, skills, tools, memory) for free. - Thread = Session: Each Discord thread maps 1:1 to a Claude Code session ID. Replies in a thread continue the same session via
--resume. - Emoji reactions for status: Non-intrusive progress indication on the user's message. Debounced to avoid Discord rate limits.
- Fence-aware chunking: Never split messages inside a code block. The logic lives in
claude_code_core/rendering/and is driven bySurfaceCapabilities, not by Discord's numbers — a surface with a 100 KB limit sends the same answer as one message instead of inheriting Discord's 2,000-character fragmentation. - Installable package:
claude_discordis a proper Python package. Consumers install viauv add git+...orpip install git+..., not by copying files. - Shared run helper:
cogs/_run_helper.pycentralizes Claude CLI execution logic used by both ClaudeChatCog and SkillCommandCog. - REST API as the control plane: Claude Code subprocesses communicate back to ccdb via REST API (
CCDB_API_URLenv var), not via stdout markers or special output formats. This makes the interface explicit, testable, and usable by external systems (GitHub Actions, etc.). Seeext/api_server.py. - SQLite-backed dynamic scheduler: Scheduled tasks are stored in
scheduled_tasksDB table and executed by a singlediscord.ext.tasksmaster loop (every 30s). Tasks are registered at runtime via REST API — no code changes needed to add new tasks.discord.ext.tasksdecorators are only used for the master loop, not per-task (they're static/compile-time constructs). - Claude handles "what", ccdb handles "when": For scheduled tasks, ccdb only manages the schedule. All domain logic (what to check, how to deduplicate, what to post) lives in the Claude prompt. No GitHub/AzureDevOps-specific code in ccdb itself.
- CLI env overlay (
CCDB_CLI_ENV_FILE): OptionalKEY=VALUEfile read on every CLI spawn to inject env vars into the subprocess. Enables live configuration changes (e.g., switching to Azure Foundry) without restarting the bot. The file is read by_build_env()inrunner.py. - Model suggestions are discovered, not hardcoded (
model_catalog.py): the/modelautocomplete asksGET /v1/models(reusing the CLI's own credentials) instead of shipping a constant that goes stale on every model launch. This is the only sanctioned direct Anthropic API call, and it is strictly non-essential: no credentials, no network, a 3P provider, orCCDB_MODEL_DISCOVERY=0all degrade to the staticSUGGESTED_MODELSfallback. Never let it raise into a command path, and never log the token. Codex is discovered too, but without a second vendor call: the Codex CLI already fetches its own catalog and writes it to$CODEX_HOME/models_cache.json, socodex_model_choices()reads that file. A new generation (gpt-6-astra) appears as soon as the CLI has seen it, and decision 13's "ccdb does not phone home" still holds.
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.
- 2d ago Changed · +6 lines · +60 tokens per session fdb7af7ed1c2
- 3d ago Changed · +2 lines · +193 tokens per session 42a530c1a23f
- 15d ago Changed · +2 lines · +330 tokens per session be0f0c5daad1
- 16d ago Changed · -4 tokens per session 07c223a32128
- 29d ago Changed · +2 lines · +273 tokens per session 75c574536e6b
- 1mo ago Changed · +412 lines · +6,828 tokens per session 8475d0c6876d
- 1mo ago First seen · 1 lines · 4 tokens per session scan A 6ebdb617a810
ebi-agent-chat-relay AGENTS.md is an instructions file published in the GitHub repository ebibibi/ebi-agent-chat-relay (64 stars, last pushed yesterday), licensed MIT. It adds 7,684 tokens to every session, about $0.0307 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). It is 100% identical to superpowers AGENTS.md, differing in 439 lines, and is treated as a copy.
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).
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.
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).
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.
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).
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.