- Add new 00-claude-code-setting skill for token usage optimization - Includes audit scripts for MCP servers, CLAUDE.md, and extensions - Auto-fix capability with backup for serverInstructions and frontmatter - Add YAML frontmatter to 17 command files - Target: keep baseline under 30% of 200K context limit Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
69 lines
1.8 KiB
Bash
Executable File
69 lines
1.8 KiB
Bash
Executable File
#!/bin/bash
|
|
# Claude Code Settings Optimizer - Installation Script
|
|
|
|
set -e
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
CLAUDE_DIR="${HOME}/.claude"
|
|
|
|
echo "Claude Code Settings Optimizer - Installer"
|
|
echo "==========================================="
|
|
echo ""
|
|
|
|
# Create directories
|
|
echo "Creating directories..."
|
|
mkdir -p "${CLAUDE_DIR}/commands"
|
|
mkdir -p "${CLAUDE_DIR}/scripts/settings-audit"
|
|
mkdir -p "${CLAUDE_DIR}/references"
|
|
|
|
# Install command
|
|
echo "Installing /settings-audit command..."
|
|
cp "${SCRIPT_DIR}/commands/settings-audit.md" "${CLAUDE_DIR}/commands/"
|
|
|
|
# Install scripts
|
|
echo "Installing scripts..."
|
|
cp "${SCRIPT_DIR}/scripts/"*.py "${CLAUDE_DIR}/scripts/settings-audit/"
|
|
chmod +x "${CLAUDE_DIR}/scripts/settings-audit/"*.py
|
|
|
|
# Install references
|
|
echo "Installing references..."
|
|
cp "${SCRIPT_DIR}/references/"*.md "${CLAUDE_DIR}/references/"
|
|
|
|
# Check Python
|
|
echo ""
|
|
echo "Checking Python..."
|
|
if command -v python3 &> /dev/null; then
|
|
echo " Python 3: $(python3 --version)"
|
|
else
|
|
echo " Warning: Python 3 not found"
|
|
fi
|
|
|
|
# Check PyYAML (optional)
|
|
if python3 -c "import yaml" 2>/dev/null; then
|
|
echo " PyYAML: installed"
|
|
else
|
|
echo " PyYAML: not installed (optional)"
|
|
echo " Install with: pip3 install pyyaml"
|
|
fi
|
|
|
|
echo ""
|
|
echo "Installation complete!"
|
|
echo ""
|
|
echo "Installed to:"
|
|
echo " Command: ${CLAUDE_DIR}/commands/settings-audit.md"
|
|
echo " Scripts: ${CLAUDE_DIR}/scripts/settings-audit/"
|
|
echo " References: ${CLAUDE_DIR}/references/"
|
|
echo ""
|
|
echo "Usage:"
|
|
echo " In Claude Code: /settings-audit"
|
|
echo ""
|
|
echo " Or run directly:"
|
|
echo " python3 ${CLAUDE_DIR}/scripts/settings-audit/run_audit.py"
|
|
echo ""
|
|
echo " Auto-fix (preview):"
|
|
echo " python3 ${CLAUDE_DIR}/scripts/settings-audit/auto_fix.py"
|
|
echo ""
|
|
echo " Auto-fix (apply):"
|
|
echo " python3 ${CLAUDE_DIR}/scripts/settings-audit/auto_fix.py --apply"
|
|
echo ""
|