Optimizing Claude Code
Agent Buildingoptimizing-claude-codeOptimizing Claude Code is an Agent Skill for agent building published in the CodeAlive-AI/ai-driven-development repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.
Audits repositories for Claude Code readiness and suggests improvements. Use when asked to check CLAUDE.md quality, review settings, audit project organization, or optimize for agentic work.
How to use this skill
Bring this guide into your coding agent with a prompt tailored to the tool you use.
- Open your project in Codex.
- Copy and paste the prompt below.
- Review files and risks before approving any action.
Inspect the Agent Skill at https://github.com/CodeAlive-AI/ai-driven-development/blob/HEAD/skills/optimizing-claude-code/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/optimizing-claude-code, but wait for my approval before writing files or running scripts.
Copying this prompt does not install or run the skill. Review third-party files before use.
Optimizing Claude Code
Default: Audit-only. Present findings and await approval before modifying files.
Workflow
1. Run Audit
Execute from repo root:
python scripts/audit_repo.py --root . --include-user-scope
Analyzes:
- Repository scale and directory hotspots
- CLAUDE.md files (discovery, quality, @imports)
- Settings (user/project/local scopes)
- MCP configurations
- Skills and subagents
2. Generate Report
Structure output as:
Executive Summary (5 bullets max)
- Readiness assessment
- Key strengths
- Critical gaps
- Priority actions
Repository Profile
- File count and scale (Small/Medium/Large)
- Primary language/framework
Memory Files Assessment
- Per-file metrics
- @import validation
- Content quality
- Staleness indicators
Settings & Configuration
- Permissions analysis
- MCP server inventory
- Skills/subagents discovered
Issues by Priority
- P0: Blocks agentic work
- P1: High impact
- P2: Nice-to-have
Recommendations
- Specific suggested edits
- Reference best practices
- Do NOT apply without approval
3. Apply Changes (If Requested)
When asked to implement:
- Confirm which changes
- Edit incrementally
- Show diffs
- Re-audit to verify
Large Repository Guidance
When file count exceeds 3000, include scaling recommendations:
- Vanilla context becomes unreliable at scale
- Consider context engines or retrieval layers
- Strategic CLAUDE.md placement becomes critical
- Focus on navigation aids over exhaustive documentation
Reference Files
- best-practices.md: Environment setup, CLAUDE.md structure, prompting patterns, workflows, safety
- rubric.md: CLAUDE.md scoring criteria (0-16 scale), anti-patterns, templates
- checklist.md: Step-by-step audit workflow, prioritization guide