| name | project-init |
|---|---|
| description | Bootstrap Claude's harness for a project or set of repositories — clone them, map them with parallel subagents, then generate only the verified, high-leverage assets (CLAUDE.md, skills, agents, permissions, MCP config, memory). Use when starting work on a new/unfamiliar repo or when the user says "init", "bootstrap", or "set up Claude for this project". |
Arguments: $ARGUMENTS — zero or more git URLs/paths. If empty, operate on the
current directory.
- Context is the scarce resource. Never read broadly yourself. All
exploration goes through subagents (default
model: haiku) that return conclusions, not file contents. You only Read a file directly when you already know its exact path and need its contents verbatim. - Every artifact must earn its context cost. CLAUDE.md and skill descriptions are loaded into every future session. A wrong or bloated artifact is worse than none. Write only what is durable, non-derivable, and verified.
- Verify before documenting. Never write a command into CLAUDE.md or a skill unless you ran it (or a dry-run of it) and it worked. Subagents don't commit and their DONE is not proof — spot-check their claims.
- Default to fewer artifacts. Built-in agents and skills cover most needs. Create a custom one only when the recon shows a repeated, project-specific workflow that built-ins handle badly.
- Parse
$ARGUMENTS. For each git URL,git cloneit into the current directory (shallow--depth 50is fine; full history isn't needed for bootstrap). Local paths are used in place. - Multiple repos → treat the current directory as a workspace root: one
shared
CLAUDE.mdat the root with per-repo sections, plus per-repoCLAUDE.mdonly if a repo has substantial unique conventions. - Note anything already present: existing
CLAUDE.md,.claude/,.mcp.json,AGENTS.md,.cursorrules,CONTRIBUTING.md. Existing assets are inputs to update, never blindly overwrite — diff intent, preserve what's still true.
Dispatch in a single message (they're independent) one Explore agent
per concern, per repo. model: haiku, breadth "medium" unless the repo is
large. Each prompt must demand a distilled bullet answer with file paths,
and explicitly forbid pasting file contents.
| Agent | Question it answers |
|---|---|
| Toolchain | Languages, package manager, exact build / test / lint / format / run commands (from manifests, Makefile/Justfile, CI config), required env vars / secrets locations, dev-server ports |
| Architecture | Entry points, top-level layout, the 5–10 directories that matter, data flow in two sentences, where config lives |
| Conventions | Test layout & naming, CI gates that must pass, commit/PR conventions, codegen or generated dirs that must not be hand-edited, existing docs worth pointing at |
| Integrations | External services the code actually talks to (DBs, k8s, cloud, observability, APIs) — with evidence (client libs, connection strings, deploy manifests) |
For >2 repos, run one combined recon agent per repo instead (all four questions in one prompt) to cap fan-out.
While agents run, do nothing else — wait, then cross-check: if two agents disagree (e.g., different test commands), resolve by reading the specific file they cite, not by re-exploring.
Write/update CLAUDE.md at the project root. Hard budget: ~60 lines.
It is loaded every session — every line is a permanent tax.
Include, in this order:
- One-paragraph purpose + architecture (pointers to dirs, not prose tours).
- Verified commands: build, test (whole suite + single test), lint, run. Verbatim, copy-pasteable. Run each one first; mark any that need missing credentials/services as such instead of guessing.
- Gotchas only: generated dirs, ordering constraints ("regenerate X before
committing"), env quirks. No style guides the linter already enforces,
no restating what
lsreveals.
Exclude: file trees, dependency lists, anything derivable in one glance.
- Build a
permissions.allowlist in.claude/settings.jsonfrom the verified commands: the read-only and build/test/lint invocations Claude will run constantly (e.g.Bash(just test:*),Bash(cargo check:*)). Never allowlist anything that writes outside the repo, pushes, deploys, or deletes. - Hooks: add only if recon found a mechanical invariant, e.g. a formatter
that CI enforces →
PostToolUsehook running it on edited files. If in doubt, skip — the user can ask later. (Complex settings edits: use theupdate-configskill if available rather than hand-editing.)
Create .claude/skills/<name>/SKILL.md only for workflows that are
multi-step, repeated, and verified. Typical earners:
run/deploy— if launching the app takes more than one obvious command.test-one— if running a single test needs non-obvious flags.- Domain pipelines recon uncovered (codegen, migrations, release).
Rules: ≤50 lines each; exact commands you ran successfully; a one-line
description that makes the trigger obvious (it's what future sessions see).
Don't create skills that wrap a single command already in CLAUDE.md.
Default: none — built-in Explore/Plan/general-purpose suffice. Create
.claude/agents/<name>.md only when recon shows a recurring role needing
baked-in project knowledge (e.g. a reviewer that must know a protocol spec's
location, a migration-writer that must follow a template). Frontmatter:
name, description (when to use), tools (minimum set), model: haiku
unless the role needs deeper reasoning.
Only if Phase 1 Integrations found live external services and an MCP
server materially beats CLI access (structured queries vs. shelling out):
add entries to project .mcp.json with env-var placeholders — never
inline secrets. Otherwise document the CLI path in CLAUDE.md and move on.
List candidates to the user; don't install speculatively.
Save to auto-memory (if available this session) only facts that are non-obvious and don't belong in the repo: environment quirks of this machine, where credentials live, tribal knowledge the user stated. Never duplicate CLAUDE.md content into memory — memory is for what the repo can't record.
- Re-run the headline commands from CLAUDE.md one last time from a clean shell state. Fix or annotate anything that fails.
- If anything in
.claude/was created, confirm valid syntax (JSON parses, skill frontmatter well-formed). - Final message to the user — lead with the outcome, then:
- Assets created/updated (paths) and why each earned its place.
- Verified command table (command → result).
- What was deliberately not created, in one line (e.g. "no custom agents — built-ins cover this repo").
- Open questions that need the user (missing creds, ambiguous deploy target) — as a short list at the end, never blocking mid-run.
- No speculative "flexibility": no config options, agent roles, or skills for workflows nobody has needed yet.
- No 200-line CLAUDE.md. If you wrote one, cut it to 60.
- No exploring with your own Read/Grep across many files — that's what the fan-out is for.
- No committing. Leave changes in the working tree for the user to review.