A portable, reproducible Claude Code configuration for professional Rust development with GitHub integration.
git clone https://github.com/YOUR_USERNAME/claude-setup.git
cd claude-setup
./install.shBased on best practices from:
- Karpathy Method - Think before coding, simplicity first, surgical changes
- Boris Cherny (Claude Code creator) - Plan mode, verification loops, slash commands
- everything-claude-code - Agents, rules, skills architecture
- rust-skills - Meta-cognition framework for Rust development
~/.claude/
├── CLAUDE.md # Global instructions (Karpathy + workflow)
├── settings.json # Permissions, hooks, model config
├── mcp.json # GitHub MCP integration
├── rules/ # Always-follow guidelines
│ ├── security.md # No secrets, input validation
│ ├── coding-style.md # Immutability, small files
│ ├── git-workflow.md # Conventional commits, PR process
│ ├── testing.md # TDD, 80% coverage target
│ └── agents.md # When to delegate to subagents
├── agents/ # Subagents for delegation
│ ├── planner.md # Complex features, multi-step work
│ ├── architect.md # System design decisions
│ ├── code-reviewer.md # Post-implementation review
│ ├── security-reviewer.md # Security audit
│ └── tdd-guide.md # Test-driven development
├── commands/ # Slash commands
│ ├── plan.md # /plan - Implementation planning
│ ├── review.md # /review - Code review
│ ├── tdd.md # /tdd - TDD workflow
│ ├── commit.md # /commit - Formatted commits
│ ├── pr.md # /pr - Create GitHub PR
│ ├── pr-review.md # /pr-review - Review PRs
│ └── (rust-skills cmds) # /audit, /crate-info, etc.
├── hooks/
│ └── auto-format.sh # Auto-format Rust on Write/Edit
└── skills/ # 39 Rust skills from rust-skills
├── m01-ownership/ # Ownership/borrow/lifetime
├── m02-resource/ # Smart pointers, RAII
├── m03-mutability/ # Interior mutability
├── m04-zero-cost/ # Generics, traits
├── m05-type-driven/ # Type state patterns
├── m06-error-handling/# Result, Option, anyhow
├── m07-concurrency/ # Async, threads, channels
├── domain-*/ # Web, CLI, embedded, etc.
└── ...
~/src/.project-templates/
├── makepad/ # Makepad UI framework
│ ├── setup.sh
│ └── CLAUDE.md
├── dora/ # Dora-rs dataflow
│ ├── setup.sh
│ └── CLAUDE.md
├── pre-commit-hook.sh # Git pre-commit for Rust
└── CLAUDE.md.template # Generic project template
- Surface assumptions BEFORE coding
- Ask clarifying questions rather than guessing
- Present multiple interpretations when ambiguous
- Implement ONLY what was requested
- Minimum code that solves the problem
- No unnecessary abstractions or error handling
- Modify ONLY what's necessary
- Match existing code style exactly
- Clean up only your own mess
- Define verifiable success criteria BEFORE implementation
- Loop until goals are confirmed met
1. Plan Mode (Shift+Tab x2) → iterate on plan
2. /plan <feature> → detailed implementation plan
3. /tdd <feature> → test-driven development
4. /review → review before commit
5. /commit → well-formatted commit
6. /pr → create GitHub PR
| Command | Purpose |
|---|---|
/plan |
Create implementation plan |
/tdd |
Test-driven development cycle |
/review |
Review code changes |
/commit |
Create formatted commit |
/pr |
Create GitHub Pull Request |
/pr-review <n> |
Review PR #n |
/rust-review |
Rust-specific code review |
/audit |
Security audit |
/crate-info <name> |
Get crate information |
/unsafe-check |
Check unsafe code |
Installed by setup script:
cargo-audit- Security vulnerability scannercargo-deny- Dependency policy enforcementcargo-watch- Auto-rebuild on changecargo-expand- Macro expansion viewer
cargo new my-project && cd my-project
cp ~/src/.project-templates/CLAUDE.md.template CLAUDE.md
cp ~/src/.project-templates/pre-commit-hook.sh .git/hooks/pre-commit
chmod +x .git/hooks/pre-commit
# Edit CLAUDE.md with project specifics~/src/.project-templates/makepad/setup.sh /path/to/project~/src/.project-templates/dora/setup.sh /path/to/projectMCP integration enables Claude to:
- Create/review Pull Requests
- Manage issues
- Query repository data
Setup:
gh auth login
export GITHUB_TOKEN=$(gh auth token) # Add to ~/.bashrc or ~/.zshrcPre-approved commands (no confirmation needed):
- All
gitcommands - All
cargocommands - All
gh(GitHub CLI) commands make,ls,which
Edit project's .claude/CLAUDE.md:
## Mistakes Log
- Don't use unwrap() in this codebase, use expect() with message
- Always use tracing instead of println! for loggingCreate .claude/commands/my-command.md:
# My Command
Description of what this command does.
$ARGUMENTScd ~/src/claude-setup
git pull
./install.sh # Re-run installer- Rust (rustup)
- GitHub CLI (
gh) - Claude Code CLI v2.1+
MIT