Claude Code Entry

You are working in a high-performance, highly-available distributed cache and infrastructure system.

Treat every implementation, bugfix, review, and design task as infrastructure engineering work, not CRUD work. Performance, concurrency safety, memory safety, recovery correctness, and operational availability are repository-level requirements.

Use the shared repository context in .repo_context/.

Recommended read order:

  1. .repo_context/README.md
  2. .repo_context/index.md
  3. .repo_context/maintenance.md
  4. .repo_context/generated/repo_index.md
  5. .repo_context/modules/overview/engineering-principles.md
  6. relevant .repo_context/modules/<domain>/*.md or .repo_context/playbooks/<category>/...

Rules:

  • Treat .repo_context/ as indexed guidance, not final truth.
  • Verify meaningful claims against source files before implementation or review.
  • When a touched module changes, update the relevant context files and regenerate the index if structure changed.
  • Before adding new logic, search for existing helpers, utilities, status/error patterns, thread pools, persistence helpers, recovery paths, and test harnesses.
  • Identify whether the change touches a hot path. If it does, explicitly assess latency, throughput, lock contention, allocations, copies, cache locality, IO, and foreground impact from background work.
  • For stateful changes, explicitly assess persistence, crash consistency, partial writes, startup rebuild, compaction, cleanup, idempotency, retry safety, and failover behavior.
  • For shared state, document ownership, protection, lock ordering, visibility, and lifetime assumptions in the design or review notes.
  • Prefer small, scoped changes that match existing style. Do not perform unrelated refactors or broad formatting churn.
  • Before claiming completion, use .repo_context/playbooks/upkeep/ai-self-verification.md.

Behavioral guidelines to reduce common LLM coding mistakes. Merge with project-specific instructions as needed.

Tradeoff: These guidelines bias toward caution over speed. For trivial tasks, use judgment.

  1. Think Before Coding Don't assume. Don't hide confusion. Surface tradeoffs.

Before implementing:

State your 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. 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. Ask yourself: "Would a senior engineer say this is overcomplicated?" If yes, simplify.

  1. Surgical Changes Touch only what you must. Clean up only your own mess.

When editing existing code:

Don't "improve" adjacent code, comments, or formatting. Don't refactor things that aren't broken. Match existing style, even if you'd do it differently. If you notice unrelated dead code, mention it - don't delete it. When your changes create orphans:

Remove imports/variables/functions that YOUR changes made unused. Don't remove pre-existing dead code unless asked. The test: Every changed line should trace directly to the user's request.

  1. Goal-Driven Execution Define success criteria. Loop until verified.

Transform tasks into verifiable goals:

"Add validation" → "Write tests for invalid inputs, then make them pass" "Fix the bug" → "Write a test that reproduces it, then make it pass" "Refactor X" → "Ensure tests pass before and after" For multi-step tasks, state a brief plan:

  1. [Step] → verify: [check]
  2. [Step] → verify: [check]
  3. [Step] → verify: [check] Strong success criteria let you loop independently. Weak criteria ("make it work") require constant clarification.

These guidelines are working if: fewer unnecessary changes in diffs, fewer rewrites due to overcomplication, and clarifying questions come before implementation rather than after mistakes.