Skip to content

Comments

feat: Implement Edit tool with exact string replacement#61

Merged
edenreich merged 3 commits intomainfrom
claude/issue-54-20250817-0108
Aug 17, 2025
Merged

feat: Implement Edit tool with exact string replacement#61
edenreich merged 3 commits intomainfrom
claude/issue-54-20250817-0108

Conversation

@edenreich
Copy link
Contributor

Implements the Edit tool as specified in issue #54

This PR adds a new built-in Edit tool that enables exact string replacements in files with comprehensive safety rules:

  • Requires Read tool usage before editing (conversation-scoped tracking)
  • Supports single and bulk replacements with replace_all parameter
  • Validates string uniqueness to prevent unintended modifications
  • Works only with existing files for safety
  • Integrates with security exclusion patterns
  • Provides detailed execution metrics

Testing

Includes 100+ comprehensive unit tests covering:

  • All validation scenarios and edge cases
  • Successful edit operations (single & bulk)
  • Error conditions and safety checks
  • Integration with Read tool tracking
  • Security path exclusions

Architecture

Follows existing tool patterns with:

  • Registry-based Read tool usage tracking
  • Configuration system integration
  • Proper domain models and interfaces
  • Comprehensive error handling

Closes #54

Generated with Claude Code

claude bot and others added 3 commits August 17, 2025 01:17
Add Edit tool that enables exact string replacements in files with strict safety rules:

- Requires Read tool to be used at least once before editing
- Supports single and bulk replacement with replace_all parameter  
- Validates string uniqueness to prevent unintended edits
- Only works with existing files for safety
- Follows security exclusion patterns like other tools
- Provides detailed result metrics (replaced count, file modification status, size changes)

Key features:
- Registry-based Read tool usage tracking
- Comprehensive validation and error handling
- Support for both single and multiple string replacements
- Integration with existing tool configuration system
- Extensive unit test coverage (100+ test cases)

Co-authored-by: Eden Reich <edenreich@users.noreply.github.com>
Signed-off-by: Eden Reich <eden.reich@gmail.com>
Signed-off-by: Eden Reich <eden.reich@gmail.com>
@edenreich edenreich merged commit bfe19e9 into main Aug 17, 2025
1 check passed
@edenreich edenreich deleted the claude/issue-54-20250817-0108 branch August 17, 2025 01:37
ig-semantic-release-bot bot pushed a commit that referenced this pull request Aug 17, 2025
## [0.21.0](v0.20.0...v0.21.0) (2025-08-17)

### 🚀 Features

* Implement Edit tool with exact string replacement ([#61](#61)) ([bfe19e9](bfe19e9)), closes [#54](#54) [#54](#54)
@ig-semantic-release-bot
Copy link

🎉 This PR is included in version 0.21.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Implement Edit Tool

1 participant