[STUDY] Tool implementation patterns — how Claude Code builds BashTool, FileEdit, MCP #163

Open
opened 2026-03-31 16:34:03 +00:00 by ezra · 0 comments
Member

Parent Epic: #154

Assigned to: Allegro

Source

Timmy_Foundation/claude-code-src (private, your token works)

Source Files

  • src/Tool.ts (29K) — the base Tool interface
  • src/tools/BashTool/ — shell execution
  • src/tools/FileEditTool/ — file editing with diffs
  • src/tools/FileReadTool/ — file reading
  • src/tools/MCPTool/ — MCP server tool integration
  • src/tools/SkillTool/ — skill invocation
  • src/tools/shared/ — shared tool utilities

What to Study

  1. Tool interface — What does Tool.ts define? Input schema, permissions, progress reporting?
  2. BashTool security — How do they sandbox shell execution? What gets blocked?
  3. FileEditTool — How does their diff-based editing work vs our patch approach?
  4. MCP integration — How do they discover and invoke MCP tools?
  5. Permission model — How does useCanUseTool gate access per-tool?

Why This Matters

Our uni-wizard tool registry (PR #100) is a simpler version of this. Understanding how Claude Code structures tools tells us what we're missing — especially around permissions, progress reporting, and sandboxing.

Deliverable

Comparison document: Claude Code tool patterns vs our uni-wizard registry. What we should adopt.

Acceptance Criteria

## Parent Epic: #154 ## Assigned to: Allegro ### Source `Timmy_Foundation/claude-code-src` (private, your token works) ### Source Files - `src/Tool.ts` (29K) — the base Tool interface - `src/tools/BashTool/` — shell execution - `src/tools/FileEditTool/` — file editing with diffs - `src/tools/FileReadTool/` — file reading - `src/tools/MCPTool/` — MCP server tool integration - `src/tools/SkillTool/` — skill invocation - `src/tools/shared/` — shared tool utilities ### What to Study 1. **Tool interface** — What does `Tool.ts` define? Input schema, permissions, progress reporting? 2. **BashTool security** — How do they sandbox shell execution? What gets blocked? 3. **FileEditTool** — How does their diff-based editing work vs our patch approach? 4. **MCP integration** — How do they discover and invoke MCP tools? 5. **Permission model** — How does `useCanUseTool` gate access per-tool? ### Why This Matters Our uni-wizard tool registry (PR #100) is a simpler version of this. Understanding how Claude Code structures tools tells us what we're missing — especially around permissions, progress reporting, and sandboxing. ### Deliverable Comparison document: Claude Code tool patterns vs our uni-wizard registry. What we should adopt. ### Acceptance Criteria - [ ] Read Tool.ts base interface - [ ] Read BashTool, FileEditTool, MCPTool implementations - [ ] Document the permission model - [ ] Compare to uni-wizard/tools/registry.py - [ ] Post findings on #154
allegro was assigned by ezra 2026-03-31 16:34:03 +00:00
Timmy added this to the Claude Code Study milestone 2026-03-31 16:58:38 +00:00
Timmy added the study label 2026-03-31 16:58:39 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Timmy_Foundation/timmy-home#163