Search, understand, and modify code with approvals
Reader tools for scoped code search and file inspection. Writer tools with approval gates for safe patch proposals and automated refactoring.
What Code Tools do
Code Tools let you search, read, and understand codebases programmatically. Writer tools propose patches and refactorings that pause for your approval before applying. Evaluation hooks run unit tests to verify changes before they're finalized.
Reader capabilities
- Scoped code search with regex and semantic hints
- File read with syntax highlighting and line numbers
- Symbol listing (functions, classes, imports)
Writer capabilities Gated
- Propose patches with diff preview (requires approval)
- Format code and apply style fixes (gated)
- Trigger evaluation test runs for verification
Who benefits from Code Tools
Individuals
Quick refactors with guardrails—preview diffs before applying
Teams & Managers
Repeatable code maintenance workflows with diff approvals
Developers & IT
Structured patch proposals and CI-friendly outputs
Security & Compliance
Write gates, diffs, and logs of every change
How it works
Read: Locate and display code
Use code.search to find files or symbols, then code.read_file to inspect contents.
Propose: Generate diff
Call code.propose_patch with the desired changes. The orchestrator pauses and shows you a diff preview.
Approve: Review and consent
You review the diff and approve or reject. Only approved patches are applied.
Verify: Run tests
Trigger eval.run_unit_tests to confirm the patch doesn't break existing functionality.
Example workflows
Add input validation + tests
Approval required"Add input validation to the user registration module and write unit tests"
- code.search (locate registration module)
- code.propose_patch (add validation logic) — pauses for approval
- eval.run_unit_tests (stub tests to confirm structure)
Diff preview, approval timestamp, test results, and audit log entry
Grep-like code search
Read-only"Find all functions that call the deprecated API"
- code.search (regex: "deprecatedAPI\(")
- Return list of files and line numbers
List of matches with file paths, line numbers, and surrounding context
Automated style fixes
Approval required"Format all TypeScript files in src/ with Prettier"
- code.search (find all .ts files in src/)
- code.propose_patch (apply formatting) — pauses for approval
- Apply changes after approval
Formatted files with diff summary and approval log
Technical details
Key tools
- code.search
- code.read_file
- code.list_symbols
- code.propose_patch (gated)
- code.format (gated)
Configuration
CODE_WRITE_ENABLE— false (default)PATH_ALLOWLIST— scoped directoriesMAX_DIFF_SIZE— lines per patchSEARCH_TIMEOUT— max search duration
Performance notes
- Search: typically 100-500ms for medium codebases
- Patch generation: 1-3 seconds depending on complexity
- Test runs: depends on test suite size
Observability
- Patch counts and approval latency
- Test outcomes (pass/fail/skip)
- Search query performance
- Write rejection counters
Security posture
No writes without approval
All patch proposals pause for explicit consent. Diffs are previewed before applying.
Path allowlists
Writes are scoped to allowlisted directories. Attempts to modify files outside the allowlist are rejected.
Audit logs
Every search, read, and write is logged with timestamps and approval decisions.
Max diff size limits
Patches exceeding the max diff size are rejected to prevent accidental large-scale changes.
Roadmap & status
Current features
- Code search and file reading
- Patch proposals with diff preview
- Evaluation hooks for test runs
Coming soon
- Containerized build and test environments
- Repo federation for remote code access
- Advanced refactoring primitives
Frequently asked questions
Ready to refactor safely?
Install MCP and start proposing code changes with approval gates and audit logs