How to Set Up Dev Environments Instantly with Claude Code
New PC or new project, Claude Code handles dev environment setup in minutes. Node.js, Docker, lint configs, CI/CD — all automated.
Ever spent half a day setting up a dev environment on a new PC or for a new project? With Claude Code, it takes minutes.
1. Scaffold a New Project
Stand up a project from zero.
mkdir my-app && cd my-app
claude -p "
Set up a Next.js 15 + TypeScript + Tailwind CSS + Prisma + PostgreSQL project.
Include:
- ESLint + Prettier config
- Vitest setup
- Docker Compose (PostgreSQL)
- .env.example
- GitHub Actions CI
- CLAUDE.md
Run npm install when done.
"
In 5 minutes you get a best-practice project ready to go.
2. Bootstrap an Existing Repo
After cloning a team repo, automate the setup.
git clone https://github.com/team/project.git
cd project
claude -p "
Set up the dev environment for this project.
Read README.md and package.json, then:
- Install dependencies
- Set up env vars (.env.example -> .env)
- Set up the database
- Run migrations
- Start the dev server to verify
If errors occur, fix them automatically.
"
It reads the README, parses package.json, runs commands in order, and auto-fixes errors along the way.
3. Docker Environment
Docker Compose config in one shot.
claude -p "
Create a docker-compose.yml with:
- PostgreSQL 16 (port 5432)
- Redis 7 (port 6379)
- MinIO S3-compatible (ports 9000/9001)
Include health checks, volume persistence, and .env variable loading.
Run docker compose up -d.
"
4. Editor Config Standardization
Align everyone’s editor settings.
claude -p "
Create VS Code config files:
.vscode/settings.json:
- Auto-format on save with Prettier
- TypeScript strict mode
- Auto-sort imports
.vscode/extensions.json:
- Recommended extensions for the team
.editorconfig:
- 2-space indent
- Trim trailing whitespace
- Final newline
"
Commit to Git and every team member works with the same settings. See Team Collaboration Guide.
5. CI/CD Pipeline
Auto-generate GitHub Actions.
claude -p "
Create a GitHub Actions workflow for this project:
- On push: lint -> typecheck -> test -> build
- On PR: above + coverage report
- On main merge: above + deploy to Cloudflare Pages
"
See CI/CD Setup Guide.
6. Environment Variable Management
Keep .env.example in sync automatically.
claude -p "
Scan all files for process.env.XXX references.
Output a complete .env.example with dummy values.
If .env.example exists, only add missing vars.
"
Never forget to update .env.example when adding new env vars.
7. Record Setup Steps in CLAUDE.md
Save the setup procedure so it auto-replays for new members.
claude -p "
Add a '## Environment Setup' section to CLAUDE.md.
Document every step from clone to running dev server.
"
Next time someone joins, Claude Code reads CLAUDE.md and sets up automatically. See CLAUDE.md Best Practices.
Gotchas
Node.js Version Management
Use .nvmrc or .node-version — Claude Code auto-detects them.
Docker Permission Issues
On Linux/WSL, permission errors are common. Just tell Claude Code “fix this Docker error.”
Apple Silicon vs Intel
Build behavior differs. Note it in CLAUDE.md and Claude Code adapts.
Conclusion
- New project scaffolding in 5 minutes
- Existing project setup automated (including error recovery)
- Docker, editor, CI/CD configs generated in one shot
- Env var management with zero drift
- CLAUDE.md preserves setup steps for the team
Dev environment setup has moved from “manual labor” to “ask Claude Code.” See the Anthropic Claude Code docs.
Level up your Claude Code workflow
50 battle-tested prompt templates you can copy-paste into Claude Code right now.
Free PDF: Claude Code Cheatsheet in 5 Minutes
Just enter your email and we'll send you the single-page A4 cheatsheet right away.
We handle your data with care and never send spam.
About the Author
Masa
Engineer obsessed with Claude Code. Runs claudecode-lab.com, a 10-language tech media with 2,000+ pages.
Related Posts
How to Slash New Engineer Onboarding Time with Claude Code
Turn a 3-month ramp-up into 2 weeks. Use Claude Code as the new hire's copilot for codebase, environment, and first PR.
How to Visualize and Systematically Reduce Tech Debt with Claude Code
Unpaid tech debt drains engineering velocity. Learn how to surface, prioritize, and repay it incrementally using Claude Code.
How to Speed Up REST API Design with Claude Code
From endpoint design to OpenAPI specs, validation, error handling, and tests. Use Claude Code as your API design partner for end-to-end acceleration.