agentleFS
ding113ding113/claude-code-hub/CLAUDE.md

claude-code-hub

CLAUDE.md3.4k starsChanged 4 months agoMITView on GitHub

IMPORTANT: Never create SQL migration files manually. Always follow this workflow:

  • Reads credentials

Trending

Quiet since June.thin dataabout the whole repository

Dec 2025: 0 mentionsJan 2026: 0 mentionsFeb 2026: 1 mentionMar 2026: 1 mentionApr 2026: 0 mentionsMay 2026: 1 mentionJun 2026: 1 mentionJul 2026: 0 mentionsAug 2026: 0 mentionsSep 2026: 0 mentionsOct 2026: 0 mentionsNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the ding113/claude-code-hub repository that our weekly crawl found: only 4 in all, so this is a hint, not a trend. There is no adoption data for this file yet.
  • In this repositoryOne other file it gives its agents.

The file

We split this CLAUDE.md into the rules it gives an agent

10 rules. About 0 are common, 6 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    No Emoji in Code: - Never use emoji characters in any code, comments, or string literals

    line 12
  2. Distinctive:

    Test Coverage: - All new features must have unit test coverage of at least 80%

    line 13
  3. Distinctive:

    i18n Required: - All user-facing strings must use i18n (5 languages supported).

    line 14
  4. Distinctive:

    Pre-commit Checklist: - Before committing, always run:

    line 15
  5. Distinctive:

    IMPORTANT: Never create SQL migration files manually.

    line 55
  6. Very specific:

    Generate migration: - Run bun run db:generate

    line 58
  7. Very specific:

    Review generated SQL: - Check the generated file in drizzle/ directory

    line 59
  8. Very specific:

    Apply migration: - Run bun run db:migrate or let AUTO_MIGRATE=true handle it on startup

    line 61
  9. Distinctive:

    Exports: Prefer named exports over default exports

    line 131
  10. Very specific:

    i18n: Use next-intl for internationalization (5 languages: zh-CN, zh-TW, en, ja, ru)

    line 132

≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

CLAUDE.md

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

Repository Info

Critical Rules

  1. No Emoji in Code - Never use emoji characters in any code, comments, or string literals
  2. Test Coverage - All new features must have unit test coverage of at least 80%
  3. i18n Required - All user-facing strings must use i18n (5 languages supported). Never hardcode display text
  4. Pre-commit Checklist - Before committing, always run:
    bun run build      # Production build
    bun run lint       # Biome check
    bun run lint:fix   # Biome auto-fix
    bun run typecheck  # TypeScript check (uses tsgo)
    bun run test       # Run Vitest tests

Build & Development Commands

# Development
bun install               # Install dependencies
bun run dev               # Run tsgo preflight, then start dev server (port 13500)

# Build & Production
bun run build             # Run tsgo preflight, then build for production
bun run start             # Start production server

# Quality Checks
bun run typecheck         # Type check with tsgo (faster)
bun run lint              # Lint with Biome
bun run lint:fix          # Auto-fix lint issues
bun run format            # Format code

# Testing
bun run test              # Run unit tests (vitest)
bun run test:ui           # Interactive test UI
bun run test:coverage     # Coverage report
bunx vitest run <file>    # Run single test file
bunx vitest run -t "test name"  # Run specific test

# Dev environment (via dev/Makefile)
cd dev && make dev        # Start all services (PG + Redis + app)
cd dev && make db         # Start only database services

Database Migration Workflow

IMPORTANT: Never create SQL migration files manually. Always follow this workflow:

  1. Modify schema - Edit src/drizzle/schema.ts
  2. Generate migration - Run bun run db:generate
  3. Review generated SQL - Check the generated file in drizzle/ directory
  4. Edit if necessary - Make any required adjustments to the generated SQL
  5. Apply migration - Run bun run db:migrate or let AUTO_MIGRATE=true handle it on startup
bun run db:generate       # Generate Drizzle migrations from schema changes
bun run db:migrate        # Apply migrations
bun run db:push           # Push schema changes (dev only)
bun run db:studio         # Open Drizzle Studio

Architecture Overview

Tech Stack

  • Framework: Next.js 16 (App Router) + Hono for API routes
  • Database: PostgreSQL (Drizzle ORM) + Redis (ioredis)
  • UI: React 19 + shadcn/ui + Tailwind CSS + Recharts
  • Package Manager: Bun (1.3+)
  • Testing: Vitest + happy-dom

Directory Structure

src/
├── app/
│   ├── [locale]/dashboard/    # Dashboard UI pages
│   ├── api/
│   │   ├── v1/                # REST management API + OpenAPI docs
│   │   └── actions/           # Legacy Server Action adapter (deprecated)
│   └── v1/                    # Proxy API (Claude/OpenAI compatible)
│       └── _lib/
│           ├── proxy/         # Core proxy pipeline
│           ├── converters/    # Format converters (claude/openai/codex/gemini)
│           └── codex/         # Codex CLI adapter
├── actions/                   # Server Actions reused by REST handlers
├── lib/                       # Core business logic
│   ├── session-manager.ts     # Session & context caching
│   ├── circuit-breaker.ts     # Provider health management
│   ├── rate-limit/            # Multi-dimensional rate limiting
│   └── redis/                 # Redis utilities
├── repository/                # Drizzle ORM data access layer
└── drizzle/
    └── schema.ts              # Database schema definition

Core Proxy Flow

The proxy pipeline (src/app/v1/_lib/proxy-handler.ts) processes requests through a guard chain:

Request -> GuardPipeline -> [auth -> sensitive -> client -> model -> version -> probe ->
                            session -> warmup -> requestFilter -> rateLimit ->
                            provider -> providerRequestFilter -> messageContext] ->
           ProxyForwarder -> ProxyResponseHandler -> Response

Key components:

  • GuardPipeline (guard-pipeline.ts): Configurable chain of request guards
  • ProxySession (session.ts): Request context holder
  • ProxyForwarder (forwarder.ts): Handles upstream API calls
  • ProviderResolver (provider-selector.ts): Load balancing with weight/priority
  • Format Converters (converters/): Bidirectional format translation

API Layer

  • Proxy endpoints: /v1/messages, /v1/chat/completions, /v1/responses
  • Management API: /api/v1/* - RESTful management surface documented by OpenAPI
  • Legacy Management API: /api/actions/{module}/{action} - Deprecated Server Action adapter, retained behind ENABLE_LEGACY_ACTIONS_API
  • Docs: /api/v1/scalar (Scalar UI), /api/v1/docs (Swagger), /api/v1/openapi.json
  • OpenAPI checks: bun run test:v1, bun run openapi:check, bun run openapi:lint

Code Conventions

  • Path alias: @/ maps to ./src/
  • Formatting: Biome (double quotes, trailing commas, 2-space indent, 100 char width)
  • Exports: Prefer named exports over default exports
  • i18n: Use next-intl for internationalization (5 languages: zh-CN, zh-TW, en, ja, ru)
  • Testing: Unit tests in tests/unit/, integration in tests/integration/, source-adjacent tests in src/**/*.test.ts

Environment Variables

Critical variables (see .env.example for full list):

  • ADMIN_TOKEN: Admin login token (required)
  • DSN: PostgreSQL connection string
  • REDIS_URL: Redis connection URL
  • ENABLE_RATE_LIMIT: Toggle rate limiting
  • SESSION_TTL: Session cache TTL (default 300s)
  • AUTO_MIGRATE: Auto-run migrations on startup

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.