AI Dev Environment Setup: Tools, Configs, and Dotfiles for 2026
Set up the ultimate AI development environment with Claude Code, Cursor, terminal configs, and dotfiles. Complete guide with templates, shell aliases, and workflow tips.
AI DevelopmentDeveloper SetupClaude CodeWorkflow
4033 Words
2026-03-10 06:00 +0000

Your AI tools are only as good as your setup. Most developers install Claude Code or Cursor, use the defaults, and wonder why the output feels generic. The difference between mediocre AI assistance and genuinely transformative productivity is configuration — the dotfiles, templates, shell aliases, and workflow patterns that turn general-purpose AI into a tool that understands your codebase and your conventions.
This guide walks through the complete AI development environment I use daily. By the end, you will have a production-ready setup that combines multiple AI tools into a coherent workflow, with copy-paste configuration files you can adapt to your own projects.
The Modern AI Development Stack
Before diving into installation steps, let’s establish the architecture. An effective AI dev environment in 2026 is not a single tool — it’s a stack of complementary tools, each handling what it does best.
Here’s the stack:
| Layer | Tool | Role |
|---|---|---|
| Planning & Reasoning | Claude Code | Architecture decisions, complex debugging, multi-file refactoring |
| Daily Implementation | Cursor | Writing code, inline edits, quick iterations |
| Terminal Multiplexing | tmux / Zellij | Parallel sessions, persistent workspaces |
| Version Control | Git + AI workflows | AI-friendly commits, branch strategies |
| External Services | MCP Servers | Connect AI to databases, docs, APIs |
| Automation | Hooks & Scripts | Deterministic rules that override AI behavior |
The key insight: Claude Code excels at thinking, Cursor excels at typing. Use Claude Code when you need the AI to understand a complex problem, evaluate tradeoffs, or plan a multi-step change. Switch to Cursor when you know what needs to be written and want fast, fluid implementation.
This is the same multi-tool strategy covered in our Claude Code vs Cursor comparison, but here we focus on the practical setup rather than the conceptual differences.
Essential Tool Setup
Claude Code: Your AI Reasoning Engine
Claude Code is Anthropic’s terminal-based AI coding agent. Unlike IDE plugins that suggest code snippets, Claude Code operates as an autonomous agent — it reads your entire codebase, plans multi-step changes, executes shell commands, and iterates until the task is done.
For a deep dive into all Claude Code features, see the Complete Claude Code Guide.
Installation
# Install via the native installer (recommended)
curl -fsSL https://cli.claude.ai/install.sh | sh
# Or via npm (if you prefer package management)
npm install -g @anthropic-ai/claude-code
# Verify installation
claude --version
After installation, authenticate:
# Start Claude Code and follow the auth prompts
claude
# Or authenticate directly
claude auth login
The CLAUDE.md Configuration File
This is the single most impactful configuration you can create. A CLAUDE.md file in your project root tells Claude Code about your project — coding conventions, directory structure, common commands, and things to watch out for.
Here is a production-ready template:
# CLAUDE.md
## Project Overview
- **Stack**: Node.js / TypeScript / PostgreSQL / React
- **Architecture**: Monorepo with packages/ directory
- **Node version**: 22 (use nvm)
## Common Commands
```bash
# Development
npm run dev # Start dev server (port 3000)
npm run test # Run test suite
npm run test:watch # Run tests in watch mode
npm run lint # ESLint + Prettier check
npm run typecheck # TypeScript compilation check
# Database
npm run db:migrate # Run pending migrations
npm run db:seed # Seed development data
npm run db:reset # Reset and re-seed database
```
## Code Conventions
- Use functional components with hooks (no class components)
- All API routes go in `src/routes/` following REST conventions
- Database queries use the repository pattern in `src/repositories/`
- Error handling: always use AppError class from `src/utils/errors.ts`
- Tests: colocate test files next to source (e.g., `user.service.test.ts`)
## Important Rules
- NEVER modify files in `src/generated/` — these are auto-generated
- Always run `npm run typecheck` before committing
- Database migrations must be reversible
- API responses must follow the format in `src/utils/response.ts`
## Architecture Notes
- Auth: JWT tokens with refresh rotation
- File uploads: S3 via presigned URLs (never store locally)
- Background jobs: BullMQ with Redis
- Caching: Redis with 5-minute TTL for API responses
For an exhaustive guide to writing effective CLAUDE.md files, see The Complete CLAUDE.md Guide.
Key principles for your CLAUDE.md:
- Be specific about commands — Claude Code will run these, so they must be accurate
- State what NOT to do — negative constraints prevent common AI mistakes
- Include architecture context — the AI needs to understand why your code is structured this way, not just how
- Keep it updated — a stale CLAUDE.md is worse than none at all
MCP Server Configuration
MCP (Model Context Protocol) servers extend Claude Code’s capabilities beyond your local filesystem. They let the AI interact with databases, documentation services, browser automation tools, and more.
Your MCP configuration lives in ~/.claude/mcp.json (global) or .claude/mcp.json (per-project):
{
"mcpServers": {
"context7": {
"command": "npx",
"args": ["-y", "@context7/mcp-server"],
"description": "Library documentation lookup"
},
"postgres": {
"command": "npx",
"args": ["-y", "@anthropic/mcp-postgres"],
"env": {
"DATABASE_URL": "postgresql://user:pass@localhost:5432/mydb"
},
"description": "Direct database access"
},
"playwright": {
"command": "npx",
"args": ["-y", "@anthropic/mcp-playwright"],
"description": "Browser automation for testing"
}
}
}
For a complete MCP setup walkthrough with 10+ server configurations, see Claude Code MCP Server Setup Guide.
My recommended MCP stack:
- Context7 — Real-time library documentation (no more hallucinated APIs)
- PostgreSQL/MySQL — Let Claude Code query your database directly during debugging
- Playwright — Browser automation for end-to-end testing
- Sentry — Pull error reports directly into your AI context
Hooks: Deterministic Automation
Hooks let you define rules that run automatically before or after Claude Code actions. Unlike prompts (which the AI might ignore), hooks are deterministic — they always execute.
Create .claude/hooks.json in your project:
{
"hooks": {
"preCommit": {
"command": "npm run lint && npm run typecheck",
"description": "Run lint and type checks before any commit"
},
"postFileEdit": {
"pattern": "*.test.ts",
"command": "npm run test -- --related",
"description": "Run related tests after editing test files"
}
}
}
For the full hooks reference, see Claude Code Hooks Guide.
Cursor: Your AI Implementation Engine
While Claude Code thinks deeply, Cursor types fast. It is your IDE for the actual writing — inline completions, agent mode for larger changes, and a chat panel for quick questions.
Key Settings
Open Cursor Settings (Cmd+, on macOS) and configure:
{
"cursor.agent.model": "claude-sonnet-4-20250514",
"cursor.autocomplete.enabled": true,
"cursor.chat.defaultModel": "claude-sonnet-4-20250514",
"editor.fontSize": 14,
"editor.minimap.enabled": false,
"terminal.integrated.fontSize": 13
}
Model selection tip: Use Claude Sonnet for most agent tasks (fast and capable). Switch to Claude Opus for complex architectural decisions or when you need the highest reasoning quality.
The .cursorrules File
Similar to CLAUDE.md, a .cursorrules file in your project root configures Cursor’s behavior:
You are an expert TypeScript/React developer working on a production application.
## Code Style
- Use TypeScript strict mode
- Prefer named exports over default exports
- Use Zod for runtime validation
- Use React Query for server state management
## Project Structure
- Components: src/components/{feature}/{ComponentName}.tsx
- Hooks: src/hooks/use{HookName}.ts
- API routes: src/routes/{resource}.routes.ts
## Rules
- Never use `any` type — use `unknown` and narrow
- All API responses go through the response utility
- Components must have displayName for debugging
- Prefer composition over inheritance
Agent Mode Workflow
Cursor’s agent mode (Cmd+I or the Composer panel) is where it shines for implementation:
- Select the relevant files in the Composer context
- Describe the change you want
- Review the diff before accepting
- Run tests to verify
Pro tip: After planning a feature with Claude Code, paste the plan into Cursor’s agent mode. Claude Code’s detailed plans translate directly into high-quality Cursor implementations.
Terminal Setup: The Glue Layer
Your terminal is where Claude Code lives, so optimizing it pays dividends.
tmux / Zellij Configuration
Use a terminal multiplexer to maintain persistent AI sessions:
# ~/.tmux.conf — AI development layout
# Prefix key
set -g prefix C-a
unbind C-b
# Create AI development layout
# Pane 0: Claude Code session
# Pane 1: Running dev server
# Pane 2: Git operations
bind-key A split-window -h \; \
split-window -v \; \
select-pane -t 0 \; \
send-keys 'claude' C-m \; \
select-pane -t 1 \; \
send-keys 'npm run dev' C-m \; \
select-pane -t 2
# Increase scrollback for AI output
set -g history-limit 50000
# Better copy mode for copying AI responses
setw -g mode-keys vi
If you prefer a more modern alternative, Zellij offers a similar experience with a friendlier configuration format:
// ~/.config/zellij/layouts/ai-dev.kdl
layout {
pane split_direction="vertical" {
pane size="60%" {
command "claude"
name "AI Agent"
}
pane split_direction="horizontal" {
pane {
command "npm"
args "run" "dev"
name "Dev Server"
}
pane {
name "Git / Shell"
}
}
}
}
Shell Aliases for AI Tools
Add these to your ~/.zshrc or ~/.bashrc:
# ===== AI Development Aliases =====
# Claude Code shortcuts
alias cc="claude"
alias ccc="claude --continue" # Continue last conversation
alias ccr="claude --resume" # Resume a specific session
alias ccp="claude --print" # One-shot mode (no interactive)
alias ccm="claude --model opus" # Use Opus for complex tasks
alias ccs="claude --model sonnet" # Use Sonnet for quick tasks
# Quick Claude Code tasks
alias ccplan="claude 'Read the codebase and create an implementation plan for:'"
alias cctest="claude 'Write comprehensive tests for the changes in the last commit'"
alias ccreview="claude 'Review the code changes in the current branch and suggest improvements'"
alias ccfix="claude 'Fix the failing tests and lint errors'"
alias ccdoc="claude 'Generate documentation for the public API in this project'"
# Git + AI workflows
alias gaic="claude 'Create a well-formatted commit message for the staged changes and commit them'"
alias gapr="claude 'Create a pull request with a detailed description for the current branch'"
# Project initialization
alias ainit="cp ~/.dotfiles/templates/CLAUDE.md . && cp ~/.dotfiles/templates/.cursorrules . && echo 'AI config files created'"
# Cost-conscious aliases
alias ccheap="claude --model haiku" # Use Haiku for simple tasks
Claude Code Terminal Integration
Claude Code runs in any terminal, including Cursor’s integrated terminal. This is the foundation of the multi-tool workflow:
- Open Cursor with your project
- Open the integrated terminal (
Ctrl+`) - Run
claudein the terminal - Now you have Claude Code (planning) and Cursor (implementation) side by side
This setup means you never leave your editor. Claude Code’s reasoning appears in the terminal pane while Cursor handles file edits in the editor pane.
Git: AI-Friendly Commit Workflows
AI-generated code needs disciplined version control. Here are the Git configurations that work best:
# ~/.gitconfig additions for AI development
[alias]
# AI-assisted commit: stage all, let AI write the message
aic = "!f() { git add -A && claude --print 'Write a concise commit message for these changes. Follow conventional commits format.' | git commit -F -; }; f"
# Review AI changes before committing
air = "!f() { git diff --staged | claude --print 'Review this diff. Are there any issues, bugs, or improvements?'; }; f"
# Create a detailed branch description
aib = "!f() { git log main..HEAD --oneline | claude --print 'Summarize what this branch does based on the commit history'; }; f"
[commit]
# Useful template for AI-assisted development
template = ~/.gitmessage
[diff]
# Better diff algorithm for AI-generated code
algorithm = histogram
Create a commit message template at ~/.gitmessage:
# <type>(<scope>): <description>
#
# Types: feat, fix, refactor, test, docs, chore, perf
# Scope: optional, the module or area affected
#
# Body: explain WHY, not WHAT (the diff shows WHAT)
#
# Footer: BREAKING CHANGE, Closes #issue
#
# AI-assisted: note which parts were AI-generated
Branch strategy for AI development:
main— production, protectedfeature/*— AI-assisted feature branches- Always create a new branch before starting an AI coding session
- Commit frequently — AI agents make many file changes, and small commits make rollbacks easier
The Multi-Tool Strategy
When to Use Which Tool
This decision matrix saves time every day:
| Task | Best Tool | Why |
|---|---|---|
| Understand unfamiliar codebase | Claude Code | Large context window, deep reasoning |
| Plan a new feature | Claude Code | Structured thinking, architecture awareness |
| Write implementation code | Cursor | Fast completions, inline edits |
| Debug a complex issue | Claude Code | Can read logs, run commands, trace across files |
| Quick code changes | Cursor | Inline edit mode is faster |
| Write tests | Claude Code | Better at comprehensive edge cases |
| Code review | Claude Code | Deeper analysis, security awareness |
| Refactor across files | Claude Code | Agentic loop handles multi-file changes |
| Fix a single function | Cursor | Inline agent mode, instant feedback |
| Write documentation | Claude Code | Better at structured, comprehensive docs |
Claude Code for Planning + Cursor for Implementation
This is the workflow that delivers the best results consistently:
Step 1: Plan with Claude Code
You: I need to add a rate limiting system to our API.
We use Express.js with Redis.
Claude Code: [reads codebase, analyzes middleware chain,
proposes architecture with sliding window algorithm,
identifies all routes that need protection,
suggests database schema for rate limit tracking]
Step 2: Implement with Cursor
Take Claude Code’s plan and feed it to Cursor’s agent mode:
Implement the rate limiting system based on this plan:
[paste Claude Code's architecture plan]
Start with the Redis rate limiter middleware.
Cursor will generate the code files, and you review each diff before accepting.
Step 3: Test with Claude Code
You: Write tests for the rate limiting middleware we just added.
Cover edge cases: expired windows, concurrent requests,
Redis connection failures.
Claude Code’s reasoning ability produces more thorough test suites than autocomplete-based tools.
The $40/Month Sweet Spot
You do not need to spend hundreds on AI tools. Here is the cost-effective setup:
| Tool | Plan | Monthly Cost | What You Get |
|---|---|---|---|
| Claude Code | Max (5x) | $20 | Deep reasoning, complex tasks |
| Cursor | Pro | $20 | Fast implementation, autocomplete |
| Total | $40 | Complete AI dev stack |
For a detailed pricing breakdown of Claude Code plans, see Claude Code Pricing Guide.
Cost optimization tips:
- Use Claude Code’s Sonnet model for routine tasks (cheaper than Opus)
- Reserve Opus for architecture decisions and complex debugging
- Use Cursor’s autocomplete for simple completions (uses fewer credits than agent mode)
- Close Claude Code sessions when not actively using them to avoid idle token consumption
- Use
--printmode for one-shot queries instead of interactive sessions
Configuration Files You Need
Here is every configuration file in the setup, organized for easy copy-pasting.
CLAUDE.md Template
The template above covers most projects. Here are additional sections for specific stacks:
For Python projects:
## Python Environment
- Python 3.12+ via pyenv
- Package manager: uv (not pip)
- Virtual environment: `.venv/` (auto-created by uv)
## Commands
```bash
uv run pytest # Run tests
uv run ruff check . # Lint
uv run mypy src/ # Type check
uv run python -m src.main # Run application
```
## Style
- Type hints required on all function signatures
- Use Pydantic v2 for data validation
- Async functions for all I/O operations
- Docstrings in Google format
For Go projects:
## Go Environment
- Go 1.23+
- Module: github.com/yourorg/yourproject
## Commands
```bash
go test ./... # Run all tests
go vet ./... # Static analysis
golangci-lint run # Comprehensive linting
go build -o bin/app . # Build binary
```
## Conventions
- Error wrapping: fmt.Errorf("context: %w", err)
- Interface definitions go in the consumer package
- Use table-driven tests
- No init() functions
.cursorrules Template
A more comprehensive template:
You are a senior developer working on a production {LANGUAGE} application.
## Response Style
- Be concise. No explanations unless asked.
- Show code changes as diffs when possible.
- If unsure about project conventions, check existing code first.
## Code Quality
- All code must pass the existing linter configuration
- Write tests for new functionality
- Prefer readability over cleverness
- Use existing utilities and helpers before creating new ones
## Architecture
- Follow existing patterns in the codebase
- New files go in the appropriate directory per the project structure
- Database changes require migrations (never modify schema directly)
- API changes require updating the OpenAPI spec
## Forbidden
- Do not use deprecated APIs or libraries
- Do not add new dependencies without explicit approval
- Do not modify CI/CD configuration files
- Do not change environment variable names
Shell Aliases Collection
The complete set from the terminal section above, plus additional utilities:
# ~/.zshrc or ~/.bashrc — AI Development Section
# ===== Claude Code =====
alias cc="claude"
alias ccc="claude --continue"
alias ccr="claude --resume"
alias ccp="claude --print"
alias ccm="claude --model opus"
alias ccs="claude --model sonnet"
# ===== Quick Tasks =====
alias ccplan="claude 'Read the codebase and create an implementation plan for:'"
alias cctest="claude 'Write comprehensive tests for the changes in the last commit'"
alias ccreview="claude 'Review the staged changes and suggest improvements'"
alias ccfix="claude 'Fix the failing tests and lint errors'"
# ===== Git + AI =====
alias gaic="claude 'Create a commit message for staged changes and commit'"
alias gapr="claude 'Create a PR description for the current branch'"
# ===== Session Management =====
alias ccls="claude sessions list" # List recent sessions
alias cclast="claude --resume last" # Resume most recent session
# ===== Project Setup =====
ainit() {
echo "Creating AI configuration files..."
[ ! -f CLAUDE.md ] && cp ~/.dotfiles/templates/CLAUDE.md . && echo " Created CLAUDE.md"
[ ! -f .cursorrules ] && cp ~/.dotfiles/templates/.cursorrules . && echo " Created .cursorrules"
[ ! -d .claude ] && mkdir -p .claude && echo " Created .claude/"
echo "Done. Edit the files to match your project."
}
MCP Server Configuration
Beyond the basic setup shown earlier, here is a more complete ~/.claude/mcp.json:
{
"mcpServers": {
"context7": {
"command": "npx",
"args": ["-y", "@context7/mcp-server"],
"description": "Real-time library documentation"
},
"playwright": {
"command": "npx",
"args": ["-y", "@anthropic/mcp-playwright"],
"description": "Browser automation and testing"
},
"memory": {
"command": "npx",
"args": ["-y", "@anthropic/mcp-memory"],
"description": "Persistent memory across sessions"
}
}
}
For database connections and other service-specific MCP servers, use per-project configuration in .claude/mcp.json to avoid exposing credentials globally.
Workflow: From Idea to Deployed Feature
Here is the complete workflow, step by step, showing exactly when and how to switch between tools.
Step 1: Requirements Analysis (Claude Code)
# Start a new Claude Code session
claude
# Give it full context
> I need to add email notification support to our app.
> Users should be able to configure notification preferences.
> We use Express.js, PostgreSQL, and React.
> Please analyze the codebase and propose an implementation plan.
Claude Code will read your project structure, understand existing patterns, and produce a detailed plan covering database changes, API endpoints, frontend components, and background job configuration.
Time spent: 10-15 minutes (vs 1-2 hours manually)
Step 2: Architecture Review (Claude Code)
# Still in the same Claude Code session
> Review the plan for potential issues:
> - Will this work with our existing auth middleware?
> - Any database migration risks?
> - How does this affect our API rate limits?
This is where Claude Code’s reasoning shines. It will identify conflicts, suggest improvements, and flag risks you might miss.
Step 3: Implementation (Cursor)
Switch to Cursor. Open the agent mode and paste the plan:
Implement Phase 1 of the email notification system:
1. Create the database migration for notification_preferences table
2. Add the NotificationPreference model
3. Create the CRUD API routes
[Paste relevant parts of Claude Code's plan]
Review each file change before accepting. Cursor’s diff view makes this fast.
Step 4: Testing (Claude Code)
Back to the terminal:
# Continue the Claude Code session
claude --continue
> Write tests for the notification preferences API we just implemented.
> Cover: CRUD operations, validation errors, auth requirements,
> database constraints.
Step 5: Integration Testing (Both)
# Claude Code: run the full test suite
> Run the test suite and fix any failures.
# Then in Cursor: quick fixes for any remaining issues
# Use inline edit mode for surgical changes
Step 6: Code Review & PR (Claude Code)
> Review all changes in this branch.
> Then create a pull request with a detailed description.
Claude Code will analyze every changed file, write a comprehensive PR description, and create the PR via GitHub CLI.
Total time for a medium feature: 2-3 hours (vs 6-8 hours without AI tools)
This maps directly to the efficiency gains observed across many projects: approximately 40% faster requirements analysis, 30% faster architecture design, 50% faster coding, and 60% faster test writing. These numbers come from real-world usage tracking, not benchmarks.
Productivity Tips
Context Management
Context is the most important factor in AI output quality. Here is how to manage it:
Give full context upfront. Do not make the AI guess. If you are fixing a bug, include the error message, the relevant code, and what you have already tried.
Use CLAUDE.md actively. Update it when you add new patterns or change conventions. A well-maintained CLAUDE.md is worth more than any prompt technique.
Clean context between tasks. Start new Claude Code sessions for unrelated tasks. Carrying over context from a previous task confuses the AI and produces worse results.
Reference specific files. Instead of “fix the login bug,” say “fix the authentication error in src/middleware/auth.ts — the JWT verification fails when the token is expired.”
Session Discipline
Adopt these habits:
- One session, one task. Do not mix feature development with bug fixes in the same AI session.
- Commit before switching tools. Save your state before moving between Claude Code and Cursor.
- Review everything. AI-generated code is a first draft. Read every line before committing.
- Incremental development. Break large features into small steps. Let the AI complete each step fully before moving to the next. This is the same “incremental development” principle that experienced AI developers consistently recommend.
- Human verification at every step. Never blindly accept AI output. Verify logic, check edge cases, run tests. The AI is your assistant, not your replacement.
Cost Optimization
Keep your AI tool spending efficient:
- Model selection matters. Use Sonnet for 80% of tasks. Switch to Opus only for genuinely complex problems — architecture decisions, subtle bugs, security reviews.
- One-shot mode saves tokens. Use
claude --print "your question"for quick queries instead of interactive sessions. - Compact mode for simple tasks. When you just need a quick answer, use Claude Code’s compact mode to reduce context loading.
- Batch related questions. Instead of five separate sessions for five related questions, ask them all in one session.
- Close idle sessions. Each active Claude Code session maintains context in memory. Close sessions you are done with.
For detailed pricing strategies, see Claude Code Pricing: Plans, Costs, and Optimization.
Putting It All Together
The AI development environment is more than a collection of tools — it is a system. Each piece reinforces the others:
- CLAUDE.md ensures Claude Code understands your project without re-explaining every session
- Shell aliases reduce friction so you actually use the tools instead of falling back to manual work
- MCP servers connect the AI to your real infrastructure
- Hooks enforce quality gates that the AI cannot bypass
- The multi-tool strategy assigns each task to the tool that handles it best
- Session discipline keeps context clean and costs manageable
Start with the basics — install Claude Code and Cursor, create a CLAUDE.md file, add the shell aliases. Then gradually add MCP servers, hooks, and advanced configurations as your comfort level grows. The important thing is to start building the muscle memory of working with AI tools as part of your daily flow.
The developers who will thrive in 2026 are not the ones who use the fanciest AI tool. They are the ones who have built a well-configured environment that makes AI assistance seamless, reliable, and cost-effective. This guide gives you the foundation. The rest is practice.
Frequently Asked Questions
Check the FAQ section at the top of this page for common questions about AI dev environment setup, tool selection, costs, and configuration.
Related Reading
Explore these guides for deeper dives into specific topics covered in this article:
- Claude Code Guide 2026: Everything You Need to Know — Comprehensive overview of all Claude Code features
- The Complete CLAUDE.md Guide — Master the configuration file that makes Claude Code effective
- Claude Code MCP Server Setup Guide — Connect Claude Code to external services
- Claude Code Hooks Guide — Automate quality gates and workflows
- Claude Code Pricing: Plans, Costs, and Optimization — Understand costs and optimize spending
- Claude Code vs Cursor: Which AI Coding Tool Should You Use? — Detailed comparison of both tools
- Codex CLI Deep Dive: Setup, Config, and Power User Tips — OpenAI’s alternative terminal AI agent
- Google Antigravity Review — Google’s latest AI development offering
- What Is Vibe Coding? The AI-First Development Philosophy — Understanding the broader AI coding movement
Comments
Join the discussion — requires a GitHub account