A comprehensive configuration setup for Claude Code with Model Context Protocol (MCP) servers, custom commands, and automated workflows.
- Overview
- Quick Start
- Prerequisites
- Installation
- Features
- Commands
- Configuration
- Troubleshooting
- Contributing
- License
This project provides a pre-configured environment for Claude Code with enhanced capabilities through:
- MCP Servers: Context7, Sequential Thinking
- Custom Commands: Intelligent workflows for commits, tasks, and problem-solving
- Hook System: Automated directory management and workflow triggers
- Structured Workflows: Organized task management with reporting and planning
# 1. Install dependencies
pip install uv
# 2. Clone this configuration
git clone <your-repo> claude-setup
cd claude-setup
# 3. Start using commands
/task_hard implement user authenticationBefore using this setup, ensure you have:
- Claude Code: Installed and configured
- Python 3.8+: For hook script execution
- uv: Package manager for Python script execution
- Node.js: For MCP server functionality (npx)
# macOS/Linux
curl -LsSf https://astral.sh/uv/install.sh | sh
# Windows
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
# After installation, open a new terminal and verify:
uv --version# Copy configuration files to your project
cp -r .claude/ /your/project/
cp .mcp.json /your/project/
# Ensure hook permissions
chmod +x .claude/hooks/task_hard_prep_hook.pyPrerequisites - Install Rust (for xsv and sd):
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source "$HOME/.cargo/env"Complete installation (core tools only):
sudo apt update && sudo apt install -y ripgrep bat fd-find && mkdir -p ~/.local/bin && ln -sf /usr/bin/batcat ~/.local/bin/bat && ln -sf /usr/bin/fdfind ~/.local/bin/fd && cargo install sd xsvComplete installation (core + optional tools):
sudo apt update && sudo apt install -y ripgrep bat fd-find jq && mkdir -p ~/.local/bin && ln -sf /usr/bin/batcat ~/.local/bin/bat && ln -sf /usr/bin/fdfind ~/.local/bin/fd && cargo install sd xsv && sudo wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 && sudo chmod +x /usr/local/bin/yqWhat this does:
- Updates package lists
- Installs
ripgrep,bat,fd-find,jqfrom apt - Creates
~/.local/bindirectory - Symlinks
batcatβbatandfdfindβfd(fixes naming conflicts) - Installs
sd,xsvvia Cargo (Rust package manager) - Downloads and installs
yqbinary
sudo pacman -S ripgrep bat fd sd jq yqOptional AUR tools:
yay -S xsv mdqsudo dnf install -y ripgrep bat fd-find jq && cargo install sd xsv && sudo wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 && sudo chmod +x /usr/local/bin/yqapk add ripgrep bat fd jq yq && cargo install sd xsvCore tools - Required (single command):
winget install BurntSushi.ripgrep.MSVC && winget install sharkdp.bat && winget install sharkdp.fd && winget install chmln.sd && winget install BurntSushi.xsv.MSVCOptional tools (for specialized operations):
winget install jqlang.jq && winget install MikeFarah.yqIndividual installations:
# Core tools (required)
winget install BurntSushi.ripgrep.MSVC
winget install sharkdp.bat
winget install sharkdp.fd
winget install chmln.sd
winget install BurntSushi.xsv.MSVC
# Optional tools
winget install jqlang.jq
winget install MikeFarah.yqscoop install ripgrep bat fd sd jq yqchoco install ripgrep bat fd-find sd jq yqbrew install ripgrep bat fd sd jq yq xsv mdq| Legacy Tool | Modern Replacement | Package Name | Enforcement |
|---|---|---|---|
grep |
rg |
ripgrep | Blocked |
cat |
bat |
bat | Blocked |
find |
fd |
fd / fd-find | Blocked |
awk/perl |
sd |
sd | Blocked |
cut |
xsv |
xsv (winget/cargo) | Blocked |
| JSON ops | jq |
jq | Suggested |
| YAML ops | yq |
yq | Suggested |
| Markdown | mdq |
mdq (cargo) | Suggested |
Blocked: Hook prevents execution and requires modern tool Suggested: Hook provides recommendation but allows execution
Verify core tools (required):
rg --version
bat --version
fd --version
sd --version
xsv --versionVerify optional tools:
jq --version
yq --versionUbuntu/Debian Naming Conflicts:
batis installed asbatcat(conflict withbacula-console-qt)fdis installed asfdfind(conflict withfdclone)- Symlinks in
~/.local/binresolve this issue
Cargo Requirement:
- Windows: All core tools available via winget - no Cargo needed!
- Linux: Core tools
sdandxsvrequire Rust's Cargo package manager - Optional tool
mdqrequires Cargo on all platforms - Install Rust (Linux):
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
PATH Configuration:
- Ensure
~/.local/binis in your PATH (usually automatic on modern Linux) - Add to
~/.bashrcor~/.zshrcif needed:export PATH="$HOME/.local/bin:$PATH"
/commit: Intelligent commit workflow with conventional standards/code-review: Reviews uncommitted changes before committing/task_hard: Advanced problem-solving with automated directory management/task_easy: Simplified task workflow for lighter needs
investigator: Expert code investigator that tracks down related code to problems- Uses sequential thinking and advanced search tools
- Prioritizes files containing specified keywords during investigation
- Generates comprehensive INVESTIGATION_REPORT.md files with keyword match analysis
- Integrated with task_hard workflow
code-flow-mapper: Expert code flow mapper that traces execution paths and file interconnections- Maps code flow and analyzes file relationships
- Generates FLOW_REPORT.md files
planner: Expert planner that takes into account investigation and flow analysis reports- Creates detailed plans that solve all problems
- Generates comprehensive PLAN.md files
code-reviewer: Senior code review specialist for quality assurance- Reviews changes for quality, security, and maintainability
- Provides prioritized feedback (critical, warnings, suggestions)
- Checks for best practices and potential issues
- Context7: Library documentation and code context
- Sequential Thinking: Advanced reasoning and problem-solving
- UserPromptSubmit: Automatic directory creation for task workflows
- Extensible: Easy to add custom hooks for workflow automation
- Documentation: Hooks Reference | Hooks Guide
Automated workflow for complex problem-solving with structured investigation and planning.
Usage:
/task_hard [problem description]Features:
- β
Automatic
claude-instance-{id}directory creation - β Sequential thinking for complex reasoning
- β Multi-agent workflow with specialized subagents
- β Automatically extracts keywords from problems when not explicitly provided
- β Prioritizes files containing relevant keywords during codebase analysis
- β Codebase investigation with INVESTIGATION_REPORT.md generation
- β Code flow mapping with FLOW_REPORT.md analysis
- β Structured planning with PLAN.md output
- β Incremental instance numbering
- β Edge case handling and best practices focus
Examples:
# Basic usage - keywords automatically detected
/task_hard implement user authentication system
# Advanced usage - explicit keywords for better targeting
/task_hard implement user dashboard
Keywords: dashboard, user, profile, settings
# Complex problem with specific focus areas
/task_hard fix payment processing bugs
Keywords: payment, stripe, transaction, webhookKeyword Usage:
- Automatic Detection: The system automatically identifies relevant keywords from your problem description
- Manual Keywords: Add Keywords: keyword1, keyword2, keyword3 on a new line after your problem statement for precise file targeting
- Priority Investigation: Files containing these keywords are investigated first and flagged as high-priority in reports
- Better Results: Explicit keywords help focus investigation on the most relevant code areas
Workflow:
- π§ Hook detects
/task_hardprompt - π Creates
claude-code-storage/claude-instance-{id}/directory - π·οΈ Extracts or detects relevant keywords from problem statement
- π Investigator agent analyzes codebase using sequential thinking with keyword-based file prioritization
- π Generates comprehensive INVESTIGATION_REPORT.md with keyword match analysis and related files
- πΊοΈ Code-flow-mapper agent traces execution paths and file interconnections
- π Generates detailed FLOW_REPORT.md with code relationships
- π Planner agent reads both reports and creates comprehensive PLAN.md
- π€ User reviews and approves plan
Initiates code-reviewer agent to analyze uncommitted changes only.
Usage:
/code-reviewFeatures:
- Focuses exclusively on uncommitted changes
- Reviews modified files for quality, security, and maintainability
- Provides prioritized feedback:
- π¨ Critical issues (must fix)
β οΈ Warnings (should fix)- π‘ Suggestions (consider improving)
- Includes specific fix examples
Example:
# After making changes
/code-review
# Fix any critical issues
/commitStreamlined commit workflow following conventional commit standards.
Features:
- Diff analysis and change summarization
- Conventional commit message formatting
- Clean, focused commits
Important: Run /code-review before committing to ensure code quality.
Example:
# Review changes first
/code-review
# After fixing issues
/commitLightweight task workflow for simpler problem-solving needs.
Important: When using this configuration in projects with nested directory structures (e.g., monorepos with backend/, frontend/ subdirectories), you may start Claude Code from a subdirectory rather than the project root.
Impact on hooks:
- Hooks using relative paths may fail if the working directory is not the project root
- The
/statuscommand shows the current working directory - Use
$CLAUDE_PROJECT_DIRenvironment variable or relative paths to ensure hooks work correctly
Recommended hook configuration for nested projects:
{
"hooks": {
"UserPromptSubmit": [
{
"hooks": [
{
"type": "command",
"command": "uv run $CLAUDE_PROJECT_DIR/.claude/hooks/task_hard_prep_hook.py"
}
]
}
]
}
}claude-setup/
βββ .claude/
β βββ settings.json # Permissions and hook configuration
β βββ agents/
β β βββ investigator.md # Code investigation agent
β β βββ code-flow-mapper.md # Code flow mapping agent
β β βββ planner.md # Planning agent
β β βββ code-reviewer.md # Code review specialist
β βββ hooks/
β β βββ task_hard_prep_hook.py # Auto directory creation
β βββ commands/
β βββ task_hard.md # Advanced task workflow
β βββ task_easy.md # Simple task workflow
β βββ code-review.md # Code review workflow
β βββ commit.md # Commit workflow
βββ .mcp.json # MCP server configuration
βββ claude-code-storage/ # Auto-generated task directories
βββ README.md
The .claude/settings.json file contains:
{
"permissions": {
"allow": ["WebFetch(domain:docs.anthropic.com)", ...],
"deny": [...]
},
"hooks": {
"UserPromptSubmit": [
{
"hooks": [
{
"type": "command",
"command": "uv run .claude/hooks/task_hard_prep_hook.py"
}
]
}
]
},
"enabledMcpjsonServers": ["context7", "sequential-thinking"]
}The .mcp.json file defines server configurations:
{
"mcpServers": {
"context7": {
"command": "npx",
"args": ["-y", "@upstash/context7-mcp"],
"env": {
"DEFAULT_MINIMUM_TOKENS": "6000"
}
},
"sequential-thinking": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-sequential-thinking"]
}
}
}Hook not triggering:
- Ensure
uvis installed and in PATH - Check script permissions:
chmod +x .claude/hooks/task_hard_prep_hook.py - Verify hook configuration in
.claude/settings.json
Hook path issues when working directory is not project root:
When Claude Code's working directory is a subdirectory (e.g., backend/ or frontend/), hooks may fail to find the correct path. This commonly happens in new projects with nested layouts.
Solutions:
-
Use environment variable (Recommended for cross-platform):
"command": "uv run $CLAUDE_PROJECT_DIR/.claude/hooks/task_hard_prep_hook.py"
-
Use relative path from project root:
"command": "uv run ../../.claude/hooks/task_hard_prep_hook.py"
-
Use absolute path (if known):
"command": "uv run /full/path/to/project/.claude/hooks/task_hard_prep_hook.py"
Note: The $CLAUDE_PROJECT_DIR environment variable may not work on all systems. If you encounter issues, use the relative path approach or place the .claude directory in your working directory.
Directory creation fails:
- Check file system permissions
- Ensure
claude-code-storage/parent directory exists - Review hook script logs for error details
MCP servers not loading:
- Verify Node.js and npx are installed
- Check
.mcp.jsonconfiguration syntax - Ensure MCP packages are available via npx
Enable debug mode for detailed logging:
claude --debug- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Make your changes and test thoroughly
- Submit a pull request with detailed description
- Create script in
.claude/hooks/ - Make executable:
chmod +x .claude/hooks/your_hook.py - Add configuration to
.claude/settings.json - Test with sample inputs
Resources:
This configuration setup is provided as-is for Claude Code enhancement.
Need help? Check the documentation:
Or open an issue for project-specific questions.