Stop fighting your AI agent — give it the right project structure.
A production-ready project scaffold for Claude Code agents. Drop these files into any repo and Claude instantly understands your architecture, conventions, and task flow.
Claude Code is powerful, but without structure it:
- Asks the same questions every conversation
- Ignores your conventions after context window rotates
- Writes code that doesn't match your patterns
- Can't prioritize or track complex multi-step work
claude-scaffold solves this with a minimal file structure that gives Claude persistent, actionable context.
# Fork this repo, then:
git clone https://github.com/YOUR_USERNAME/claude-scaffold.git my-project
cd my-project
# Edit CLAUDE.md and .agents/ files for your project# From your project root:
curl -sL https://github.com/gkosach/claude-scaffold/archive/main.tar.gz | tar xz --strip=1 -C .
# Edit CLAUDE.md and .agents/ files for your projectCopy these files into your project root:
CLAUDE.md
.agents/
EXAMPLE.md
CONVENTIONS.md
TESTING.md
docs/
TASKS.md
Then customize each file. Every file has TODO: markers where you fill in your project details.
your-project/
CLAUDE.md # Entry point. Claude reads this FIRST every conversation.
| # Project overview + agent rules + pointers to .agents/
|
.agents/ # Domain context files. Claude reads these based on task.
| EXAMPLE.md # Template: copy & rename per domain area
| CONVENTIONS.md # Runtime code rules: error handling, async, DB, types
| TESTING.md # Test philosophy & patterns (read when writing tests)
|
docs/
TASKS.md # Jira-style task breakdown with dependencies & blockers
Claude Code automatically reads CLAUDE.md at the start of every conversation. This file should contain:
- Project identity: what this is, what stack it uses (2-3 lines)
- Agent rules: how Claude should behave in THIS project
- Pointers: where to find deeper context (
.agents/,docs/)
# Project: my-app
E-commerce platform. Next.js 14, tRPC, Prisma, PostgreSQL, Redis.
# Rules for AI agents:
- use English for code and comments
- follow existing patterns, don't invent new ones
- ...
## Next steps
- .agents/ — domain context per area
- docs/TASKS.md — current task breakdownKeep it under 100 lines. Claude reads this every time — make it count.
Each file describes one area of your system. Claude reads the relevant file based on the task at hand. This is where you put the details that would be too much for CLAUDE.md.
Name files by domain, not by role:
BACKEND.md— API layer, DB patterns, authFRONTEND.md— component structure, state managementINFRASTRUCTURE.md— deployment, Docker, env varsCONVENTIONS.md— code style rules Claude must followTESTING.md— test patterns and anti-patterns
Good .agents/ file = things Claude can't derive from reading code:
- WHY you chose this pattern (not just what the pattern is)
- Traps and gotchas specific to your codebase
- Cross-cutting concerns (auth flow, error hierarchy, data flow)
- Performance constraints and SLAs
Jira-style task breakdown that Claude can read and track:
- Epics and tasks with IDs (
INFRA-001,AUTH-002) - Dependencies and blockers (
blocked by: INFRA-001) - Priority levels (
[P0]critical path,[P1]high,[P2]medium) - Phases with clear ordering
This prevents Claude from trying to do everything at once and gives it a roadmap.
- Be specific: "use
pinofor logging, JSON format, correlation IDs" > "use structured logging" - Explain WHY: "no ORMs — we need raw SQL for ClickHouse MergeTree optimizations" > "don't use ORMs"
- Include examples: one code snippet is worth 50 words of explanation
- Update regularly: stale context is worse than no context
- Keep CLAUDE.md short: it's read every conversation, so every line must earn its place
- Don't duplicate code: conventions should describe patterns, not copy-paste implementation
- Don't describe file contents: Claude can read files — describe what's NOT obvious from reading
- Don't over-constrain: rules like "never use ternary operators" waste context on style preferences your linter handles
- Don't put secrets: these files are committed to git
See the headless project for a full real-world implementation:
- Complex multi-service architecture (Orchestrator, Browser Pool, Data Pipeline)
- 41 tasks across 8 phases with dependency graph
- Domain-specific agent files (BROWSER.md, DATA.md, INFRASTRUCTURE.md)
- Comprehensive code conventions
Works with:
- Claude Code CLI — reads CLAUDE.md automatically
- Claude Code in VS Code / JetBrains — same behavior
- Any AI agent that supports project-level context files
The .agents/ pattern is a convention, not a framework. No dependencies, no tooling, no lock-in.
PRs welcome. If you've found patterns that make Claude more effective, share them.
MIT — use it everywhere, fork it freely.