Task graphs and pattern playbooks for Claude Code.
kli writes every task, observation, and file edit as an immutable event in an append-only log. State is computed from events, never stored. After months and thousands of tasks, the graph holds everything your agents learned. Any agent can query it.
Claude Code records conversation history in JSONL and has built-in task support. kli extends that across months and repos. Agents and humans change plans, update specs, pick up where any prior session left off.
Patterns emerge from completed work. Each carries a helpful and harmful score. High-scoring patterns surface in future sessions. Low-scoring ones sink in rank.
{type: session.join, sid: s-3979..}
{type: observe, text: "split graph.."}
{type: observe, text: "edge-map key.."}
{type: phase.link, edge: phase-of}
{type: task.complete}
{type: session.leave, sid: s-3979..}Read the code. Spawn agents to search across repos. Record what you find as observations. They persist across sessions.
Break work into phases with dependencies. Each phase has success criteria. kli scaffolds the DAG in one expression.
Work phase by phase. Write tests first, then code, then verify. kli tracks which files each session touches.
Review what the session did from its event log. Mark patterns that helped. Demote ones that didn't. Next session benefits.
Every node is a real task from kli's own development. Hub nodes are planning tasks; satellites are implementation phases. Hover to inspect. This graph was queried live from kli's task server.
kli dashboard launches a local control surface. Browse ready tasks, inspect plans, pin what you're working on, take notes in the scratchpad. Complete phases and cut edges. All from the browser.
The graph view shows every task and edge. Health checks flag stale forks and orphaned phases. Topic clusters group related tasks without manual tagging. All state derives from the event log. Mutations show up immediately.
$ kli dashboard
Dashboard listening on http://localhost:9091
Frontier: 8 ready / 1,043 total tasks
Health: no stale phases
Graph: 1,043 nodes, 9,217 edges
Sessions: 1 active
No message bus. No coordination protocol. Agents write events to a shared log. Other agents read those traces and adjust. Biologists call this pattern stigmergy.
Every tool call, file edit, and observation appends to the task log. Session fingerprints record which tools ran and which files changed.
CRDTs merge concurrent writes without locks. The task graph gains edges and observations with each session. File activity records track who touched what and when.
A new session joins and bootstrap runs. It shows who's working nearby, which files were recently edited, which phases are orphaned. All from replaying the shared log.
Five trace types make this work: event logs (append-only JSONL), session fingerprints (tool and file vectors), file activity records (edit history), active PID tracking (liveness), and departure events (orphan detection). kli ships with Claude Code agent team support. Session fingerprinting groups teammates, detects file conflicts across teams, and picks up orphaned phases when sessions crash. kli reads the environment variables Claude Code already sets. No new abstractions needed.
CRDTs guarantee that concurrent edits merge to the same state regardless of ordering. Coordination follows from structure.
State exists only as a fold over events. Given an event E, apply-task-event produces the next state. Given a query, the system replays the log and returns the current CRDT values. The event log is the sole persistent artifact. State is computed on read, never stored.
Commutativity, idempotence, associativity. These three properties guarantee that distributed sessions always converge to the same state regardless of event ordering. G-Sets grow monotonically. OR-Sets support removal via tombstones. LWW-Registers break ties by timestamp. No locks. No coordination protocol. Convergence follows from the algebra.
Nobody assigns topic clusters. A labeling function parses each task name into a short stem. Tasks that share a stem are grouped. It is a simple heuristic, but the resulting partition induces the topic graph: edges connect co-grouped tasks without manual tagging.
Event sourcing makes this coordination possible. Agents replay the log, observe the current graph, read traces left by predecessors, and adapt. CRDTs guarantee concurrent writes converge. The quotient topology reveals structure agents collectively build. At a thousand tasks, these guarantees stop being academic.
kli ships as a single native binary. No Python, no Node, no Docker. One external dependency: a local embedding model for observation search.
Your data stays local. Always.
$ curl -fsSL https://kli.kleisli.io/install | sh
$ cd my-project && kli init
Kleisli initialized in /home/user/my-project
Tasks: .kli/tasks/ event-sourced, CRDT merge-safe
Patterns: .kli/playbook.md helpful/harmful scoring
Dashboard: http://localhost:9091 task graph visualization
Embeddings: active ollama/nomic-embed-text
Claude Code: 7 skills, 11 commands, 6 hooks installed