ebi-agent-chat-relay: Instructions file for Claude Code

AGENTS.md

ebi-agent-chat-relay AGENTS.md is an instructions file for Claude Code, Codex, OpenCode from ebibibi/ebi-agent-chat-relay. It costs 8,425 tokens per session, scanned A, a copy of skills AGENTS.md, MIT.

Project instructions for a multi-frontend agent relay that runs Claude Code, Codex, local agents, and AG-UI agents from Discord or Microsoft Teams.

In plain words
What is it for?
Use them when exploring or changing the ebibibi/ebi-agent-chat-relay project and its agent integrations.
Why use it?
They give coding agents the project context needed to work on the relay correctly.

Instructions file for Claude CodeCodexOpenCode

Written for Claude Code and Codex and OpenCode: PostToolUse hook event, but also reads $CODEX_HOME. Also seen: reads .claude/ paths; mentions CLAUDE.md; names the SlashCommand tool.

This is ebibibi/ebi-agent-chat-relay's own configuration. It tells Claude Code, Codex and OpenCode how to work on ebi-agent-chat-relay 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 ebi-agent-chat-relay configures →

Not installable: its command points at a path on the author’s own machine, so it runs nowhere else. The line is /home/ebi/claude-code-discord-bridge/.

Reuse

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.

Copy the file
curl -O https://raw.githubusercontent.com/ebibibi/ebi-agent-chat-relay/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/ebibibi/ebi-agent-chat-relay

Made for: Claude Code, 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 ebi-agent-chat-relay AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/ebibibi/ebi-agent-chat-relay/agents-md/github.svg)](https://agentmods.dev/instructions/ebibibi/ebi-agent-chat-relay/agents-md)
Your own site
<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.

agentmods 80×15 button for ebi-agent-chat-relay AGENTS.md

Your own site · 80×15
<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>
Per session 8,425 This file is loaded in full into every session.
When invoked 8,425 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 100% copy Near-identical to another mod 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.08425 $0.08425
Opus 5.5 $0.03370 $0.03370
Sonnet 5.5 $0.01685 $0.01685
Haiku 4.5 $0.00843 $0.00843

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

Security

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 6d 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`.
Origin

This is a copy

100% identical to skills AGENTS.md — 440 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.

AGENTS.md · 439 lines

How it starts

The opening of the file, as written. The whole thing — 439 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. See examples/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

  1. CLI spawn, not API: We invoke claude -p --output-format stream-json as a subprocess, not the Anthropic API directly. This gives us all Claude Code features (CLAUDE.md, skills, tools, memory) for free.
  2. Thread = Session: Each Discord thread maps 1:1 to a Claude Code session ID. Replies in a thread continue the same session via --resume.
  3. Emoji reactions for status: Non-intrusive progress indication on the user's message. Debounced to avoid Discord rate limits.
  4. Fence-aware chunking: Never split messages inside a code block. The logic lives in claude_code_core/rendering/ and is driven by SurfaceCapabilities, 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.
  5. Installable package: claude_discord is a proper Python package. Consumers install via uv add git+... or pip install git+..., not by copying files.
  6. Shared run helper: cogs/_run_helper.py centralizes Claude CLI execution logic used by both ClaudeChatCog and SkillCommandCog.
  7. REST API as the control plane: Claude Code subprocesses communicate back to ccdb via REST API (CCDB_API_URL env var), not via stdout markers or special output formats. This makes the interface explicit, testable, and usable by external systems (GitHub Actions, etc.). See ext/api_server.py.
  8. SQLite-backed dynamic scheduler: Scheduled tasks are stored in scheduled_tasks DB table and executed by a single discord.ext.tasks master loop (every 30s). Tasks are registered at runtime via REST API — no code changes needed to add new tasks. discord.ext.tasks decorators are only used for the master loop, not per-task (they're static/compile-time constructs).
  9. 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.
  10. CLI env overlay (CCDB_CLI_ENV_FILE): Optional KEY=VALUE file 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() in runner.py.
  11. Model suggestions are discovered, not hardcoded (model_catalog.py): the /model autocomplete asks GET /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, or CCDB_MODEL_DISCOVERY=0 all degrade to the static SUGGESTED_MODELS fallback. 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, so codex_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.

Read the full file on GitHub · 439 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. 6d ago Changed · +2 lines · +345 tokens per session 00f3170a7d35
  2. 21d ago Changed · +12 lines · +396 tokens per session cf14ec340ad2
  3. 1mo ago Changed · +6 lines · +60 tokens per session fdb7af7ed1c2
  4. 1mo ago Changed · +2 lines · +193 tokens per session 42a530c1a23f
  5. 2mo ago Changed · +2 lines · +330 tokens per session be0f0c5daad1
  6. 2mo ago Changed · -4 tokens per session 07c223a32128
  7. 2mo ago Changed · +2 lines · +273 tokens per session 75c574536e6b
  8. 2mo ago Changed · +412 lines · +6,828 tokens per session 8475d0c6876d
  9. 3mo ago First seen · 1 lines · 4 tokens per session scan A 6ebdb617a810

Subscribe to this mod's changes

ebi-agent-chat-relay AGENTS.md is an instructions file published in the GitHub repository ebibibi/ebi-agent-chat-relay (68 stars, last pushed yesterday), licensed MIT. It adds 8,425 tokens to every session, about $0.0337 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). It is 100% identical to skills AGENTS.md, differing in 440 lines, and is treated as a copy.

Related

ebi-agent-chat-relay AGENTS.md compared with instructions from other repositories

ebi-agent-chat-relay AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
ebi-agent-chat-relay AGENTS.mdebibibi/ebi-agent-chat-relayInstructions file68yesterdayMITA8,425Claude Code, Codex, OpenCode
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA9,887GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file144ktodayMITA7,230Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA5,685GitHub Copilot
langchain AGENTS.mdlangchain-ai/langchainInstructions file150kyesterdayMITA4,951Codex, OpenCode
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file291kyesterdayMITA4,396Codex, OpenCode
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA3,303GitHub Copilot