Batch edit
batch_edit
BatchEditTool — atomic batch file editing for AI agents.
Registered as batch_edit via the axm.tools entry point.
BatchEditTool
Atomic batch file editing for AI agents.
Replaces, creates, and deletes files in a single atomic operation.
Registered as batch_edit via axm.tools entry point.
Source code in packages/axm-edit/src/axm_edit/tools/batch_edit.py
name
property
Tool name used for MCP registration.
execute(*, path='.', operations=None, lint=True, lint_diff=True, lint_diff_max_ratio=0.5, **kwargs)
Execute a batch of file operations atomically.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str
|
Project root directory. |
'.'
|
operations
|
list[dict[str, object]] | None
|
List of operation dicts with |
None
|
lint
|
bool
|
Run ruff --fix on changed Python files after apply. |
True
|
lint_diff
|
bool
|
Surface per-file diffs of post-lint mutations. |
True
|
lint_diff_max_ratio
|
float
|
Fallback threshold (diff / file size). |
0.5
|
Returns:
| Type | Description |
|---|---|
ToolResult
|
ToolResult with applied counts and the |
ToolResult
|
payload (a JSON string, not a SHA) to pass back to |
ToolResult
|
|
Source code in packages/axm-edit/src/axm_edit/tools/batch_edit.py
render_text(result, parsed, data)
Render a compact, git-style LLM-facing view of a batch result.
The header carries the global status — ✓ on success, or
✗ ROLLBACK on failure so a partial/aborted batch is impossible to
miss — followed by the modified/created/deleted/edits counts. Each
operated-on file is then listed with its op sigil and edit count, every
validation error is surfaced verbatim, and the full lint summary
(fixes, remaining errors, warnings, diffs) is appended. Nothing in
data is dropped; only its JSON structure is.