A single-prompt bootstrap for setting up a Claude Code environment in any project. Works on greenfield (empty directory) and brownfield (existing codebase) the same way: it creates what is missing and leaves the rest alone.
The prompt is also appendable. Paste it together with a build prompt (for example, "build me a Next.js marketing site for X") and Claude will set up the environment, build the project, then finalize the project documentation in one pass.
- Open
claude-bootstrap-prompt.mdand copy its full contents. - Paste into a fresh Claude Code session running in the project directory.
- Optional: append your build instructions below the
## PROJECT BUILD INSTRUCTIONSmarker at the bottom of the prompt before sending. - Send.
That is the whole workflow.
When run, it produces (or merges into existing files):
<project root>/
CLAUDE.md routing index, hard rules, agent table
AGENTS.md mirror of CLAUDE.md for non-Claude tools
.gitignore sensible defaults for Node-style projects
.claude/
settings.json permissions allowlist, denied destructive ops
agents/
planner.md
implementer.md
reviewer.md
researcher.md
debugger.md
learner.md
commands/
learn.md the /learn slash command
.docs/
plans/ implementation plans, one per task
learnings/ append-only lessons from past sessions
rules/ hard rules, more granular than CLAUDE.md
research/ findings from the researcher agent
| Agent | Role |
|---|---|
planner |
Writes a plan to .docs/plans/ before any non-trivial change. |
implementer |
Executes a plan. Reads rules and learnings first. |
reviewer |
Audits completed work against plan and rules. Severity-tagged findings. |
researcher |
Gathers internal or external context. Writes notes to .docs/research/. |
debugger |
Reproduces, isolates, identifies root cause, proposes fix. |
learner |
Distills lessons into .docs/learnings/. Edits agents and CLAUDE.md to fix instruction flaws. |
The full agent definitions live inside the prompt itself.
The bootstrapped project gets smarter over time through two triggers:
- Convention.
CLAUDE.mdinstructs the main agent to invoke thelearnerafter any non-trivial task. Natural-language requests like "learn from that" or "remember this" route to the learner. - Slash command.
/learninvokes the learner manually for mid-session reflection.
The learner has permission (via committed .claude/settings.json) to edit .claude/agents/, .docs/, and CLAUDE.md without prompting. When it edits an agent, it must update the agent table and routing heuristics in CLAUDE.md and AGENTS.md in the same change.
The bootstrap commits an opinionated permissions allowlist to .claude/settings.json:
- Auto-allow: agent self-editing, doc writes, slash command writes, standard dev Bash (
pnpm,npm,git status,git add,git commit, etc). - Auto-deny: destructive ops (
rm -rf /*,git push --force,git reset --hard).
These are committed, not local, so the same setup is portable across machines.
- No emojis or em dashes in generated prose, commit messages, or PR bodies.
- No AI co-author trailers on commits. The user is sole author by default.
- No "Generated with Claude Code" footers in commits or PRs.
- Agent file changes always update the agent table and routing in
CLAUDE.mdandAGENTS.mdin the same turn. Out of sync is a blocker finding.
This repo is the maintenance environment for the prompt itself. The current version is always at the root: claude-bootstrap-prompt.md. Past versions are archived in old-versions/ as claude-bootstrap-prompt-v<N>.md where N increments on every change.
The full versioning workflow is in CLAUDE.md. Short version: archive first, edit second, never edit the root file without copying it to the next version slot.
Pre-1.0. Iterating. The learner-driven self-improvement loop has not yet had time to refine the agents through real use, so expect rough edges. Feedback welcome.