Files
zeekay 8c05bf99d6 fix(ci): pin black <26.1 to avoid internal error, lower requires-python to 3.12
Black 26.1.0 crashes on multiple exception types in parentheses.
The requires-python bump to 3.14 broke CI which runs Python 3.12.
2026-03-01 16:01:16 -08: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