Back to Library
Project ContextIntermediate

Provide a Repo Map for Large Codebases

When your codebase is too large to paste, generate a file tree and include it as context so Claude understands your project structure.

repo-mapfile-treearchitecture

The Strategy

Without structural context, Claude defaults to generic patterns. A repo map grounds its suggestions in your actual conventions, making recommendations actionable and idiomatic.

prompt.txt
<context>
<repo_map>
src/
├── app/                    # Next.js App Router pages
│   ├── api/               # Route handlers
│   ├── (auth)/            # Auth-related pages (grouped route)
│   └── dashboard/         # Dashboard feature
├── components/
│   ├── ui/                # Generic UI primitives
│   └── features/          # Feature-specific components
├── lib/
│   ├── db.ts              # Prisma client singleton
│   └── auth.ts            # NextAuth configuration
└── types/
    └── index.ts           # Shared TypeScript types
</repo_map>
</context>

<task>
Given this structure, where should I put a new
"NotificationService" class that sends emails?
</task>

You might also need