Heddle
cargo install heddle-cli
heddle bridge git-import .
Heddle is an AI-native version control system written in Rust. It combines content-addressed storage, immutable history with stable change identifiers, explicit human and agent attribution, and a Git-overlay mode that drops into existing repositories without changing storage or remote model on day one.
The main public on-ramp is Git-overlay adoption: drop heddle into an existing Git repository and get thread-first agent workflows, local captures, provenance-aware inspection, and explicit Git checkpoints without changing your team's storage or remote model on day one.
In a normal Git repo, heddle now auto-adopts:
- the current checkout and dirty state
- the active local branch as the current Heddle lane
- other local branch tips as lightweight thread mirrors
That means heddle status, heddle thread list, and heddle workspace show work immediately in an existing Git repo. Full heddle bridge git import is still the explicit step when you want deeper history import, richer ancestry, and fuller compare/log behavior across those branches. If you only need one Git-only branch to become a full Heddle history lane, use heddle bridge git import --ref <branch>.
Git tags stay explicit: heddle show <tag> and other history-oriented commands will tell you to import just that tag with heddle bridge git import --ref <tag> when needed.
The repository is being organized around two binaries:
heddlefor local repository work plus hosted client operationshostedfor hosted server and admin operations
Why Heddle?
Git was built for human-only workflows. Modern teams now need stronger answers to problems Git and Git hosting still treat as incidental:
- Stable change identity - logical changes keep durable IDs even when history is rebased, collapsed, or force-pushed
- Explicit human and AI attribution - every state can carry principal identity, agent provider/model, confidence, and verification metadata
- Attached reasoning - rule, why, gotcha, and migration guidance can travel with the code they govern instead of disappearing into PR comments and chat logs
- Hosted control plane - namespaces, repositories, grants, and access inheritance are first-class, not bolted on around a flat repo list
- Repository intelligence - hosted surfaces can inspect history, trust, and operational state from one place
- Git interoperability - Heddle can import, export, and sync with Git so adoption can be incremental
Heddle's CLI follows five operating principles ā trust, disposability, composability, restraint, honesty. They're documented in docs/PRINCIPLES.md, and heddle doctor docs keeps the docs honest about the actual CLI surface.
Capability Status
Shipped
- Content-addressed immutable state model
- Stable change identifiers
- Threads and markers
- Explicit principal and agent attribution
- Provenance-backed local blame with rewrite preservation across snapshot, collapse, and merge flows
- Semantic diff support
- Git bridge and remote sync
- Multi-agent worktrees and agent registry
Foundation in place
- Hosted namespaces, repositories, and grants
- Hosted web product for repository inspection and operations
- Repository and namespace views backed by hosted content/admin APIs
- Revisable context annotations as a core Heddle concept, with CLI, hosted APIs, and state-aware web inspection in place
- Hosted provenance and context read APIs for file and change inspection
- Hosted context write APIs for create, revise, supersede, and suggestion-backed inspection
- Verification and trust metadata across CLI, server, and web layers
Planned
- Full compare and review surfaces in the web app
- First-class history graph UX
- Provenance-aware compare and review workflows beyond current file/change inspection
- Hosted builds, workflows, logs, artifacts, and verification writeback
- Global search and command palette
- Partial clone and lazy object retrieval
Quick Start
# In an ordinary Git repo, Heddle can bootstrap its sidecar on first use
# Initialize a new repository
# Start a thread
# Capture a recoverable sub-commit step with intent
# Bundle the current capture chain into the Git-facing commit boundary
# Inspect the current thread
# Preview integration
# Merge and push the current thread
# View history
# Inspect a thread or state
# Compare two states
Core Concepts
| Concept | Description |
|---|---|
| State | Immutable snapshot of a repository at a point in time |
| ChangeId | Stable logical identifier that survives rewrites |
| ContentHash | BLAKE3 hash of object contents for integrity and deduplication |
| Thread | Mutable named reference to a state |
| Marker | Immutable named reference to a state |
| Principal | Human identity accountable for a change |
| Agent | Model identity associated with a change |
| Namespace | Hosted organizational container for repositories and grants |
| Grant | Hosted access rule applied to a namespace or repository |
Installation
From source
Prerequisites
- Rust 1.85+
cargo,rustfmt,clippy
Common Commands
Core thread workflow
Thread maintenance
Advanced workflow and automation
The simplified operator loop is documented in docs/OPERATOR_LOOP.md.
Recommended first-run loop in an existing Git repo:
heddle status should tell you which branch or thread you are on, what is dirty, whether another operation is in progress, and the primary recommended next step. The same recommended next step is then carried through diagnose, thread show, and workspace show via the JSON/text recommended_action surface.
Advanced debugging and provenance
History, inspection, and maintenance
Markers
Remote and Git bridge
Thread workflow
Important current behavior:
heddle startis the public entrypoint for starting work;--workspace heavycreates a real checkout,--workspace lightuses the virtualized filesystem path, and--pathplaces a heavy checkout somewhere explicit- in a plain Git repository,
heddle statusbootstraps Heddle sidecar storage under.heddle/, adopts the active Git branch as the current Heddle thread, and reports dirty files immediately heddle initin a Git-backed repository uses the same sidecar model explicitly if you want to opt in ahead of first status/diagnose usageheddle capturerecords a fine-grained recoverable step for undo, provenance, and review; this is the thing agents should do after a turn, before the work is ready to become public historyheddle checkpointbundles the current capture chain into the Git-facing commit boundary and records the mapping back to the Heddle change IDheddle thread captures <thread>shows the granular capture trail behind a thread, whileheddle thread show <thread>includes the latest captures inline- in git-overlay repositories,
heddle shipauto-checkpoints the integrated result into Git after a clean merge path - in git-overlay repositories,
heddle clone,heddle fetch,heddle pull, andheddle pushuse Heddle's native Git plumbing for local/file and network Git remotes; nogitbinary is required for normal overlay flows heddle fsck --bridgevalidates the Git-overlay mirror, mapping sidecar, Heddle notes, thread refs, and attached checkout branchheddle agent reserve|heartbeat|release|listprovides a JSON-first reservation API so external agents can coordinate one writer per thread without scraping human outputheddle bridge git importdefaults--pathto the current repo, and you can still point it at another local repo or URL with--path <path-or-url>- Git tags are not auto-adopted as threads; import them explicitly with
heddle bridge git import --ref <tag>when you want full Heddle history semantics for a tag target autodefaults to a Heddle-managed heavy checkout; the managed-vs-custom distinction is just path placement, not a separate workspace modeheddle workspace showis the repo-wide control tower; it groups current, stacked, parallel, ready, blocked, and recently merged threadsheddle diagnosegives a one-command local handoff packet: repository, current thread, actor/session context, dirty paths, workspace counts, health, next command, and optional read-path timing with--profileheddle readycaptures outstanding work if needed, evaluates semantic merge readiness, and moves the thread toreadyorblockedheddle statusacts as the control tower, including thread health and the next recommended commandheddle thread show/list/refresh/move/absorb/resolve/promote/dropprovide the expert maintenance surface for thread lifecycle and work shapingheddle thread show --watchandheddle status --watchkeep the same thread-first mental model for live updatesheddle capture --split --into <thread> --path <path>moves selected dirty paths into another thread without forcing Git-style branch surgery- lightweight threads track base root, lifecycle, changed paths, impact categories, task metadata, freshness, and promotion warnings in persisted thread records
heddle merge <thread> --previewnow produces a structured decision report with blockers and a recommended next step- plain
heddle pushpushes the current attached thread by default heddle undoandheddle redooperate on the current thread only, using the active checkout scope
Agent-Friendly Output
Heddle is designed for programmatic use by agents and automation.
See .agents/agent-workflows.md for workflow guidance and caveats.
Configuration Model
Heddle uses four scopes:
UserConfigfor user identity, agent defaults, output preferences, auth profiles, and client-side logging/tracing defaultsRepoConfigfor repository-local behavior, ignore defaults, storage coordinates, and remote aliases in.heddle/config.tomlServerConfigfor hosted server storage, database, auth, TLS, and admission settingsWorktreeStatefor per-checkout runtime state such as the current session and segment
Precedence is intentionally explicit:
- CLI flags override the relevant config scope
- env vars override the relevant file-backed config when supported
- repo config stays repo-local
- server config stays server-local
- worktree state stays checkout-local and separate from repo config
Default locations:
- user config:
~/.config/heddle/config.toml - repo config:
.heddle/config.toml - worktree state: a separate per-checkout state file
- server config: a dedicated server config file or server-specific env overrides
Repo config is where repository format versioning lives. User identity, agent defaults, and hosted client credentials should not be stored there.
Environment variables
# Agent attribution
# Principal attribution
# Development
HEDDLE_SESSION_ID and HEDDLE_SESSION_SEGMENT are not part of repo config. Worktree runtime state is tracked separately from the repository configuration file.
Development
Build and test
Workspace structure
crates/
cli/ # local CLI entry point and hosted client dispatch
objects/ # core object and repository model
repo/ # repository helpers and higher-level repo operations
refs/ # threads, markers, HEAD, packed refs
oplog/ # undo/redo oplog model
server/ # hosted server library and admin/content APIs
hosted/ # hosted server/admin binary
heddle-bridge/ # Git interoperability
semantic/ # semantic diff and code-aware analysis
...
docs/ # architecture, hosted model, roadmap, future-state plans
web/ # SvelteKit marketing site and hosted app
specs/ # Quint formal specifications
tests/ # integration and property tests
Documentation
SPEC.md- formal behavior and storage/protocol truthdocs/ARCHITECTURE.md- system architecturedocs/HOSTED_NAMESPACES.md- hosted namespace and grant modeldocs/HOSTED_ADMIN.md- hosted admin surfaces and command/API usagedocs/ENTERPRISE_BACKEND_ROADMAP.md- platform roadmapdocs/RUNNERS_AND_BUILDS.md- hosted workflows/builds plandocs/LINE_PROVENANCE_PLAN.md- provenance status, shipped behavior, and next stepsAGENTS.md- contributor rules and documentation truth guidance.agents/agent-workflows.md- durable automation guidanceweb/PRODUCT_SPEC.md- web product scope and future-state surfaces
Current Limitations
- Semantic diff is available but may be conservative
- Partial fetch and missing-blob hydration have landed in foundation form, but general partial clone / lazy fetch productization remains in progress
- Hosted provenance-backed review remains foundation-level; richer compare/review workflows are still planned
- Hosted builds, workflows, artifacts, and verification writeback are planned, not implemented
heddle undoandheddle redoare thread-scoped to the current checkout; they do not rewind work recorded from another checkout's HEAD path
Known Trade-offs
These are deliberate edges. They're listed here so they don't surprise you when you hit them.
- The verify hook is fail-closed. When Heddle's PostToolUse hook on
Bashsees a definitive failure signal (test result: FAILED,error[Eā¦],^error:) in test output, it writes afailed-*marker instead of capturing. Ambiguous output is a no-op ā no capture, no marker. The intent is to avoid green-by-default attribution when the signal is unclear; the cost is that partial or interrupted runs leave no audit trail. If you want a permissive verify behavior, override the hook. heddle startdoes not change your shell's cwd. The new thread's checkout lives at<repo>/.<thread>-heddle-threads/<name>/root, but Heddle is a child process and can't reach into the parent shell.heddle start <name>prints a copy-pasteablecdline; shell wrappers can usedir=$(heddle start <name> --print-cd-path) && cd "$dir"for one-step automation.- The Stop hook only fires at turn end. Auto-capture runs when the assistant finishes a turn, not within a single turn. For in-turn smoke tests, rely on the verify-hook capture (after a Bash test invocation) rather than expecting Stop to fire mid-loop.
heddle undois thread-local. Already in the limitations list above, repeated here because it's the one that bites most often when context-switching across checkouts: switch to the originating thread before undoing work recorded there.
License
Licensed under either of:
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contributing
Contributions are welcome. Start with AGENTS.md and the relevant docs before changing behavior or product copy.
Heddle is still alpha software. Storage formats, APIs, and hosted product surfaces are evolving quickly.