aisix CLAUDE.md

A set of instructions for Claude Code that guides how an AI coding assistant should think and change code. It emphasizes stating assumptions, keeping solutions simple, and making only necessary edits.

In plain words
What is it for?
Use it to guide coding tasks that need careful reasoning, minimal changes, clear assumptions, and goal-focused execution.
Why use it?
It reduces common coding-agent mistakes such as guessing silently, adding unrequested features, overcomplicating code, or changing unrelated files.

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/api7/aisix/claude-md
Clone the repo
git clone --depth 1 https://github.com/api7/aisix
Per session 7,972 This file is loaded in full into every session.
When invoked 7,972 The same file — it is already loaded in full.
Security scan A 0 findings. 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.07972 $0.07972
Opus 5 $0.03986 $0.03986
Sonnet 5 $0.01594 $0.01594
Haiku 4.5 $0.00797 $0.00797

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

Security

Grade A, and why

aisix 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 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.

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 · 237 lines

How it starts

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

CLAUDE.md

Behavioral guidelines to reduce common LLM coding mistakes. Bias toward caution over speed; for trivial tasks, use judgment. Merge with project-specific instructions as needed.

1. Think Before Coding

Don't assume. Don't hide confusion. Surface tradeoffs.

  • State assumptions explicitly; if uncertain, ask.
  • If multiple interpretations exist, present them — don't pick silently.
  • If a simpler approach exists, say so. Push back when warranted.
  • If something is unclear, stop, name what's confusing, and ask.

2. Simplicity First

Minimum code that solves the problem. Nothing speculative.

  • No features beyond what was asked; no abstractions for single-use code.
  • No "flexibility" or "configurability" that wasn't requested.
  • No error handling for impossible scenarios.
  • If you write 200 lines and it could be 50, rewrite it. Would a senior engineer call it overcomplicated? Then simplify.

3. Surgical Changes

Touch only what you must. Clean up only your own mess.

  • Don't "improve" adjacent code, comments, or formatting; don't refactor what isn't broken; match existing style, even if you'd do it differently.
  • Remove imports/variables/functions YOUR changes orphaned — but don't delete pre-existing dead code; mention it instead.
  • The test: every changed line traces directly to the user's request.

4. Goal-Driven Execution

Define success criteria. Loop until verified.

  • Turn tasks into verifiable goals: "add validation" → write tests for invalid inputs, then pass them; "fix the bug" → write a reproducing test first; "refactor X" → tests pass before and after.
  • For multi-step tasks, state a brief plan as step → verify: check lines.
  • Strong criteria let you loop independently; weak criteria ("make it work") require constant clarification.

5. Testing Discipline

E2E tests are the highest-priority signal. Cover the real user journey. Never silence failures.

  • Prioritize E2E over unit/integration when coverage is limited; design cases around the user's real path and don't skip steps.
  • For any frontend UI, write E2E with Playwright, issuing requests to a real backend API — no stubbed network, fixture servers, or intercepted responses.
  • Don't use mock data in E2E; run against real data and services. If mocking seems unavoidable, stop and get human confirmation first.
  • Never skip, disable, or .only a test to go green — investigate the underlying bug instead.
  • E2E tests must be source-blind: design assertions from scenario reasonableness alone, never by reading product source to pick expected values. The test verifies the observable contract, not the implementation.
  • If an E2E test fails, the default conclusion is a bug in the code, not the test. Fix the product; don't weaken the assertion, relax the expected value, change the scenario, or read the source to explain it away. Only change a failing test if a human confirms the scenario is invalid.
  • If a test case itself looks wrong, flag it and ask a human — don't silently delete or rewrite it.

Read the full file on GitHub · 237 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 · 237 lines · 7,972 tokens per session scan A 96c2edf1e21e

Subscribe to this mod's changes

aisix CLAUDE.md is an instructions file published in the GitHub repository api7/aisix (123 stars, last pushed 2d ago), licensed Apache-2.0. It adds 7,972 tokens to every session, about $0.0399 per session on Opus 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.