kleisli-io/kli
{ "createdAt": "2026-02-11T14:18:56Z", "defaultBranch": "main", "description": "Event-sourced task graphs, pattern learning, and swarm coordination for Claude Code", "fullName": "kleisli-io/kli", "homepage": "https://kli.kleisli.io", "language": "Common Lisp", "name": "kli", "pushedAt": "2026-03-01T15:39:59Z", "stargazersCount": 10, "topics": [], "updatedAt": "2026-03-09T13:11:36Z", "url": "https://github.com/kleisli-io/kli"}[]!(LICENSE)
Event-sourced task orchestration for Claude Code. kli adds a typed task graph, multi-agent coordination via CRDTs, and structured development workflows. An MCP server and hooks work in the background alongside vanilla Claude Code and Agent teams. Or drive it directly: /kli:research -> /kli:plan -> /kli:implement -> /kli:reflect.
![kli dashboard — task graph from a live project with 500+ tasks across multiple architecturally different projects]!(docs/images/dashboard.png)
- [Quick Start]!(#quick-start)
- [What kli Does]!(#what-kli-does)
- [Landscape]!(#landscape)
- [Installation]!(#installation)
- [Architecture]!(#architecture)
- [What kli Is Not]!(#what-kli-is-not)
Quick Start
Section titled “Quick Start”curl -fsSL https://kli.kleisli.io/install | shThen, in any project:
kli initThis configures the MCP server, hooks, skills, agents, and commands. Claude Code queries the task graph through TQ, a composable pipeline language:
;; "Show me the most active tasks"(-> (active) :enrich (:sort :obs-count) (:take 3) (:select :display-name :obs-count))
kli-landing-page-prototype 47 observations fix-tq-core-bugs 23 observations add-spread-activation 12 observationsFull documentation at docs.kleisli.io/kli.
What kli Does
Section titled “What kli Does”A single binary. The MCP server and hooks handle task tracking and agent coordination in the background; skills provide structured workflows when you want them.
MCP Server
Section titled “MCP Server”An MCP server that Claude Code calls as it works:
Task graph — Every mutation is an immutable event in an append-only log. When concurrent agents write to the same task, CRDTs merge their changes — no writes lost, no coordination protocol needed. Claude Code queries the graph through TQ, a composable pipeline language for filtering, sorting, grouping, set operations, and mutations.
Pattern learning — Each pattern carries helpful and harmful feedback counters ranked by Bayesian scoring. New patterns start uncertain; evidence moves them toward proven or demoted. During task bootstrap, retrieval combines feedback scores with embedding similarity and graph-based spread activation to surface what’s relevant.
Lifecycle hooks that fire during Claude Code sessions:
- Session start/leave — initializes task context, detects parallel sessions, registers with the MCP server
- Tool call tracking — records file touches, builds session fingerprints, feeds the co-application graph
- File conflict detection — warns before concurrent edits to the same file
Skills, Agents, and Commands
Section titled “Skills, Agents, and Commands”kli init installs Claude Code extensions:
- Skills — structured workflows for a full development cycle:
/kli:research— codebase exploration with observation capture/kli:plan— iterative planning with phase decomposition/kli:implement— TDD with verification gates/kli:reflect— pattern extraction from experience
- Agents — subagents for parallel work (codebase analysis, web research, graph queries, design research)
- Commands —
/kli:commit(conventional commits with task integration),/kli:create-task,/kli:handoff(creates handoff-document which embeds events tracked from current session),/kli:resume_handoff(complementary to handoff command for when you resume work)
Swarm Coordination
Section titled “Swarm Coordination”When multiple Claude Code sessions work on the same codebase:
- File conflict detection — surfaces concurrent edits before they collide
- Session fingerprinting — tracks which files and tools each session touches
- Orphan phase pickup — detects when a session exits mid-task so another can continue
Dashboard
Section titled “Dashboard”Web UI for the task graph, activity timeline, plan DAGs, topic clusters, and health diagnostics:
kli dashboard # starts on http://localhost:90918 views including a WebGL force-directed graph, frontier board, Markov cluster analysis, and per-task plan visualization.
Landscape
Section titled “Landscape”There are a lot of context persistence and task tracking tools in the current landscape. Here is a short comparison which should help you understand if kli is for you or not. In the end, you should pick the workflow that works for you and makes you as productive as possible.
| Planning | Persistence | Multi-agent | Pattern learning | Query language | |
|---|---|---|---|---|---|
| BMAD | Full SDLC with role personas | Skill/template .md in git | Role personas, collaborative Party Mode | No | No |
| GSD | Spec-first, fresh context per task | ROADMAP/STATE/PLAN.md | Wave-based parallel execution | No | No |
| OpenSpec | Per-feature spec folders | Spec folders in repo | None | No | No |
| Task Master | PRD parsing → tasks | .taskmaster/ JSON | Orchestrator/executor/checker | No | No |
| Beads | Dependency graph, hierarchical tasks | Dolt + JSONL + git | Hash-based collision avoidance, Dolt branching | No | No |
| claude-flow | Auto-decomposition, queen hierarchy | SQLite | Swarm topologies (mesh, hierarchical, ring, star) | Self-learning (v3, nascent) | No |
| kli | RPIR workflow, concrete task DAGs with objectives and acceptance criteria, reorganizable via TQ | Append-only event logs, CRDT state replay | Stigmergy — session fingerprints, file conflicts, orphan pickup | Bayesian scoring + embeddings + graph spread activation | TQ + PQ — composable S-expression pipelines |
Other differences: Among these tools, kli is the only one with event sourcing (immutable events, no state mutation), a dashboard (8-view web UI with WebGL graph), and stigmergic coordination. On the other hand, it only works with Claude Code — BMAD, GSD, and OpenSpec support multiple IDEs. And it is pre-1.0; the others have larger communities.
Where kli is different
Section titled “Where kli is different”What distinguishes kli is the trace: the complete, structured record of what happened, why, and how it relates to everything else. Most tools in this space optimize for planning or execution. kli records both — and makes the record queryable, traversable, and learnable.
Coordination is stigmergic: agents deposit traces in the shared task graph and discover what others have done — indirect coordination, like termite colonies building without a foreman. Session fingerprints mark territory, file conflict detection prevents collisions, orphan phase pickup lets agents continue abandoned work. In practice, adding agents doesn’t increase coordination overhead — no message routing, no broker.
Installation
Section titled “Installation”One-line install
Section titled “One-line install”curl -fsSL https://kli.kleisli.io/install | shkli init # in any project where you want to use itLinux (x86_64, aarch64) and macOS (x86_64, Apple Silicon). Downloads a pre-built binary from GitHub releases. kli init configures the current project. One external dependency: a local embedding model (ollama) for observation search and pattern retrieval.
nix build # produces result/bin/klinix run # run directlynix flake check # run test suites (CRDT, task, playbook, hooks)From source
Section titled “From source”Requires SBCL and Quicklisp:
(asdf:load-system :kli)(kli:main)Architecture
Section titled “Architecture”Single Common Lisp binary (SBCL). MCP server, hook dispatch, dashboard, and project init in one process.
Claude Code <--http--> kli serve task graph + pattern learningClaude Code ---calls--> kli hook <event> session, tool, conflict hooksBrowser <--http--> kli dashboard web UI on :9091Developer ---runs---> kli init project setupEach task is an append-only event log (events.jsonl). State is computed by replaying events through CRDT merge functions — vector clocks for future causal analysis, OR-Sets and LWW-Registers for concurrent writes. Over time, the structured log becomes a complete trace of agent reasoning, decisions, and outcomes. That data compounds.
TQ and PQ are S-expression pipeline languages for querying tasks and patterns respectively. Both are pure parsers — no eval, no code execution, no injection surface. Claude Code composes arbitrarily complex queries safely, and honestly, the queries get more useful as the graph grows.
;; Scaffold a plan with objectives and dependencies(scaffold-plan! (p1 "Design schema" :objective "Normalize user tables" :acceptance "Migration passes, tables exist") (p2 "Implement API" :after p1) (p3 "Write tests" :after p2))
;; Find ready phases in the current plan(-> (query "plan-ready") (:select :display-name :objective))
;; Reorganize: sever a phase, relink dependencies — one expression(-> (node "my-task:phase-2") (:sever-from-parent! :phase-of))
;; Traverse the graph: what depends on the auth task?(-> (node "auth-refactor") (:back :depends-on) :ids)
;; PQ: surface patterns that helped with similar work before(-> (activate "CRDT conflict resolution") (:take 3))See full architecture docs for CRDT details, library breakdown, and query language reference.
What kli Is Not
Section titled “What kli Is Not”kli is not a project management tool and does not replace GitHub Issues, Linear, or Jira. It is a task orchestration layer for multi-session work where task structure, agent coordination, and development workflows matter.
License
Section titled “License”[MIT]!(LICENSE)
Built by Kleisli.IO in Tromso, Norway.