Getting Started
Install hence and complete your first task lifecycle
This guide walks you from a fresh machine to a working two-agent task cycle. By the end you will have installed hence, written a minimal plan, claimed a task, asserted findings, and seen the reasoner explain its conclusions.
The full cycle takes about ten minutes. You do not need any external services — everything runs locally against a plain .spl file.
1. Installation
One-line installer
The recommended method fetches and runs the official install script, which detects your platform, downloads the correct archive, and installs the binary.
curl -fsSL https://files.anuna.io/hence/latest/install.sh | bash
By default the script installs to:
~/.local/bin/hence— the executable
Make sure ~/.local/bin is on your PATH. If it is not already, add it to your shell profile:
# bash
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc && source ~/.bashrc
# zsh
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc && source ~/.zshrc
Custom install location
Pass INSTALL_DIR to override the default install location.
INSTALL_DIR=/usr/local/bin \
curl -fsSL https://files.anuna.io/hence/latest/install.sh | bash
/usr/local/bin makes hence available system-wide for all users. You may need sudo or appropriate directory permissions.
From source
Requires Rust (stable toolchain).
git clone https://codeberg.org/anuna/hence.git
cd hence
make install
This builds a release binary and installs it to ~/.local/bin. Override with make install PREFIX=/usr/local.
Verify the installation
hence --version
You should see output like:
hence 0.6.7
If the command is not found, confirm that the install directory is on your PATH and that you have opened a new shell session or sourced your profile.
2. Your first plan
A plan is a plain-text .spl file containing defeasible rules that describe your project's tasks, when they are ready, and who should perform them. The hence reasoner evaluates these rules on demand — there is no running daemon, no database, and no sync step. Every query reads the file fresh.
Initialize a template
hence plan init project.spl
This writes a starter template to project.spl. Open it in any editor — it looks like this:
; =============================================================================
; Project
; =============================================================================
(meta plan
(title "Project")
(status "active")
(created "2026-02-24"))
; --- AGENTS ---
; Set HENCE_AGENT env var or use --agent flag with lifecycle commands
(given agent-dev-available)
; --- TASKS ---
(given task-design)
(given task-implement)
(given task-test)
; --- TASK METADATA ---
(meta task-design
(description "Design phase — define architecture and approach")
(acceptance "Design document reviewed and approved"))
(meta task-implement
(description "Implement the design")
(acceptance "Code complete, builds cleanly, unit tests pass"))
(meta task-test
(description "Integration and end-to-end testing")
(acceptance "All tests pass, no critical issues"))
; --- DEPENDENCIES ---
; design has no dependencies
(given no-deps-design)
; --- READINESS RULES ---
; design is ready immediately
(normally r-ready-design
(and task-design no-deps-design)
ready-design)
; implement is ready after design is completed
(normally r-ready-implement
completed-design
ready-implement)
; test is ready after implement is completed
(normally r-ready-test
completed-implement
ready-test)
; --- ASSIGNMENT RULES ---
(normally r-assign-design
(and ready-design agent-dev-available)
assign-to-design-dev)
(normally r-assign-implement
(and ready-implement agent-dev-available)
assign-to-implement-dev)
(normally r-assign-test
(and ready-test agent-dev-available)
assign-to-test-dev)
What the template contains
| Section | What it does |
|---|---|
(meta ...) |
Attaches human-readable metadata to the plan or to individual tasks. Used by hence plan board and by LLM context injection. |
(given agent-NAME-available) |
Declares an agent availability fact that the reasoner knows about. Used in assignment rules to match against the active agent. |
(given task-NAME) |
Declares a task name using kebab-case convention. Tasks are opaque identifiers; all meaning comes from the rules that reference them. |
(normally LABEL CONDITION CONCLUSION) |
A defeasible rule with a label, a premise condition, and a conclusion fact. More specific rules can defeat it. |
assign-to-TASK-AGENT |
The derived fact that drives hence task next output — when this fact holds, the task is shown as assigned to the named agent. |
View the task board
The board command renders a kanban-style view of all tasks and their current states:
hence plan board project.spl
With a fresh plan (no facts asserted yet) it looks like this:
+--------------+--------------+--------------+--------------+--------------+
| BACKLOG | READY | IN PROGRESS | BLOCKED | DONE |
+--------------+--------------+--------------+--------------+--------------+
| |design @dev | | | |
+--------------+--------------+--------------+--------------+--------------+
Tasks: 0 backlog, 1 ready, 0 in-progress, 0 blocked, 0 done
The board tells you at a glance: design is ready and assigned to dev. Tasks implement and test have no fired readiness rules yet — their prerequisites haven't completed — so they don't appear on the board until they become actionable.
hence plan board project.spl --json to get machine-readable output you can pipe into other tools or embed in an LLM context window.
3. Set your identity
hence does not have a login system. Your identity is an environment variable. The reasoner uses it to filter tasks assigned to you and to sign any facts you assert.
export HENCE_AGENT=dev
To make this permanent, add it to your shell profile (~/.bashrc, ~/.zshrc, etc.).
Cryptographic identity
Simple name-based identity works fine for local single-user use, but hence also supports cryptographic agent identifiers. Each agent has an Ed25519 keypair; the public key is embedded in fact assertions so that any reader can verify who wrote what.
hence agent whoami
Output:
supervisor:ed25519:xfRAzZFG
agent:ed25519:xfRAzZFG
evaluator:ed25519:3jB3fzQT
PeerId: 12D3KooWP96WBe...
The first time you run hence agent whoami, hence generates a keypair for the current HENCE_AGENT name and stores it in ~/.local/share/hence/keys/. Subsequent runs load the existing key.
When multiple agents share a plan via hence.run, facts are stored in the canonical agent:PUBKEY format — the human-readable name followed by a colon and the hex-encoded Ed25519 public key. This means you can have two agents both named alice on different machines without collision; the public keys distinguish them.
HENCE_AGENT name is used directly in assignment rules, and hence task next matches on the name. Cryptographic signing becomes relevant when you share a plan over hence.run and need tamper-evident attribution.
4. Find your tasks
With your identity set, ask the reasoner what you should work on:
hence task next project.spl
Output (with HENCE_AGENT=dev):
Next actions for dev:
1. design @dev — hence task claim design project.spl --agent dev
hence task next does three things in one query:
- Evaluates all readiness conclusions under defeasible logic
- Filters to tasks where the assignment literal holds for the current agent
- Excludes tasks that are already claimed or completed
The assignment is derived — the plan's (normally r-assign-design ...) rule fired with no defeaters, so the reasoner concluded the assignment. You do not query a database; you query the logical consequences of the rules and accumulated facts in the .spl file.
hence plan board project.spl to see all tasks across all agents and their current status. Useful when coordinating across a team or debugging why a task is not surfacing.
5. Claim and complete a task
Claiming a task appends a (claims agent:dev ...) block to the plan file. Other agents querying the same plan will see it as in-progress. This is how concurrent agents avoid stepping on each other's work.
-
Claim the task
hence task claim design project.splOutput:
Added: (claims agent:dev :at "2026-02-24T10:15:03Z" ...) (given claim-v1-design) (normally r-cl-state-v1-design claim-v1-design state-claimed-v1-design) (normally r-cl-chain-v1-design state-claimed-v1-design claimed-design) Next actions for dev: (no actions available)The plan file now contains that
(claims ...)block, and subsequent queries will seeclaimed-designas a derived conclusion. -
Do the actual work
This is the step that varies — write code, run a script, gather data, call an API. hence does not supervise what you do between claim and complete. For supervised LLM agent execution, see Supervision.
-
Assert findings
While working, you may discover facts that other tasks depend on. Record them with
hence task assert. The argument is a valid SPL fact expression:hence task assert '(given found-something)' project.splYou can assert multiple facts in one call:
hence task assert \ '(given dependency-version "2.3.1")' \ '(given env-validated)' \ project.splThese facts are appended to the plan file as
givenclauses and are immediately visible to any subsequent query — whether made by you, another agent, or an LLM reasoning about the plan state.TipAssertions are the primary output channel for agents. If a later task's readiness rule references a fact, asserting it here is what unblocks that task. Think of assertions as structured findings, not just log messages. -
Complete the task
hence task complete design project.splOutput:
Added: (claims agent:dev :at "2026-02-24T10:42:17Z" (given completed-design)) Next actions for dev: 1. implement @dev — hence task claim implement project.spl --agent devThe plan file gains that
(claims ...)block, andcompleted-designis immediately provable by the reasoner. -
Check the board again
hence plan board project.splThe board now reflects the updated state:
+--------------+--------------+--------------+--------------+--------------+ | BACKLOG | READY | IN PROGRESS | BLOCKED | DONE | +--------------+--------------+--------------+--------------+--------------+ | |implement @dev| | |design | +--------------+--------------+--------------+--------------+--------------+ Tasks: 0 backlog, 1 ready, 0 in-progress, 0 blocked, 1 doneCompleting
designcausedcompleted-designto become provable. The reasoner re-evaluated the readiness rule forimplement— its guard is now satisfied — and promoted it to READY.
6. Check what unlocked
After completing a task, run hence task next again to see what became available:
hence task next project.spl
Output:
Next actions for dev:
1. implement @dev — hence task claim implement project.spl --agent dev
The reasoner re-evaluated all readiness rules after completed-design became provable and found implement is now assignable. You get a copy-pasteable claim command immediately.
If you were running a multi-agent system, agents poll hence task next on a schedule. As soon as one agent completes a task, the next poll by any other agent returns the newly unblocked work — no message passing, no pub/sub, no coordinator process. The plan file is the shared state, and the reasoner is the coordinator.
7. Explain a conclusion
hence can explain why any conclusion holds or does not hold. This is useful for debugging plans, for building operator UIs, and for giving LLMs grounded context about the current plan state.
Why is a task ready?
hence query explain ready-design project.spl
Output:
=== Explanation for: ready-design ===
Contributing Sources (1):
- unknown:anonymous
Derivation Tree:
- ready-design [via r-ready-design, from unknown:anonymous]
- task-design [via f2, from unknown:anonymous]
- no-deps-design [via f5, from unknown:anonymous]
The explanation shows contributing sources and a derivation tree: which rule fired (r-ready-design) and which atoms it depended on (task-design, no-deps-design). For a task with a dependency guard:
hence query explain ready-implement project.spl
Output after design is complete:
=== Explanation for: ready-implement ===
Contributing Sources (1):
- unknown:anonymous
Derivation Tree:
- ready-implement [via r-ready-implement, from unknown:anonymous]
- completed-design [via f15, from unknown:anonymous]
Why is a task not ready yet?
hence query why-not explains why a conclusion does not hold — which guards are unsatisfied, which defeaters are active, or which rules are simply absent.
hence query why-not ready-implement project.spl
Output (before design is complete):
===============================================================
Why not: ready-implement
===============================================================
To prove +∂ ready-implement, these conditions must hold:
(1) Definitely provable (+Δ): [FAIL]
Not definitely provable
-> Checking defeasible proof path...
(2) Negation not definitely provable (-Δ ¬q): [PASS]
No strict rule derives ¬ready-implement
(3) Applicable rule exists: [FAIL]
Rules exist but none are applicable (missing prerequisites)
Rules for this literal:
[FAIL] r-ready-implement: [r-ready-implement] completed-design => ready-implement
Missing:
* completed-design
========= FAILURE POINT =========
Rules exist but prerequisites are not satisfied.
========= SUGGESTIONS =========
1. Prove or assert 'completed-design' to enable rule
hence query why-not is your first stop when a task is stuck on BLOCKED and you are not sure why. It gives you the exact missing fact or unsatisfied condition rather than leaving you to trace through the rules manually.
Both explain and why-not support --json for machine-readable output, and both work on any derived predicate in your plan — not just readiness. You can explain assignment conclusions, custom domain predicates, or any other rule head.
8. Minimal working example
Here is a complete self-contained plan for a two-task design-then-implement cycle. Copy it to a file and work through the full lifecycle shown below.
The plan file
; minimal.spl — a complete two-task plan
; ── Meta ──────────────────────────────────────────────────────────
(meta plan minimal
(title "Minimal Example")
(description "Design followed by implementation. Demonstrates the full task lifecycle."))
; ── Agents ────────────────────────────────────────────────────────
(given agent-dev-available)
; ── Tasks ─────────────────────────────────────────────────────────
(given task-design)
(given task-implement)
; ── Readiness ─────────────────────────────────────────────────────
; design is immediately ready — no prerequisites
(normally r-ready-design
(and task-design no-deps-design)
ready-design)
; implement is ready only after design is completed
(normally r-ready-implement
(and task-implement completed-design)
ready-implement)
; ── Assignment ────────────────────────────────────────────────────
(normally r-assign-design
(and ready-design agent-dev-available)
assign-to-design-dev)
(normally r-assign-implement
(and ready-implement agent-dev-available)
assign-to-implement-dev)
; ── Task metadata ─────────────────────────────────────────────────
(meta task-design
(description "Design the feature")
(acceptance "Design doc approved"))
(meta task-implement
(description "Implement according to the design")
(acceptance "All tests pass"))
Full lifecycle walkthrough
-
Initialise and inspect
hence plan board minimal.splExpected:
designREADY (assigned todev);implementnot yet shown (prerequisite incomplete). -
Claim and work on design
export HENCE_AGENT=dev hence task next minimal.spl # → design hence task claim design minimal.spl -
Assert findings
After completing the design work, record any facts other tasks may depend on:
hence task assert '(given design-approved)' minimal.splYou can assert multiple facts in one call:
hence task assert \ '(given api-contract-frozen)' \ '(given design-approved)' \ minimal.spl -
Complete design
hence task complete design minimal.spl -
See implement is now ready
hence task next minimal.spl # → implement -
Explain why implement is ready
hence query explain ready-implement minimal.splThe explanation shows that
completed-designis now provable, which satisfies the readiness guard fortask-implement. -
Claim, implement, and complete
hence task claim implement minimal.spl # ... do the implementation work ... hence task assert '(given tests-passing)' minimal.spl hence task complete implement minimal.spl -
Final board state
hence plan board minimal.splExpected output:
+--------------+--------------+--------------+--------------+--------------+ | BACKLOG | READY | IN PROGRESS | BLOCKED | DONE | +--------------+--------------+--------------+--------------+--------------+ | | | | |implement | | | | | |design | +--------------+--------------+--------------+--------------+--------------+ Tasks: 0 backlog, 0 ready, 0 in-progress, 0 blocked, 2 doneBoth tasks done. The plan is complete.
.spl file after the full lifecycle is a complete audit trail. Every claim, assertion, and completion is a timestamped given fact. You can replay the history, diff two versions of a plan file, or feed the entire file to an LLM as context using hence llm context minimal.spl.
What's next
Core Concepts
Understand defeasible logic, how rules interact, and the semantics behind ready, assigned, and done.
Writing Plans
Learn the full SPL syntax: guards, defeaters, prefer, meta blocks, and complex multi-agent assignment policies.
Agent Workflow
The standard agent loop for LLMs, concurrent agent coordination patterns, and using hence.run for multi-machine plans.
Supervision
Spawn supervised agents with lease-based liveness, automatic failure propagation, and evaluator roles.
CLI Reference
Every command and flag. Covers hence plan, task, agent, query, llm, and more.