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/CLAUDE.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/claude-md)<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>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.06708 | $0.06708 |
| Opus 5 | $0.03354 | $0.03354 |
| Sonnet 5 | $0.01342 | $0.01342 |
| Haiku 4.5 | $0.00671 | $0.00671 |
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`. 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. 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.
- yesterday Changed · +85 tokens per session 25d1ca43fe28
- 7d ago First seen · 410 lines · 6,623 tokens per session scan A e23cc70ea185
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.
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.
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.
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 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).
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.