claude-codex-mcp-starter
CLAUDE.md39 starsChanged 9 months agoMITView on GitHub
This file provides critical guidance for Claude Code and other AI assistants when working with this codebase. NEVER DO THIS: - ❌ Forcing features to be enabled when health checks fail - ❌ Hardcoding mock data when APIs return errors - ❌ Adding try/catch blocks that swallow errors silently - ❌ Writing workarounds without understanding the problem - ❌ Assuming something is "just broken" without investigating When encountering ANY error or unexpected behavior: From: "How can I make this error…
In this repositoryOne other file it gives its agents.
- AGENTS.mdAGENTS.md
The file
Show its rules and text
We split this CLAUDE.md into the rules it gives an agent
34 rules. About 0 are common, 34 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈34
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 45
When encountering ANY error or unexpected behavior:
- Distinctive: line 54
Follow the data flow through all layers
- Distinctive: line 59
Check if services are actually running
- Distinctive: line 60
Verify network connectivity between components
- Distinctive: line 62
Test the simplest case first
- Distinctive: line 65
No bandaids, no workarounds
- Distinctive: line 67
If you can't fix it, explain why and ask for guidance
- Distinctive: line 74
Every error is valuable diagnostic information.
- Distinctive: line 79
If API returns error, find and fix the issue
- Distinctive: line 80
Check correct endpoint paths and methods
- Distinctive: line 81
NEVER replace API calls with fake data
- Distinctive: line 85
NEVER change backend to match frontend expectations
- Distinctive: line 90
Use established patterns and conventions
- Distinctive: line 91
Don't introduce new patterns without discussion
- Distinctive: line 120
New Features: Must include tests
- Distinctive: line 121
Bug Fixes: Must include regression tests
- Distinctive: line 127
Search codebase for existing functionality
- Distinctive: line 129
Write tests alongside implementation
- Distinctive: line 130
Run linting and type checking
- Distinctive: line 137
Add tests to prevent regression
- Distinctive: line 138
Document why the fix was needed
- Distinctive: line 139
Verify fix doesn't break other features
- Distinctive: line 143
Use TodoWrite tool for complex tasks:
- Distinctive: line 185
Before completing any task:
- Distinctive: line 243
If your environment supports MCP (Model Context Protocol) servers, you can leverage direct integration:
- Distinctive: line 261
When working with multiple AI models (Claude, GPT-5, Codex, etc.), establish clear roles:
- Distinctive: line 265
IMPORTANT: Always announce when collaborating with other models:
- Distinctive: line 275
Consider using multiple models for:
- Distinctive: line 305
Add project-specific rules as discovered
- Distinctive: line 307
Update patterns when they change
- Distinctive: line 309
Keep commands and configs current
- Distinctive: line 314
Follow patterns, don't create new ones
- Distinctive: line 315
Test everything you build
- Distinctive: line 316
Document why, not just what
≈ “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.
Files
CLAUDE.md - AI Assistant Project Guidelines
This file provides critical guidance for Claude Code and other AI assistants when working with this codebase.
📋 Project-Specific Configuration
[ADD YOUR PROJECT DETAILS HERE]
# Example configuration - customize for your project
project:
name: "Your Project Name"
type: "web|cli|library|service"
language: "TypeScript|Python|Go|etc"
architecture:
frontend: "React|Vue|Angular|none"
backend: "Node|Python|Go|etc"
database: "PostgreSQL|MySQL|MongoDB|etc"
paths:
source: "./src"
tests: "./tests"
docs: "./docs"
conventions:
style_guide: "link-to-style-guide"
test_framework: "jest|pytest|etc"
min_coverage: 80🛑 CRITICAL: Root Cause Analysis Required
The Junior Developer Trap
NEVER DO THIS:
- ❌ Forcing features to be enabled when health checks fail
- ❌ Hardcoding mock data when APIs return errors
- ❌ Adding try/catch blocks that swallow errors silently
- ❌ Writing workarounds without understanding the problem
- ❌ Assuming something is "just broken" without investigating
Required Approach for ALL Issues
When encountering ANY error or unexpected behavior:
- STOP AND INVESTIGATE (No code until you understand)
- What is the actual error message?
- What service/component is failing and why?
- Is this a configuration issue or a real bug?
- What does the error tell us about the system state?
- TRACE THE FULL CHAIN
- Follow the data flow through all layers
- Where exactly does it break?
- What are the actual vs expected values at each step?
- VERIFY ASSUMPTIONS
- Check if services are actually running
- Verify network connectivity between components
- Confirm configuration matches reality
- Test the simplest case first
- ONLY THEN FIX THE ROOT CAUSE
- No bandaids, no workarounds
- Fix the actual problem
- If you can't fix it, explain why and ask for guidance
The Mindset Shift
From: "How can I make this error go away?"
To: "What is this error teaching me about the system?"
Every error is valuable diagnostic information. Hiding it is like putting tape over the check engine light.
🛑 Universal Rules
1. NEVER Use Mock Data When Real Endpoints Exist
- If API returns error, find and fix the issue
- Check correct endpoint paths and methods
- NEVER replace API calls with fake data
2. Frontend Must Adapt to Backend
- Backend APIs define the contract
- NEVER change backend to match frontend expectations
- Frontend must handle what backend provides
3. Follow Existing Patterns
- Study the codebase before implementing
- Use established patterns and conventions
- Don't introduce new patterns without discussion
📁 Common Patterns to Follow
API Patterns
// Frontend example - customize for your stack
import { getApiUrl } from '@/utils/api';
import { API_PATHS } from '@/constants/apiPaths';
// NEVER hardcode paths
const url = getApiUrl(API_PATHS.RESOURCE.GET(id));# Backend example - customize for your framework
async def endpoint(
service: ServiceInterface = Depends(get_service),
current_user: User = Depends(get_current_user)
):
pass🧪 Testing Requirements
- Coverage Target: [Set your minimum, e.g., 80%]
- Test Categories: unit, integration, e2e
- Test Structure: Mirror source code structure
- New Features: Must include tests
- Bug Fixes: Must include regression tests
🛠️ Development Guidelines
When Implementing Features
- Search codebase for existing functionality
- Use established patterns and conventions
- Write tests alongside implementation
- Run linting and type checking
- Document complex logic
When Fixing Issues
- Find root cause, don't patch symptoms
- Fix all occurrences, not just reported one
- Add tests to prevent regression
- Document why the fix was needed
- Verify fix doesn't break other features
📝 Task Management
Use TodoWrite tool for complex tasks:
# Example task breakdown
todos = [
{"content": "Analyze requirements", "status": "pending"},
{"content": "Design solution", "status": "pending"},
{"content": "Implement core logic", "status": "pending"},
{"content": "Write tests", "status": "pending"},
{"content": "Update documentation", "status": "pending"}
]Rules:
- One task
in_progressat a time - Mark complete immediately when done
- Break complex tasks into steps
- Track all multi-step operations
🚀 Common Commands
# Customize these for your project
# Development
npm run dev # or: python manage.py runserver
npm run build # or: cargo build --release
npm run test # or: pytest
npm run lint # or: pylint src/
# Docker (if applicable)
docker compose up -d
docker compose logs -f [service]
docker compose down
# Version Control
git status
git diff
git log --oneline -10🎯 Quality Checklist
Before completing any task:
- Code follows project conventions
- Tests are written and passing
- Linting passes without errors
- Type checking passes (if applicable)
- Documentation is updated
- No hardcoded values or mock data
- Error handling is appropriate
- Security best practices followed
📚 Sub-Agent Strategy
For complex tasks, consider using specialized agents:
- Code Review Agent: Quality and security checks
- Debugging Agent: Complex issue investigation
- Refactoring Agent: Large-scale code updates
- Test Implementation Agent: Coverage improvements
- Documentation Agent: Comprehensive docs
⚠️ Common Mistakes to Avoid
- Creating Mock Responses
- ❌ Returning hardcoded data when API fails
- ✅ Finding and fixing the actual issue
- Ignoring Existing Patterns
- ❌ Introducing new patterns arbitrarily
- ✅ Following established conventions
- Patching Symptoms
- ❌ Quick fixes that hide problems
- ✅ Root cause analysis and proper fixes
- Skipping Tests
- ❌ "I'll add tests later"
- ✅ TDD or tests alongside implementation
- Poor Error Handling
- ❌ Swallowing exceptions silently
- ✅ Appropriate logging and user feedback
🤝 Multi-Model Collaboration
Claude Code — Built-In Capabilities
Claude Code ships with several features that are useful to know about when setting up collaboration workflows:
/init— Run/initin a project to auto-generate aCLAUDE.mdfile scoped to your codebase.- Extended thinking — For harder problems, prompt with
think,think hard, orultrathinkto engage deeper reasoning before acting. - Web search — Claude Code can search the web natively; no extra MCP server needed for basic research tasks.
- MCP management — Add, list, and remove MCP servers with
claude mcp add,claude mcp list,claude mcp remove. - Settings file — Per-project overrides live in
.claude/settings.json; global defaults in~/.claude/settings.json. - GitHub Actions — Claude Code can be triggered directly inside GitHub Actions workflows via the
claude-code-action.
MCP Server Integration (When Available)
If your environment supports MCP (Model Context Protocol) servers, you can leverage direct integration:
# Example MCP server configuration
mcp_servers:
codex:
description: "OpenAI Codex/GPT for rapid implementation"
capabilities: ["code", "test", "docs", "parallel_tasks"]
playwright:
description: "Browser automation for testing"
capabilities: ["e2e_tests", "ui_testing", "screenshots"]Note: MCP servers may not be available in all environments. Test with a simple command first to verify availability.
Working with Other AI Assistants
When working with multiple AI models (Claude, GPT-5, Codex, etc.), establish clear roles:
Collaboration Visibility Protocol
IMPORTANT: Always announce when collaborating with other models:
🤝 Working with [Model] on: [task description]
Reason: [why this model is suited for this]
Expected outcome: [what will be delivered]When to Use Multi-Model Collaboration
Consider using multiple models for:
- Test Generation - Comprehensive test suites after features
- Parallel Implementation - Multiple independent components
- Boilerplate Code - CRUD operations, standard patterns
- Code Transformation - Format conversions, migrations
- Documentation - API docs, inline docs, README updates
Task Assignment by Strength
Primary Assistant (Claude Code) handles:
- Architecture design and planning
- Complex reasoning and debugging
- Security analysis and review
- Code refactoring strategies
- Understanding legacy code
- Root cause analysis
Delegate to specialized tools/models:
- Rapid parallel implementation
- Test suite generation
- API documentation
- Boilerplate and CRUD
- Code format conversions
- Repetitive updates across files
🔄 Continuous Improvement
This document should evolve with your project:
- Add project-specific rules as discovered
- Document architectural decisions
- Update patterns when they change
- Record lessons learned from issues
- Keep commands and configs current
Remember
- Understand before implementing
- Follow patterns, don't create new ones
- Test everything you build
- Document why, not just what
- Collaborate transparently
Customize this template for your specific project needs
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
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.

