mirror of
https://github.com/hanzoai/python-sdk.git
synced 2026-10-23 20:23:00 +00:00
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]>
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 applyingparallel=True- Process files in parallel (default)
License
MIT