Getting startedGuide 4 of 12
Getting started with Claude Code in a repository
A checklist for setting up the project's instructions, permissions, and integrations, and for deciding which configuration to version.
Updated 3 min read
The first 30 minutes with Claude Code in a new repo shape how it’s going to work for the rest of the project. It’s worth following this list in order, because some steps depend on earlier ones; others can be done in parallel. Each item links to the article that explains it in detail.
- Run
/initso Claude analyzes the repo and generates an initialCLAUDE.md(Memory and context). Don’t leave it as-is: it’s a starting point, not a finished product. - Prune that
CLAUDE.mddown to the essentials. Cut everything Claude would already know on its own and keep only the exact commands, your own conventions, and the project’s traps. Aim to stay under ~200 lines (Memory and context). - Separate the personal from the shared. Your own preferences (not the team’s) go in
CLAUDE.local.md, and that file goes in.gitignorebefore the first commit. - Choose the starting permission mode. In a repo you don’t know yet, start in
default(orplanif you’re going to do a big exploration before touching anything). Move up toacceptEditsonly once you trust what it’s doing (Permissions in Claude Code). - Write the non-negotiable
denyrules before writing a single line of code: at minimum,.env, credentials, and any sensitive infrastructure folder (Read(./.env),Edit(/src/db/migrations/**), etc.) (Permissions in Claude Code). - Decide your MCP policy. Which servers does this particular project need? Which go in
--scope projectso the whole team uses them, and which stay in--scope localbecause they’re experimental or yours? (MCP). - Add the minimum-hygiene hooks, if the project already has a linter/formatter: a
PostToolUsethat runsprettier/eslint --fixafter everyEdit/Writesaves you from asking for it by hand in every prompt (Skills, subagents, and hooks). - Run
/security-reviewonce, even if the project already exists. It gives you an initial snapshot of which vulnerabilities were already there before Claude Code touched a single line — useful for not later attributing to it something that predated it (Security when working with Claude Code). - Set the project’s default model if your team has a preference (for example, Sonnet for everything except a security review subagent on Opus) (Essential commands and shortcuts).
- Commit the shared configuration (
CLAUDE.md,.mcp.json,.claude/settings.json,.claude/rules/) so the rest of the team starts with the same behavior — and so it’s in the history if something has to be reverted.
If the project is large enough that “what does done mean” isn’t obvious at a glance, this is also the moment to evaluate whether it’s worth adding Spec-Driven Development before the first big feature, rather than after the third.