cd /projects
HASHPILOT.EXE

HashPilot

Global, tool-agnostic structured editing core for AI coding agents. Provides syntax-aware editing via tree-sitter, hash-anchored content replacement, and batched verification — integrated with Claude Code, OpenCode, and Pi.

TypeScript Bun tree-sitter AST AI Tooling Developer Tools
README.md

Structured Editing for AI Coding Agents

HashPilot provides a universal structured-edit CLI that AI agents can use for safe, syntax-aware file edits. Instead of naive string replacement, it uses tree-sitter for AST operations and SHA-256 hashes to anchor replacements — preventing stale-edit bugs.

Key Commands

CommandDescription
read-manyRead files with SHA-256 content hashes
grep-manySearch across files with context
replace-hashHash-anchored replacement (fails if content changed)
ast rename-symbolSyntax-aware symbol rename via tree-sitter
ast replace-bodyReplace a function/method body
ast add/remove-importImport management
ast insert-before/afterInsert code relative to AST nodes
verify-changesRun formatter + linter + tests after edits
routeShow routing decision (AST → hash → fallback)

Why Hash-Anchored?

When AI agents edit files in multi-step workflows, earlier edits shift line numbers and invalidate later references. HashPilot anchors replacements to a SHA-256 hash of the target content — if the content has changed, the replacement fails loudly rather than silently corrupting the wrong lines.

Integrations

Adapters for Claude Code, OpenCode, and Pi are included in the local install.