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

CLAUDE.md

ebi-agent-chat-relay CLAUDE.md is an instructions file for Claude Code, Codex from ebibibi/ebi-agent-chat-relay. It costs 6,708 tokens per session, scanned A, original, MIT.

Project instructions for developing ccdb, an open-source framework that connects the Claude Code command-line tool to Discord. The instructions explain its architecture and how reusable features should be added.

In plain words
What is it for?
They guide changes to the Python Discord framework, including feature discovery, compatible interfaces, extension points, and the separation between the framework and individual bot instances.
Why use it?
They give coding agents the project context needed to avoid mixing shared framework code with personal bot configuration and to preserve the zero-configuration design.

Instructions file for Claude CodeCodex

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

This is ebibibi/ebi-agent-chat-relay's own configuration. It tells Claude Code and Codex 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/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/ebibibi/ebi-agent-chat-relay

Made for: Claude Code, Codex.

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 CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/ebibibi/ebi-agent-chat-relay/claude-md.svg)](https://agentmods.dev/instructions/ebibibi/ebi-agent-chat-relay/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/ebibibi/ebi-agent-chat-relay/claude-md"><img src="https://agentmods.dev/badge/instructions/ebibibi/ebi-agent-chat-relay/claude-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 6,708 This file is loaded in full into every session.
When invoked 6,708 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.06708 $0.06708
Opus 5 $0.03354 $0.03354
Sonnet 5 $0.01342 $0.01342
Haiku 4.5 $0.00671 $0.00671

Measured yesterday against content hash 25d1ca43fe28, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

ebi-agent-chat-relay CLAUDE.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 yesterday.

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`.
CLAUDE.md · 410 lines

How it starts

The opening of the file, as written. The whole thing — 410 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 · 410 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. yesterday Changed · +85 tokens per session 25d1ca43fe28
  2. 7d ago First seen · 410 lines · 6,623 tokens per session scan A e23cc70ea185

Subscribe to this mod's changes

ebi-agent-chat-relay CLAUDE.md is an instructions file published in the GitHub repository ebibibi/ebi-agent-chat-relay (56 stars, last pushed yesterday), licensed MIT. It adds 6,708 tokens to every session, about $0.0335 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.

Related

Other instructions, from other repositories

codex AGENTS.md

AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.

openai/codex · 5,182 tokens

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 · 6,785 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,296 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,469 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, applying the notice (cutover) and fallback chain (never fail the build).

microsoft/vscode · 5,001 tokens

spec-kit AGENTS.md

AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.

github/spec-kit · 7,104 tokens