claude-code-optimizer
Claude Code Optimizer
Audit and optimize Claude Code installations. Requires Claude Code 2.1.3 or later.
Quick Start
Run the appropriate audit based on user request:
- Full audit: Invoke
audit-orchestratoragent for comprehensive review - Specific audit: Invoke specialized agent directly (see Agents below)
- Quick check: Run inline checks from Audit Checklist
Agents
Invoke via Task tool with appropriate subagent_type:
| Agent | Purpose |
|---|---|
audit-orchestrator |
Coordinates full audit across all areas |
config-auditor |
Audits settings.json and CLAUDE.md files |
hooks-auditor |
Audits hook configurations |
permissions-auditor |
Audits permission patterns |
workflow-auditor |
Audits commands, agents, and skills |
mcp-auditor |
Audits MCP server configurations |
Agent definitions are in agents/ directory. Install to ~/.claude/agents/ or .claude/agents/.
Audit Checklist
Configuration Files
Check these locations exist and are properly configured:
~/.claude/settings.json # User settings
.claude/settings.json # Project settings
CLAUDE.md # Project memory (root)
.claude/CLAUDE.md # Alternative location
CLAUDE.local.md # Local overrides (gitignored)
~/.claude/CLAUDE.md # User-level memory
Settings.json Structure
Valid top-level keys (2.1.3+):
hooks- Event handlerspermissions- Tool permissions (allow/deny arrays)env- Environment variablesmcpServers- MCP server configurationsmodel- Default modeltheme- UI themerespectGitignore- File picker behaviorlanguage- Response languagefileSuggestion- Custom@file search commandreleaseChannel-stableorlatestchannel toggle
Hook Events (2.1.0+)
Valid event names:
PreToolUse,PostToolUse,PostToolUseFailure,PermissionRequestNotification,UserPromptSubmitSessionStart,SessionEndStop,SubagentStart,SubagentStop,PreCompact
Tool Names for Matchers
Bash,Read,Write,EditGrep,Glob,Task,TaskOutputWebFetch,WebSearchNotebookEdit,TodoWrite,KillShellLSP(Language Server Protocol, 2.0.74+)mcp__*for MCP tools (wildcard:mcp__server__*)
Permission Patterns
{
"permissions": {
"allow": ["Read", "Grep", "Glob"],
"deny": ["Bash(rm -rf:*)"]
}
}
Wildcard syntax: Bash(git *:*) allows all git commands.
Common Issues
| Issue | Fix |
|---|---|
| Hooks not firing | Check event name spelling (case-sensitive) |
| Skills not loading | Verify ~/.claude/skills/ or .claude/skills/ path |
| Permissions ignored | Check allow/deny order; deny takes precedence |
| CLAUDE.md not read | Must be in project root or .claude/ |
References
For detailed audit procedures, see:
references/config-guide.md- Configuration deep-divereferences/hooks-guide.md- Hook patterns and examplesreferences/permissions-guide.md- Permission strategiesreferences/security-guide.md- Security audit proceduresreferences/troubleshooting.md- Common problems and solutions
Version Compatibility
This skill targets Claude Code 2.1.3+ features:
- Skill hot-reload
- Forked sub-agent context (
context: fork) - Hook frontmatter in skills/agents with
once: trueoption - YAML-style allowed-tools
- Unreachable permission rule detection
- MCP wildcard permissions (
mcp__server__*) - Named sessions (
/rename,/resume <name>) - Release channel configuration
Check version: claude --version
Update: claude update
More from diegosouzapw/awesome-omni-skill
music-assistant
Control Home Assistant Music Assistant - browse library, search, play, manage preferences and moods.
12agent-code-generator
Generates Agent definitions (.md files) based on user intent and standard templates.
6terragrunt-generator
Comprehensive toolkit for generating best practice Terragrunt configurations (HCL files) following current standards and conventions. Use this skill when creating new Terragrunt resources (root configs, child modules, stacks, environment setups), or building multi-environment Terragrunt projects.
6api contract sync manager
Validate OpenAPI, Swagger, and GraphQL schemas match backend implementation. Detect breaking changes, generate TypeScript clients, and ensure API documentation stays synchronized. Use when working with API spec files (.yaml, .json, .graphql), reviewing API changes, generating frontend types, or validating endpoint implementations.
5api-integration-architect
Expert in API integration with React Query, SWR, RTK Query, REST/GraphQL clients, WebSocket real-time, optimistic updates, caching strategies, and error handling
5typescript-advanced-types
Master TypeScript's advanced type system including generics, conditional types, mapped types, template literals, and utility types for building type-safe applications. Use when implementing complex...
5