code-surgeon is an AI skill that transforms GitHub issues and requirements into precise, step-by-step implementation plans with surgical prompts—ready to use with Claude or any other AI agent.
- code-surgeon breaks down the work into phases and tasks with clear dependencies
- Analyzes your entire codebase automatically
- Respects your team's conventions
- Identifies breaking changes proactively
- Generates precise, file-by-file prompts
- Provides 3 output formats for different use cases
- QUICK mode: ~$0.04
- STANDARD mode: ~$0.10
- DEEP mode: ~$0.17
Much cheaper than 30-40 minutes of manual planning.
- QUICK mode: 85% accuracy (scoped changes)
- STANDARD mode: 95% accuracy (normal features)
- DEEP mode: 99% accuracy (complex changes)
Always review the plan before using prompts.
~/.claude/skills/code-surgeon/
No, it's plug-and-play. But creating .claude/team-guidelines.md helps quality.
No, it needs to be in your Claude skills directory to work.
Partially. When you pass a GitHub URL (/code-surgeon "https://github.com/org/repo/issues/234"), the skill fetches the issue content from the GitHub API — this is an external network call. GitHub issue content is treated as untrusted external data.
Your codebase is processed through your existing Claude session — the same channel used for all Claude Code interactions. No additional third-party services receive your code. Only the GitHub issue metadata (title, description, labels) is fetched from GitHub's API, and only when you explicitly provide a GitHub URL. Plain-text requirements (/code-surgeon "Add JWT refresh") trigger no external calls beyond your Claude session.
- QUICK: 5 minutes
- STANDARD: 15 minutes (default)
- DEEP: 30 minutes
Yes! Session is saved. Resume with /code-surgeon-resume <session-id>
Yes! Pass the GitHub URL: /code-surgeon "https://github.com/org/repo/issues/234"
code-surgeon will do its best, but clearer requirements = better plans.
Technically yes, but it's overkill. Use for multi-file changes.
See USAGE.md for the 4-question decision framework.
- Summary and research findings
- Design choices with rationale
- Implementation phases and tasks
- Surgical prompts (ready to copy-paste)
- Breaking changes analysis
- Verification checklist
- PLAN.md - Read by humans, review and edit
- plan.json - Structured data, for tools/CI/CD
- interactive.json - Step-through CLI mode
Yes! They're just text. Edit freely for your needs.
.claude/planning/sessions/surgeon-<id>/
├── PLAN.md
├── plan.json
├── interactive.json
└── logs/
Any git-based repository with clear structure. Monorepos supported.
No practical limit. code-surgeon uses smart file selection.
Yes! Detects Lerna, Turborepo, yarn workspaces.
Your codebase is processed exclusively through your existing Claude session — the same channel used for all Claude Code interactions. No additional third-party services receive your code. The only separate external call is when you use GitHub issue URLs: the issue's public metadata is fetched from the GitHub API. Private repository issues require authentication and are not accessible without your GitHub token.
Yes. Your codebase is processed exclusively through your Claude session (same as standard Claude Code). No additional third-party API calls are made beyond your existing Claude session. Create .claude/team-guidelines.md to enforce your security rules.
35+ frameworks including React, Django, Express, Rails, Vue, Angular, Flask, FastAPI, and many more.
Mention it explicitly: /code-surgeon "Feature X using [framework]"
Yes! Works with monorepos and multi-service architectures.
Yes! Detects versions from package managers and applies version-specific guidance.
- PM creates GitHub issue
- Developer runs code-surgeon
- Team reviews PLAN.md
- Developer executes tasks with surgical prompts
- Reference PLAN.md in PR: "Follows implementation plan from code-surgeon #234"
Yes! Create .claude/team-guidelines.md with your team's rules. code-surgeon will:
- Load it automatically
- Incorporate into surgical prompts
- Validate against it
- Flag violations
- PLAN.md - Optional, reference in PR
- state.json - No, it's temporary
- plan.json - Optional, for CI/CD integration
- API breaking changes - Signature changes, removed endpoints
- Data breaking changes - Schema changes, migrations
- Behavior breaking changes - Behavior alterations affecting users
- Dependency breaking changes - Version conflicts, removal
Analyzes:
- Type signatures
- Function parameters
- Data structures
- API responses
- Dependency versions
Yes! These are expert-generated warnings based on impact analysis.
- SKILL.md loading: ~12K tokens (once per session)
- Per phase: ~8K tokens
- Total typical session: ~22K tokens
You have ~100K tokens available, so plenty of room.
No. Only the skill file gets loaded initially, then sub-skills as needed.
Yes. Total time: 5-30 minutes depending on depth mode.
Yes! Saves 25-30% of tokens on repeated analyses in same repo.
- Check installation:
~/.claude/skills/code-surgeon/ - Restart Claude after installing
- Verify SKILL.md exists
chmod -R 755 ~/.claude/skills/code-surgeon- Ensure session ID is correct
- Check
.claude/planning/sessions/exists - Verify state.json is not corrupted
The Risk Analyzer (Phase 6) flags detected secrets and PII as HIGH severity risks — it identifies them in your codebase but does not output their raw content. This includes:
- Hardcoded API keys, tokens, and passwords
- Email addresses and personal data in source files
- Private keys or credentials in config files
To resolve: Remove or move the flagged secrets to environment variables, then re-run.
- Try DEEP mode for more thorough analysis
- Check codebase is accessible
- Verify team guidelines aren't conflicting
- Verify package manager file exists (package.json, go.mod, etc.)
- Check monorepo indicator file (lerna.json, turbo.json, etc.)
Not yet, but the JSON output is designed for tool integration.
Yes! Create .claude/team-guidelines.md to guide analysis.
Mention in team guidelines:
## Framework: [YourFramework]
- [Patterns to follow]
- [Code examples]Yes! It analyzes what exists and works within current patterns.
Yes! Use: /code-surgeon "Refactor [module] to [goal]"
MIT - Free to use, modify, distribute.
Yes! MIT license allows commercial use.
Yes! MIT license allows modifications.
github.com/baagad-ai/code-surgeon
- 📖 Read USAGE.md for command reference
- 🏗️ Read ARCHITECTURE.md for technical details
- 📚 Read EXAMPLES.md for real-world scenarios
- 🛠️ Read FRAMEWORKS.md for framework details
- 💻 Check SKILL.md for complete reference
Or create a GitHub issue if you think you found a bug!
Last Updated: February 12, 2026 Version: 1.0.0