Files
zeekayandHanzo Dev 234c2d8cf1 Prefer tgrep where the tree carries an index
Trigram index prunes files a query cannot match: 23ms against ripgrep's 78ms
for an absent symbol, which is most of what a search asks. It loses where many
files match (128ms against 78ms), and with no index it scans everything and is
slower than plain grep — so the index is the condition, not the binary.

Co-authored-by: Hanzo Dev <[email protected]>
2026-09-10 17:24:51 -07:00
..
2025-12-27 15:00:11 -08:00

hanzo-tools-refactor

Advanced refactoring tools for Hanzo MCP.

Installation

pip install hanzo-tools-refactor

Tools

refactor - Code Refactoring

AST/LSP-based refactoring with parallel processing.

Rename symbol:

refactor(action="rename", file="/f.py", line=10, column=5, new_name="newName")

Batch rename:

refactor(
    action="rename_batch",
    renames=[{"old": "foo", "new": "bar"}],
    path="./src"
)

Extract function:

refactor(
    action="extract_function",
    file="/f.py",
    start_line=10,
    end_line=20,
    new_name="extracted_function"
)

Extract variable:

refactor(
    action="extract_variable",
    file="/f.py",
    line=10,
    column=5,
    new_name="extracted_var"
)

Inline:

refactor(action="inline", file="/f.py", line=10, column=5)

Move:

refactor(action="move", file="/f.py", line=10, target_file="/new.py")

Change signature:

refactor(
    action="change_signature",
    file="/f.py",
    line=10,
    add_parameter={"name": "x", "default": "None"}
)

Find references:

refactor(action="find_references", file="/f.py", line=10, column=5)

Organize imports:

refactor(action="organize_imports", file="/f.py")

Options

  • preview=True - Preview changes without applying
  • parallel=True - Process files in parallel (default)

License

MIT