Set up Claude Code for any project in one command
Project description
Claudex
Set up Claude Code for any project in one command
Zero-dependency Python CLI that analyzes your project and generates a complete .claude/ configuration with project-specific CLAUDE.md, hooks, commands, and development workflows.
Features
✨ Smart Detection - Analyzes your project (pyproject.toml, package.json, directory structure) to detect:
- Language (Python, TypeScript, JavaScript)
- Framework (FastAPI, Django, Flask, Next.js, React, Vue)
- Package manager (uv, poetry, pip, npm, pnpm, yarn)
- Database (PostgreSQL, MySQL, MongoDB, SQLite)
- Infrastructure (Docker, CI, Git)
📝 Generated CLAUDE.md - Uses actual project data (not templates):
- Real directory tree from your project
- Quick start commands for your package manager
- Framework-specific testing strategies
- Layer rules tailored to your architecture
🎯 Auto-Preset Selection - Detects your stack and chooses the best preset:
python-fastapifor FastAPI projectspython-djangofor Django projectsnextjsfor Next.js projectsgenericfallback for everything else
🔒 Security Built-In - Path traversal protection, never commits secrets
Installation
# Install from source (for now)
cd /path/to/claudex
pip install -e .
# Or build and install wheel
python -m build
pip install dist/claudex-1.0.0-*.whl
Coming soon: pip install claudex (PyPI)
Windows Note: If pip install completes but the claudex command isn't found, you have three options:
- Use
python -m claudexinstead ofclaudexfor all commands - Use the provided
claudex.batwrapper script - Add your Python Scripts directory to PATH
Quick Start
# Initialize a new project
claudex init /path/to/project --yes
# See what would be detected first
claudex info /path/to/project
# Update an existing .claude/ setup (preserves user files)
claudex update /path/to/project
# Validate your .claude/ setup
claudex validate /path/to/project
# List available presets
claudex presets
Commands
claudex init [DIR]
Initialize .claude/ configuration for a project.
Options:
--preset <name>- Override auto-detection (python-fastapi, python-django, nextjs, generic)--yes- Skip confirmation prompt--force- Overwrite existing .claude/--global- Also install ~/.claude/ global config
Example:
# Auto-detect and initialize
cd my-fastapi-project
claudex init . --yes
# Override preset
claudex init /path/to/django-app --preset python-django
# Full setup: global + project
claudex init . --yes --global
What it creates:
.claude/directory with:hooks/- 6 Python hooks (pre/post-tool-use, session lifecycle)commands/- 17 slash commands (/dev,/audit,/parallel, etc.)rules/- Development guidelines (workflow, naming, testing)session/- Task persistence filesfeedback/- Violation trackingknowledge/- 100x patterns reference
CLAUDE.md- Generated from your actual project structure.mcp.json- MCP server config template- Updates
.gitignoreto include.claude/
claudex update [DIR]
Update existing .claude/ files without regenerating CLAUDE.md.
Preserves:
session/CURRENT_TASK.mdsession/TASK_PROGRESS.mdsession/BACKGROUND_QUEUE.mdsession/PARALLEL_SESSIONS.mdfeedback/*(violations, lessons, corrections)knowledge/*(user-added knowledge files)docs/*
Example:
claudex update .
claudex validate [DIR]
Health check your .claude/ setup.
Checks:
.claude/directory exists- Required subdirectories present (hooks, commands, rules, session, feedback)
- Required files present (settings.json, all hook scripts)
CLAUDE.mdexists at project root.gitignoreincludes.claude/.mcp.jsonexists (warns if missing)
Example:
claudex validate /path/to/project
Output:
✓ PASS: .claude/ directory exists
✓ PASS: All required directories present
✗ FAIL: Missing .claude/hooks/session-start.py
✓ PASS: CLAUDE.md exists
✗ FAIL: .gitignore does not include .claude/
Validation failed. Run 'claudex init --force' to restore.
claudex info [DIR]
Show detection results without making changes.
Example:
claudex info /path/to/fastapi-project
Output:
Project: my-fastapi-app
Language: python
Framework: FastAPI
Package manager: uv
Python version: >=3.11
Database: postgresql
Redis: yes
Docker: yes
CI: yes
Auto-selected preset: python-fastapi
Directory tree:
my-fastapi-app/
src/
api/
core/
db/
tests/
unit/
integration/
client/
claudex presets
List all available presets with descriptions.
Example:
claudex presets
Output:
Available presets:
python-fastapi - Python + FastAPI + SQLAlchemy + PostgreSQL
python-django - Python + Django + DRF + PostgreSQL
nextjs - Next.js + TypeScript + Tailwind + TanStack Query
generic - Minimal setup for any project
Presets
Each preset provides tailored configuration for specific stacks:
python-fastapi
- Stack: Python + FastAPI + SQLAlchemy + PostgreSQL
- Architecture: Domain/Application/Agents/Infrastructure layers
- Quick start:
uv sync,docker-compose up -d,uvicorn app:app --reload - Testing: pytest with 95% domain coverage target
python-django
- Stack: Python + Django + Django REST Framework + PostgreSQL
- Architecture: Django apps with clean separation
- Quick start:
poetry install,python manage.py migrate,python manage.py runserver - Testing: Django test framework
nextjs
- Stack: Next.js + TypeScript + Tailwind CSS + TanStack Query
- Architecture: App router with components/hooks/lib
- Quick start:
pnpm install,pnpm dev - Testing: Vitest + React Testing Library
generic
- Stack: Any language/framework
- Architecture: Minimal recommendations
- Quick start: Auto-detected or manual
- Testing: Standard coverage targets
After Setup
1. Configure MCP (Optional)
Edit .mcp.json to connect Claude Code to GitHub:
# Get your GitHub token
gh auth token
# Paste into .mcp.json "args" for github server
2. Start Claude Code
cd /path/to/project
# Claude Code will auto-load .claude/ configuration
3. Begin Development
# Start your first task
/dev start "implement user authentication"
# Continue after break
/dev continue
# Complete when done
/dev complete
100x Developer Workflow
The scaffold implements the 100x Developer Framework for maximum throughput:
Background Agents (Night Queue)
Accumulate tasks during deep work, execute overnight:
/background-queue add "Add unit tests for user service"
/background-queue add "Fix lint warnings in api/ directory"
/background-queue add "Update docstrings in core modules"
/night-kick # Generates headless launch commands
# Copy-paste commands, agents run overnight
/background-queue review # Check results next morning
Parallel Sessions
Split large features across multiple Claude Code sessions:
/parallel plan "Sprint 5: Add real-time features"
# Creates PARALLEL_SESSIONS.md with:
# - Session table (file ownership, no overlaps)
# - Merge order (dependency-aware)
# - Worktree creation commands
# Launch sessions in separate terminals
cd ../project-session-a && /dev start ...
cd ../project-session-b && /dev start ...
/parallel status # Check progress
/parallel merge-order # Get correct merge sequence
/parallel cleanup # Remove completed worktrees
AI Code Review
Automatically runs on every PR:
# .github/workflows/claude-code-review.yml (created by scaffold)
- Project-specific review rules
- Architecture compliance checks
- Tag @claude in any PR comment for on-demand review
Slash Commands Reference
| Command | Purpose |
|---|---|
/dev start <task> |
Initialize new task with session files |
/dev continue |
Resume from session files after compaction |
/dev checkpoint |
Save progress to disk |
/dev validate |
Run all validations |
/dev complete |
Complete task with full QA |
/audit |
Code quality and security audit |
/run-tests |
Execute test suite with reporting |
/validate-architecture |
Check layer placement and dependencies |
/validate-consistency |
Cross-layer schema/type/enum check |
/background-queue |
Manage background agent task queue |
/night-kick |
Launch queued background agents |
/parallel |
Plan and manage parallel sessions |
/report-violation |
Log and track workflow violations |
/improve-workflow |
Analyze feedback and propose improvements |
/expert-* |
Consult specialized subagents |
Customization
Modify Detection Logic
Edit claudex/detectors.py:
PYTHON_FRAMEWORKS- Add new Python frameworksJS_FRAMEWORKS- Add new JavaScript frameworksDB_INDICATORS- Add database detection patterns
Add New Presets
Create claudex/presets/your-preset.yaml:
name: your-stack
description: Your custom stack description
architecture_tree: |
project/
src/
tests/
layer_description: |
- **src/**: Application code
- **tests/**: Test suite
layer_rules:
- Domain layer: Pure business logic
- Application layer: Use cases
quick_start: |
npm install
npm run dev
Modify Templates
Edit files in claudex/templates/project/:
hooks/- Customize Python hookscommands/- Add new slash commandsrules/- Modify development guidelines
Development
Running Tests
# Install dev dependencies
pip install -e .
pip install pytest
# Run all tests
pytest tests/ -v
# Run specific test file
pytest tests/test_detectors.py -v
# Run with coverage
pytest tests/ --cov=claudex --cov-report=html
Running CI Locally
# Lint
ruff check claudex/ tests/
# Format check
ruff format claudex/ tests/ --check
# Auto-fix
ruff check claudex/ tests/ --fix
ruff format claudex/ tests/
Troubleshooting
Issue: Detection fails on Windows
Symptom: Unicode errors when printing directory tree
Fix: Unicode encoding is handled internally with fallback to ASCII. If you still see errors, set:
set PYTHONIOENCODING=utf-8
Issue: Templates not found after pip install
Symptom: FileNotFoundError: templates/project/
Fix: Templates are inside the package. If using editable install (pip install -e .), ensure you're in the repo directory. For normal install, templates resolve via __file__.
Issue: Can't detect my framework
Symptom: Auto-selects generic preset when it should detect FastAPI/Django/Next.js
Fix: Check your dependencies:
- Python: Must be in
pyproject.toml[project.dependencies]or[tool.poetry.dependencies] - JavaScript: Must be in
package.jsondependencies(notdevDependencies)
Issue: CLAUDE.md not project-specific
Symptom: Generated CLAUDE.md has generic architecture tree
Fix: Detection couldn't find source directories. Ensure:
- Python:
src/orapp/directory with.pyfiles - JavaScript:
src/orapp/directory with.ts/.tsx/.jsfiles
Requirements
- Python 3.11+ (for
tomllibstdlib) - No external dependencies (stdlib only)
- Git (for worktree support in parallel sessions)
License
MIT License - see LICENSE
Contributing
Contributions welcome! Please:
- Fork the repository
- Create a feature branch
- Add tests for new functionality
- Ensure all tests pass (
pytest tests/) - Submit a pull request
Roadmap
- Publish to PyPI
- Add more presets (Flask, Express, Vue, Svelte)
- Preset inheritance (
extends:in YAML) - Detection confidence scores
-
previewcommand (show what would be generated) - Monorepo support (detect sub-projects)
Made for Claude Code - Anthropic's official CLI for Claude
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file binxai_claudex-1.0.0.tar.gz.
File metadata
- Download URL: binxai_claudex-1.0.0.tar.gz
- Upload date:
- Size: 71.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1c92742a8400f9b930f34922e585135a0ca2899b94b208e6e19eb8ab14bec8a4
|
|
| MD5 |
b8ce23bd8560f36567e38dbadda3c9fe
|
|
| BLAKE2b-256 |
e1d151d921bc8cf60b7c661ae5bfd3389f62842942d2a5e6430c76636cc173f7
|
Provenance
The following attestation bundles were made for binxai_claudex-1.0.0.tar.gz:
Publisher:
release.yml on BinxAI/claudex
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
binxai_claudex-1.0.0.tar.gz -
Subject digest:
1c92742a8400f9b930f34922e585135a0ca2899b94b208e6e19eb8ab14bec8a4 - Sigstore transparency entry: 975589701
- Sigstore integration time:
-
Permalink:
BinxAI/claudex@cc2e4f0d9d5b86d64301c5b58e5a873887d47a14 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/BinxAI
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@cc2e4f0d9d5b86d64301c5b58e5a873887d47a14 -
Trigger Event:
push
-
Statement type:
File details
Details for the file binxai_claudex-1.0.0-py3-none-any.whl.
File metadata
- Download URL: binxai_claudex-1.0.0-py3-none-any.whl
- Upload date:
- Size: 93.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eea48b732434caa8b2437eee4b696beb4aec868a6da521280cd7a3df2c7ca401
|
|
| MD5 |
9cd545c2025b6c0fd48899eaceab0848
|
|
| BLAKE2b-256 |
2c7a14917a0899fe7ff601b23b624ffeef1be959edf502c1135da38f6a91372a
|
Provenance
The following attestation bundles were made for binxai_claudex-1.0.0-py3-none-any.whl:
Publisher:
release.yml on BinxAI/claudex
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
binxai_claudex-1.0.0-py3-none-any.whl -
Subject digest:
eea48b732434caa8b2437eee4b696beb4aec868a6da521280cd7a3df2c7ca401 - Sigstore transparency entry: 975589704
- Sigstore integration time:
-
Permalink:
BinxAI/claudex@cc2e4f0d9d5b86d64301c5b58e5a873887d47a14 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/BinxAI
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@cc2e4f0d9d5b86d64301c5b58e5a873887d47a14 -
Trigger Event:
push
-
Statement type: