Haft CLI

Local decision memory for AI agents: problems, option comparisons and evidence live in the project, and stale items are flagged

  • 1,397 ★ on the repository
  • Last commit
CLI

Extended access

Why this level

  • The haft init command appends to the agent configuration, to a section of CLAUDE.md or AGENTS.md and to the skills directories
  • The skills get permissions for Bash, file reading and MCP calls
  • A WorkCommission record creates bounded authority to do work for an external runner
All reasons and checks

m0n0x41d/haft

Install

Manual install

curl -fsSL https://raw.githubusercontent.com/m0n0x41d/haft/main/install.sh | bash

Installs the current haft release. Then run haft init in the project with the flag for your agent.

Access and checks

How we review

Extended accessThe tool runs code or makes network calls and only reads external data.

  • The haft init command appends to the agent configuration, to a section of CLAUDE.md or AGENTS.md and to the skills directories
  • The skills get permissions for Bash, file reading and MCP calls
  • A WorkCommission record creates bounded authority to do work for an external runner

This is third-party code. Review the repository files before installing.

What it does

Haft is a local governance layer for AI coding agents that keeps project memory: which problem is being solved, which options were compared, what the human decided, what supports it and what has gone stale. It does not write code itself and does not generate documentation. The tool is built on Anatoly Levenchuk's First Principles Framework (FPF) and pulls its source into the agent's context. The install.sh installer puts the haft binary in place, and haft init --claude or haft init --codex writes the MCP server into .mcp.json or .codex/config.toml, adds 12 skills (h-frame, h-explore, h-compare, h-decide, h-verify, h-status and others) and inserts a managed section into CLAUDE.md or AGENTS.md. Records live as markdown files in .haft/, while the structured graph is kept in a SQLite database under ~/.haft/projects/. Through the haft serve MCP server the agent gets 12 tools: notes, problem framing, variants and comparison, decision records with invariants and evidence, queries to the code graph and project memory. The server validates arguments itself and returns an error when required fields are missing, there is no parity in a comparison or a prediction lacks verify_after. Evidence has a shelf life: stale items are flagged for review.

Who it is for. For developers and tech leads who run a project with Claude Code or Codex across many sessions and want the choice between options and its grounds not to vanish with the chat history.

Good fit when

  • An agent proposes a major rework and you first need to frame the problem and acceptance criteria with the h-frame skill
  • A choice between options must be recorded with parity of comparison and a Pareto front rather than one total score
  • In a month you need to check that a past decision still holds and see which evidence has gone stale
  • Several agent sessions need shared memory of what was decided and on what grounds
  • Before editing code the agent should see the decisions and invariants that apply to that file or symbol

Not a fit when

  • You need an agent that executes tasks itself: v9 has no built-in executors, and authority for work is recorded for a third-party runner
  • You need search over transcripts of past conversations: Haft keeps typed decision records, not chat logs
  • You work in Cursor, Gemini CLI, OpenCode, Grok, Hermes or Zed: the author calls these adapters experimental or legacy
  • The project must not get extra files: init creates a .haft directory in the repository and a SQLite database in the home folder

Example request

Frame the problem of replacing the message queue, compare three options on equal terms and show which project decisions this affects

Limitations

  • MIT license. The author added a note: the FPF concepts belong to Anatoly Levenchuk, and the license covers only the software part.
  • Claude Code and Codex are named as the stable hosts. Adapters for Grok, Pi, Hermes, Zed, Antigravity, Cursor, Gemini CLI and OpenCode are experimental or legacy. In Cursor the haft server is enabled by hand in Settings, MCP after init.
  • The optional Rust haft-embed component for older semantic recall paths can take 1–2 GB of memory. You can turn it off with embedding.provider: none in ~/.haft/config.yaml.
  • The separate experimental haft10 alpha targets macOS arm64 and Codex, suits new projects or copies, and does not replace the ordinary install.
  • Version 9 removed the built-in haft run and haft harness commands, the interactive agent and the Open-Sleigh runtime on BEAM.

How to disable. Remove the haft server from .mcp.json or .codex/config.toml and delete the skills from ~/.claude/skills/ or ~/.agents/skills/ (with --local, from the project's .claude/skills/ or .agents/skills/). Delete the section between the <!-- haft:start --> and <!-- haft:end --> markers in CLAUDE.md or AGENTS.md by hand. The records in .haft/ and ~/.haft/projects/ stay on disk.

FAQ

How do I install Haft for Claude Code?

Run the install.sh command, then haft init --claude in the project and restart Claude Code. Skills go to ~/.claude/skills/, or to the project's .claude/skills/ with --local. The MCP server is written into .mcp.json and a Haft section appears in CLAUDE.md.

How is Haft different from a notes file for the agent?

Records are typed: note, problem card, decision, evidence. The MCP server validates them and returns structured errors when required fields or comparison parity are missing. A haft_query call shows the decisions and invariants that apply to a file or symbol.

Can the agent make a decision for me?

No. A haft_decision call with the decide action over MCP returns operator_confirmation_required until the host confirms. A binding decision is recorded at a person's direct, unambiguous request, and the h-commission skill is invoked only by hand.

What does Haft do with stale evidence?

Evidence carries formality levels F0–F9, congruence levels CL0–CL3 and an expiry date. The R_eff trust score drops with age, and stale items are flagged for review. After a decision is implemented, verification runs through a haft_decision call with the measure action.

How do I check Haft's state in a project?

The haft spec status command shows the next onboarding step and, separately, health: structural findings, drift and staleness. The full report comes from haft spec check --json. The ready state does not mean release readiness.

Discussion

No questions or reviews yet.

CLI tools
Official

Local persistent memory for coding agents: hooks record every session, and Claude Code, Codex or Cursor recall past decisions through 54 MCP tools

MCP serverExtended access30KRepository stars

A Datalog engine in Rust as an agent's working memory: facts with provenance, inference rules and an MCP server for Claude Code

MCP serverExtended access341Repository stars
Official

Shared memory for fleets of AI agents with access scopes, an audit trail and a knowledge graph: an MCP server, Docker and a cloud

MCP serverBroad access535Repository stars
Official

Local memory for agents: stores conversations and project files verbatim and retrieves them with semantic search over MCP

MCP serverExtended access59.8KRepository stars

Encrypted offline memory for AI agents: one vault on your own computer shared by Claude Code, Cursor, Codex and other clients

MCP serverBroad access578Repository stars

Long-term memory for AI agents: Markdown files as the source of truth, a SQLite index as a cache, shared by Claude Code, Codex and others

CLIExtended access4.4KRepository stars

Comparison with similar tools

Entries that share the main search query, and how they differ.

EntryOfficialAuthenticationRepository starsMain difference
Haft (this entry)no1,397
Episodic Memoryno493searches past conversations with the agent by meaning, while Haft keeps typed records of decisions and evidence
Basic Memorynonot required4,389long-term memory in Markdown files with a link graph and search, without decision records that check evidence

README in short

The description opens with the FPF idea and a one-line install, followed by a table of what haft init does for each agent, a section on the local footprint and the three surfaces: skills, CLI and MCP server. Then come tables of the twelve tools and twelve skills, and sections on evidence and external runners. The repository has ALPHA.md, MIGRATION-v8.md and CHANGELOG.md, Go tests and a .haft directory with the project's own decisions.

README badge

Report a problem

Foxx AIHaft
Foxx AI

I am Foxx AI and I have already vetted this tool. Ask about install, setup or anything else, and I will keep it simple.