ASK KNOX
beta
LESSON 63

Building Your Personal AI Dev Environment

Compose every feature from this track into a unified system. CLAUDE.md + MCP + hooks + commands + worktrees + CI = the ~/.claude/ productivity OS. Measure the 10x. Make it portable. Ship it.

11 min read·Advanced Claude Code

You have the pieces. This lesson is about composition — taking everything from this track and assembling it into a system that runs at a fundamentally different productivity level than point tools. The goal is not to use Claude Code. The goal is to build an AI-native development environment where the scaffolding handles the repetitive, the standards enforce themselves, and you focus on the decisions that actually require your judgment.

This is the difference between a craftsman with good tools and a craftsman with a shop — every tool optimized, positioned, and ready.

Personal AI Dev Environment — ~/.claude/ Composition

The ~/.claude/ Directory as Your Productivity OS

Think of ~/.claude/ as an operating system layer above Claude Code. The OS does not do your work — it creates the environment in which you do your work more effectively. Every file you put in it is a permanent investment in future session quality.

The full structure of a mature ~/.claude/:

~/.claude/
├── CLAUDE.md              # Global standing orders — applies everywhere
├── settings.json          # Hooks configuration
├── commands/              # Your slash command library
│   ├── review.md
│   ├── pr-description.md
│   ├── deploy.md
│   ├── test.md
│   ├── debug.md
│   └── summarize.md
└── hooks/                 # Hook scripts
    ├── auto-lint.sh
    ├── validate-bash.sh
    └── session-summary.sh

And in ~/.claude.json: your MCP server configuration. Every layer compounds. CLAUDE.md sets the context. Hooks enforce standards automatically. Commands encode your best prompts. MCP servers extend reach into your specific systems.

Composing the Layers

Here is how the layers interact in practice. You open a new Claude Code session on a project. Before you type a word:

  1. CLAUDE.md loads — Claude knows your branch policy, your stack, your commit email, your forbidden patterns. It does not need you to explain these.
  2. MCP servers connect — If you configured a database server or a browser server, Claude already has those tools available. No setup in-session.
  3. Hooks are armed — PostToolUse hooks will fire on every edit. Your linter runs automatically. Your session log updates.
  4. Commands are ready/review, /pr-description, /deploy are available. One word executes your best prompt.

The first session is configuration. Every subsequent session is leverage.

The present is the work. The environment handles everything else.

The Global CLAUDE.md: What Goes There

Your global CLAUDE.md should crystallize the universal rules that apply to every project:

# Global Rules — Apply Everywhere

## Git
- NEVER commit to main directly. Always feature branch → PR.
- ALWAYS git checkout main && git pull before cutting a new branch.
- Commit email: your@email.com (not any other address)

## Security
- Never store API keys in committed files.
- Run sec-scan before adopting any new third-party repo.

## Testing
- 90% coverage floor. Every bug fix requires a regression test.
- Never mock what you can test against live.

## Communication
- After any task: openclaw system event with a summary.
- Failing CI: fix it. Do not ask for hand-holding on technical decisions.

## Cost Discipline
- Use flash/lite models for simple tasks.
- Only use expensive models for complex multi-step work.

These rules save you from having to repeat them in every project CLAUDE.md. They are the invariants — the things that should never be different across projects.

Dotfiles: Making It Portable

The ~/.claude/ directory should be under version control. The pattern:

# Initial setup
cd ~
git init dotfiles
cd dotfiles
mkdir claude
cp -r ~/.claude/* claude/

# Symlink ~/.claude/ to the repo
rm -rf ~/.claude
ln -s ~/dotfiles/claude ~/.claude

# From now on, changes to ~/.claude/ are changes to ~/dotfiles/claude/
git add -A && git commit -m "feat: initial claude config"
git remote add origin git@github.com:yourname/dotfiles.git
git push -u origin main

On a new machine:

git clone git@github.com:yourname/dotfiles.git ~/dotfiles
ln -s ~/dotfiles/claude ~/.claude
# Also symlink ~/.claude.json if you track it

Your entire AI dev environment is deployed in two commands. Every improvement you make to it accumulates in the repo and becomes available everywhere.

Measuring the 10x

The 10x claim is testable. Here are the metrics that make it real:

Tasks completed per day. Before and after building this environment, count the discrete tasks you complete. Tasks where you prompted Claude, got usable output, and shipped. This number should increase by 2–3x within 30 days of the full setup.

Human intervention per task. Count how many times you had to correct Claude, re-prompt, or manually fix something per task. A well-configured environment reduces this significantly because CLAUDE.md prevents the common mistakes, hooks catch quality issues, and commands encode the right approach.

Session startup time. Before configuration: explain the project, explain the stack, explain the conventions, explain what you are trying to do. After: one good initial prompt. CLAUDE.md already handled the context.

Standards violations reaching PR. Hooks running in CI and locally should drive this to near zero. If you are still catching the same classes of issues in code review, encode those as a hook or a CLAUDE.md rule.

The Compound Learning Loop

The environment gets better only if you maintain the loop. After every session where something went wrong — Claude violated a convention, made a mistake you had to correct, took an approach you did not want — add the rule. To lessons.md in the project, to CLAUDE.md in the project, and if it is universal, to your global CLAUDE.md.

The pattern:

  1. Claude makes a mistake
  2. You correct it
  3. You add the rule to the appropriate CLAUDE.md
  4. That mistake never happens again

Across 100 sessions, this loop builds a CLAUDE.md that prevents the hundred most common failure modes specific to your work. It is a compounding asset.

The Full System Checklist

Before calling your AI dev environment complete:

CLAUDE.md:

  • Global file exists with universal rules
  • Every active project has a project-level file
  • Tiered file table present in project files
  • At least 3 explicit prohibitions
  • Deploy commands and stack documented

MCP Servers:

  • At least one server beyond the defaults installed
  • Custom server built for your most-accessed data source
  • All secrets in env vars, not hardcoded

Hooks:

  • Auto-lint PostToolUse hook running
  • At least one PreToolUse validation hook
  • Stop hook logging session summary

Commands:

  • /review with your actual standards
  • /pr-description with your format
  • /test that knows your test runner
  • At least one project-specific command

Portability:

  • ~/.claude/ under version control
  • New machine setup documented in README

Lesson 63 Drill — The Full Audit

This lesson's drill is a system audit, not a build-something exercise. Open your ~/.claude/ directory. Compare it against the checklist above. For each item missing, build it now. Time budget: 90 minutes.

At the end of 90 minutes, run one Claude Code session on a real task — something that would normally take 2–3 hours. Measure the actual time. That delta is your baseline for the 10x.

Bottom Line

A personal AI dev environment is a composed system: global CLAUDE.md for universal rules, project CLAUDE.md for stack-specific context, MCP servers for extended reach, hooks for automatic quality enforcement, slash commands for reusable prompts, and dotfiles for portability. Each layer costs hours to build and returns hours every week indefinitely. The compound learning loop — encode every lesson — makes it increasingly powerful over time. The 10x is not a claim. It is a measurable outcome. Build the environment, run the measurement, and let the data speak.

You now have the complete advanced Claude Code toolkit. Build with it.