claude-code-containers CLAUDE.md

Repository instructions for a Cloudflare Workers project that connects Claude Code with GitHub to process issues automatically. They describe the TypeScript worker, development and deployment commands, and Wrangler configuration.

In plain words
What is it for?
Running the local worker, generating Cloudflare types, using remote resources, deploying versions, and working on GitHub issue processing.
Why use it?
They clarify how the worker runs and which generated type file must be refreshed after configuration changes. This avoids mismatches between Cloudflare bindings and the TypeScript code.

Instructions file

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/ghostwriternr/claude-code-containers/claude-md
Clone the repo
git clone --depth 1 https://github.com/ghostwriternr/claude-code-containers
Per session 1,566 This file is loaded in full into every session.
When invoked 1,566 The same file — it is already loaded in full.
Security scan A 1 finding. Scan, not verified.
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 $0.01566 $0.01566
Opus 5 $0.00783 $0.00783
Sonnet 5 $0.00313 $0.00313
Haiku 4.5 $0.00157 $0.00157

Measured 2d ago against content hash 2d69ac97e3df, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

claude-code-containers 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 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.

async fetch(request: Request, env: Env, ctx: ExecutionContext): Promise<Response> {
CLAUDE.md · 161 lines

How it starts

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

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Development Commands

npm run dev          # Start local development server (http://localhost:8787)
npm run deploy       # Deploy to Cloudflare Workers
npm run cf-typegen   # Generate TypeScript types after wrangler config changes

⚠️ Important: Always run npm run cf-typegen after making changes to wrangler.jsonc. This regenerates the TypeScript types and updates worker-configuration.d.ts to match your bindings and configuration.

Wrangler CLI Commands

npx wrangler dev                    # Start local development (same as npm run dev)
npx wrangler dev --remote          # Use remote Cloudflare resources
npx wrangler deploy                 # Deploy to production (same as npm run deploy)
npx wrangler login                  # Authenticate with Cloudflare
npx wrangler versions upload        # Upload new version with preview URL

Tech Stack & Architecture

This is a Cloudflare Workers Container project that integrates Claude Code with GitHub for automated issue processing. It combines:

  • TypeScript Worker (src/index.ts) - Main request router and GitHub integration
  • Node.js Container (container_src/src/main.ts) - Containerized Claude Code environment running on port 8080
  • Durable Objects - Two DO classes: GitHubAppConfigDO for encrypted credential storage and MyContainer for container management

Key Architecture Points

Request Flow:

  1. Worker receives requests and routes based on path
  2. GitHub webhooks trigger issue processing in Claude Code containers
  3. Container routes (/container, /lb, /singleton, /error) for testing and load balancing
  4. Setup routes (/claude-setup, /gh-setup/*) handle API key configuration and GitHub app OAuth

Container Management:

  • Extends cf-containers library's Container class
  • Default port 8080, 45-second sleep timeout
  • Lifecycle hooks: onStart(), onStop(), onError()
  • Load balancing support across multiple container instances
  • Contains Claude Code SDK (@anthropic-ai/claude-code) and GitHub API client (@octokit/rest)

Read the full file on GitHub · 161 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. 2d ago First seen · 161 lines · 1,566 tokens per session scan A 2d69ac97e3df

Subscribe to this mod's changes

claude-code-containers CLAUDE.md is an instructions file published in the GitHub repository ghostwriternr/claude-code-containers (244 stars, last pushed 1y ago), licensed MIT. It adds 1,566 tokens to every session, about $0.0078 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.