Skip to content

76159482/claude-code-config

 
 

Repository files navigation

🚀 Claude Code Global Configuration

Professional Claude Code setup with hooks, commands, and sub-agents

License: MIT Claude Code


📋 Overview

This is a production-ready Claude Code global configuration that includes:

  • ✅ Global CLAUDE.md with best practices
  • ✅ Comprehensive settings.json with security controls
  • ✅ 3 automation hooks (session, safety, quality)
  • ✅ 5 core slash commands (artifacts + file analysis)
  • ✅ 3 specialized sub-agents (artifact, file processor, code auditor)
  • ✅ Deep integration with excel-analyzer

🎯 Features

🪝 Hooks

  • SessionStart: Display environment info and available tools
  • PreToolUse Safety: Warn before dangerous operations
  • PostToolUse: Code quality hints after file modifications

⚡ Slash Commands

  • /artifact-react - Create React applications with 20+ libraries
  • /artifact-excel-analyzer - Excel analysis with formula extraction
  • /artifact-mermaid - Interactive Mermaid diagrams
  • /file-analyze - Universal file analyzer (PDF, Excel, Word, images)
  • /quick-prototype - Rapid prototyping tool

🤖 Sub-Agents

  • artifact-generator - Expert in creating React apps and visualizations
  • file-processor - Excel formula extraction, PDF/image analysis
  • code-quality-auditor - Security and performance analysis

📦 Installation

Option 1: Clone to ~/.claude (Recommended)

# Backup existing configuration
mv ~/.claude ~/.claude.backup

# Clone repository
git clone https://github.com/Yugoge/claude-code-config.git ~/.claude

# Set executable permissions
chmod +x ~/.claude/hooks/*.sh
chmod +x ~/.claude/bin/*

Option 2: Manual Installation

# Download and extract
cd ~
git clone https://github.com/Yugoge/claude-code-config.git
cp -r claude-code-config/.claude ~/

# Set permissions
chmod +x ~/.claude/hooks/*.sh
chmod +x ~/.claude/bin/*

🚀 Quick Start

1. Basic Usage

# In Claude Code, use any slash command
/artifact-react my-dashboard recharts

# Analyze files
/file-analyze data.xlsx "extract formulas"

# Quick prototype
/quick-prototype "sales visualization dashboard"

2. Use Quick Excel

# Use the wrapper script
quick-excel financial-model.xlsx --formulas
quick-excel budget.xlsx --all

3. Customize

Edit configuration files:

  • ~/.claude/CLAUDE.md - Global instructions
  • ~/.claude/settings.json - Permissions and hooks
  • ~/.claude/commands/ - Add your own commands
  • ~/.claude/agents/ - Add your own agents

📁 Structure

~/.claude/
├── CLAUDE.md                    # Global memory and best practices
├── settings.json                # Global settings with hooks
├── CONFIGURATION_SUMMARY.md     # Complete documentation
├── INTEGRATION_GUIDE.md         # Excel-analyzer integration guide
├── hooks/                       # Automation hooks
│   ├── session_start.sh
│   ├── pre_tool_use_safety.sh
│   └── post_tool_use.sh
├── commands/                    # Slash commands
│   ├── artifact-react.md
│   ├── artifact-excel-analyzer.md
│   ├── artifact-mermaid.md
│   ├── file-analyze.md
│   └── quick-prototype.md
├── agents/                      # Sub-agents
│   ├── artifact-generator.md
│   ├── file-processor.md
│   └── code-quality-auditor.md
└── bin/                         # Utility scripts
    └── quick-excel

🎓 Key Capabilities

Artifact Creation (Inherited from Claude.ai Web)

Create standalone interactive applications:

  • ✅ React apps with Tailwind, Recharts, D3.js, TensorFlow.js
  • ✅ Excel analyzers with formula extraction
  • ✅ Mermaid diagrams
  • ✅ Data visualizations

File Processing

Handle multiple file formats:

  • ✅ Excel: Formula extraction, statistics, visualization
  • ✅ PDF: Text extraction, content analysis
  • ✅ Images: Content recognition, OCR
  • ✅ Word: Document conversion
  • ✅ CSV: Data analysis

Code Quality

Professional code review:

  • ✅ Security vulnerability detection
  • ✅ Performance optimization suggestions
  • ✅ Best practices checking

🔒 Security

Built-in security controls:

  • ❌ Block reading .env, credentials, secrets
  • ❌ Block dangerous system commands
  • ⚠️ Confirm before destructive operations
  • 🔒 Fine-grained permission control

📚 Documentation

Detailed documentation available:


🤝 Integration

Works with excel-analyzer

Seamlessly integrated with the excel-analyzer project:

  • Quick CLI analysis via /file-analyze
  • Web visualization via /artifact-excel-analyzer
  • Global quick-excel command

🛠️ Customization

Add Your Own Commands

# Create a new command
cat > ~/.claude/commands/my-command.md << 'EOF'
---
description: My custom command
---

Your command instructions here...
EOF

Add Your Own Agent

# Create a new agent
cat > ~/.claude/agents/my-agent.md << 'EOF'
---
name: my-agent
description: When to use this agent
tools: Read, Write, Bash
---

Your agent system prompt here...
EOF

Add Your Own Hook

# Create a hook script
cat > ~/.claude/hooks/my-hook.sh << 'EOF'
#!/bin/bash
# Your hook logic here
EOF

chmod +x ~/.claude/hooks/my-hook.sh

# Add to settings.json
# Edit ~/.claude/settings.json and add to hooks section

🎯 Best Practices

Keep CLAUDE.md Concise

  • Focus on essential instructions
  • Use "IMPORTANT" for critical rules
  • Include common commands
  • Under 200 lines recommended

Use Hooks Wisely

  • Keep hooks simple and fast
  • Focus on safety and automation
  • Avoid complex logic in hooks

Organize Commands

  • Use namespaces for related commands
  • Provide clear descriptions
  • Include usage examples

🔧 Troubleshooting

Hooks Not Running

chmod +x ~/.claude/hooks/*.sh

Commands Not Showing

Check frontmatter format in command files.

JSON Syntax Errors

python3 -m json.tool ~/.claude/settings.json

📊 Statistics

Total Configuration Files: 20+
├── Hooks: 3
├── Commands: 14 (5 core + 9 existing)
├── Agents: 3
├── CLAUDE.md: 147 lines
└── settings.json: 189 lines

🙏 Credits

Based on:

  • Claude.ai Web artifact capabilities
  • fcakyon/claude-codex-settings - Real-world configuration reference
  • Claude Code official documentation
  • Community best practices

📄 License

MIT License


👨‍💻 Author

Created by Claude Code (Anthropic) for Yugoge


🔗 Related Projects


🚀 Enjoy powerful Claude Code capabilities!

For questions or suggestions, please open an issue on GitHub.

About

Professional Claude Code global configuration with hooks, commands, and sub-agents. 专业的 Claude Code 全局配置,包含 hooks、命令和子代理。

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Shell 84.5%
  • Python 15.5%