guildbridge: Instructions file for Claude Code

CLAUDE.md

guildbridge CLAUDE.md is an instructions file for Claude Code from dend/guildbridge. It costs 1,065 tokens per session, scanned A, original, MIT.

A project guide for GuildBridge, a server that lets AI tools perform controlled Discord actions. It documents the project structure, development commands, deployment, checks, authentication, and access rules.

In plain words
What is it for?
Use it when changing GuildBridge, especially its Discord tools, OAuth login, Cloudflare deployment, administration panel, or audit logging.
Why use it?
It gives coding agents the repository context they need to work consistently instead of guessing how the project is built or organized.

Instructions file for Claude Code

Written for Claude Code: the file is CLAUDE.md. Also seen: mentions CLAUDE.md.

This is dend/guildbridge's own configuration. It tells Claude Code how to work on guildbridge 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 guildbridge configures →

Reuse

Borrowing it

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

Made for: Claude Code.

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

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

Your own site · 80×15
<a href="https://agentmods.dev/instructions/dend/guildbridge/claude-md"><img src="https://agentmods.dev/badge/instructions/dend/guildbridge/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 1,065 This file is loaded in full into every session.
When invoked 1,065 The same file — it is already loaded in full.
Security scan A 0 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.01065 $0.01065
Opus 5.5 $0.00426 $0.00426
Sonnet 5.5 $0.00213 $0.00213
Haiku 4.5 $0.00106 $0.00106

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

Security

Grade A, and why

guildbridge CLAUDE.md scanned grade A with 0 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 2mo 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

CLAUDE.md · 71 lines

How it starts

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

CLAUDE.md

Build & Check Commands

  • npm run dev — Start local dev server (port 8788)
  • npm run deploy — Deploy to Cloudflare Workers
  • npm run type-check — Run tsc --noEmit (no test suite exists)

Project Overview

GuildBridge is a remote MCP server deployed on Cloudflare Workers. It exposes Discord operations (read, search, post messages) as MCP tools. Authentication is via Discord OAuth; all Discord API calls use a bot token.

Architecture

  • src/index.ts — MCP server definition, tool handlers, access control logic (guild + channel)
  • src/discord-api.ts — Discord REST API wrappers, types, and permission computation
  • src/discord-handler.ts — Discord OAuth flow (Hono routes)
  • src/utils.ts — OAuth token exchange helpers, Props type (user identity stored in auth token)
  • src/workers-oauth-utils.ts — CSRF/session/state management
  • src/cf-access.ts — Cloudflare Access JWT validation middleware
  • src/admin.ts — Admin panel UI + API: Allowlist tab (KV), Activity tab (D1 audit log)
  • src/audit.ts — Tool-call audit: dual-write to D1 + Analytics Engine

Key Design Decisions

Access control is two-layered

  1. Guild membership — checked via the user's OAuth access token (listUserGuilds). Cached 60s.
  2. Channel visibility — computed using Discord's permission algorithm (computePermissions). Uses bot token to fetch guild roles, member roles, and channel permission overwrites. Cached 60s per guild.

Bot token vs user token

All Discord API calls use the bot token. The user's OAuth token is only used to verify guild membership (/users/@me/guilds with Bearer auth). This means the bot must be in any guild the user wants to access.

Permission computation follows Discord's algorithm

computePermissions in discord-api.ts implements the standard Discord permission resolution:

  1. Start with @everyone role permissions
  2. OR in member's role permissions
  3. Short-circuit if ADMINISTRATOR
  4. Apply channel-level overwrites: @everyone → roles → member-specific Guild owners bypass permission checks entirely.

Read the full file on GitHub · 71 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. 2mo ago First seen · 71 lines · 1,065 tokens per session scan A a9dba39d9b65

Subscribe to this mod's changes

guildbridge CLAUDE.md is an instructions file published in the GitHub repository dend/guildbridge (16 stars, last pushed 2mo ago), licensed MIT. It adds 1,065 tokens to every session, about $0.0043 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

guildbridge CLAUDE.md compared with instructions from other repositories

guildbridge CLAUDE.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
guildbridge CLAUDE.mddend/guildbridgeInstructions file162mo agoMITA1,065Claude Code
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143kyesterdayMITA7,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