claude-settings
My personal Claude Code/Desktop setup with battle-tested commands and MCP servers that I use daily.
GitHubスター
85
ユーザー評価
未評価
お気に入り
0
閲覧数
14
フォーク
7
イシュー
0
claude-settings
My personal Claude Code/Desktop setup with battle-tested commands and MCP servers that I use daily.
Setup
- Install nvm and Node.js (v22+ recommended)
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash
\. "$HOME/.nvm/nvm.sh"
nvm install 22
node -v # Should print "v22.17.1".
nvm current # Should print "v22.17.1".
- Install Claude Code:
npm install -g @anthropic-ai/claude-code
- Install jq (required for hooks):
macOS:
brew install jq
Ubuntu/Debian:
sudo apt-get install jq
Other Linux distributions:
# Check your package manager, e.g.:
# sudo yum install jq (RHEL/CentOS)
# sudo pacman -S jq (Arch)
- Install code quality tools:
# Python formatting (required for Python hook)
pip install ruff docformatter
# Prettier for JS/TS/CSS/JSON/YAML/HTML/Markdown/Shell formatting (required for prettier hooks)
npm install -g prettier@3.6.2 prettier-plugin-sh
- Convert to local setup instead of global:
claude migrate-installer
MCP Servers
The MCP (Model Context Protocol) configuration lives in mcp.json
. These are some solid MCP server repos worth checking out:
- Azure MCP - 40+ Azure tools (100% free)
- Context7 - Up-to-date documentation context for 20K+ libraries (100% free)
- GitHub MCP Server - 50+ GitHub tools (100% free)
- MongoDB MCP - Tools for interacting with MongoDB (100% free)
- Paper Search MCP - Search papers across arXiv, PubMed, bioRxiv, Google Scholar, and more (100% free)
- Playwright MCP - 30+ browser/web testing tools (100% free)
- Slack MCP Server - 10+ Slack tools (100% free)
- Tavily MCP - 4 tools for web search and scraping. Better than Claude Code's built-in WebFetch tool (free tier: 1000 monthly requests)
Configuration
The Claude Code configuration is stored in .claude/settings.json
and includes:
- Model selection (currently using OpusPlan - see model configuration docs)
- Environment variables for optimal Claude Code behavior
- Settings for disabling telemetry and non-essential features
- Custom hooks for enhancing tool functionality
Agents
Specialized agents that run automatically to enhance code quality, stored in .claude/agents/
:
code-simplifier.md
- Contextual pattern analyzer that ensures new code follows existing project conventions (imports, naming, function signatures, class patterns). Auto-triggers after TodoWrite to maintain codebase consistency.commit-orchestrator.md
- Git commit expert that analyzes staged changes, creates optimal commit strategies, and executes commits with meaningful messages. Handles documentation updates and multi-commit scenarios.
For more details, see the Claude Code sub-agents documentation.
Hooks
Custom hooks that enhance tool usage, configured in .claude/settings.json
:
Setup
Make hook scripts executable after cloning:
chmod +x ./.claude/hooks/*.py
Web Content Enhancement Hooks
These hooks redirect native Claude Code web tools to faster and more reliable Tavily alternatives. Native WebSearch/WebFetch tools take 20-30 seconds while Tavily equivalents complete in 1-2 seconds. Additionally, native WebFetch often fails on bot-protected websites while Tavily can bypass these protections.
- hook_webfetch_to_tavily_extract.py: Blocks WebFetch and suggests using Tavily extract with advanced depth
- hook_tavily_extract_to_advanced.py: Enhances tavily-extract calls with advanced extraction depth for better content parsing
- hook_websearch_to_tavily_search.py: Blocks WebSearch and suggests using Tavily search instead
Code Quality Hooks
Comprehensive auto-formatting system that covers all major file types, designed to eliminate formatting inconsistencies and reduce CI formatting noise.
Whitespace Cleanup (settings.json#L64-L74): Automatically removes whitespace from empty lines in Python, JavaScript, and TypeScript files (
.py
,.js
,.jsx
,.ts
,.tsx
) after any Edit, MultiEdit, Write, or Task operation. Works cross-platform (macOS and Linux).Python Code Quality (hook_python_code_quality.py): Automatically formats and lints Python files using ruff and docformatter after Edit/Write/MultiEdit operations. Matches Ultralytics Actions pipeline exactly:
ruff format --line-length 120
ruff check --fix --unsafe-fixes --extend-select I,D,UP --target-version py38
docformatter --wrap-summaries 120 --wrap-descriptions 120
Prettier Formatting (hook_prettier_formatting.py): Auto-formats JavaScript, TypeScript, CSS, JSON, YAML, HTML, Vue, and Svelte files using prettier. Skips lock files and model.json to prevent conflicts.
Markdown Formatting (hook_markdown_formatting.py): Formats Markdown files with prettier, applying special tab-width 4 handling for documentation directories (matches Ultralytics Actions docs formatting).
Bash/Shell Formatting (hook_bash_formatting.py): Formats shell scripts (
.sh
,.bash
) using prettier-plugin-sh for consistent bash scripting style.Ripgrep Enforcement (hook_enforce_rg_over_grep.py): Blocks grep and find commands in Bash tool calls, suggesting rg (ripgrep) alternatives for better performance and more features.
Zero CI Formatting
This comprehensive formatting setup is designed to achieve zero auto-formatting from CI workflows like Ultralytics Actions. The hooks cover 95% of typical formatting needs:
- ✅ Python (ruff + docformatter)
- ✅ JavaScript/TypeScript (prettier)
- ✅ CSS/SCSS/Less (prettier)
- ✅ JSON/YAML (prettier)
- ✅ HTML/Vue/Svelte (prettier)
- ✅ Markdown (prettier with docs handling)
- ✅ Shell scripts (prettier-plugin-sh)
- ✅ Whitespace cleanup
All hooks gracefully degrade when tools aren't available, never disrupting Claude Code operations. Python formatting configuration inspired by onuralpszr's setup.
For more details, see the Claude Code hooks documentation.
Commands
Custom Claude Code commands that make life easier, stored in .claude/commands/
:
apply-thinking-to.md
- Prompt enhancement using advanced thinking patterns (inspired by centminmod's version)commit-staged-changes.md
- Automated commit creation with conventional commit messagesexplain-architecture-pattern.md
- Identify and explain architectural patterns and design decisionsupdate-pr-summary.md
- Generate PR summaries with advanced analytical frameworks