Skip to main content
Glama

claude-workflow

Graph build plan craft tools with a strict system of references.

A local web UI and two MCP servers that turn an AI agent's long build into a plan a human can read, check and steer. The agent reports its work as graphs of Work nodes, each with atomic tasks and the Reading references each task rests on. The human sees the plan on a canvas, answers open questions, records decisions and pauses or rejects work. A task can be ticked only after its references were actually read through the system of references (see the sibling repository system-of-references).

Everything runs on 127.0.0.1. There is no cloud service and no account.

What is in it

Area

What it does

Build Plan graphs

A project holds graphs of Work nodes. A graph must be layered: at least three levels, one connected component, no cycles, and every new node arrives with its edges. Loops (groups of four layers) are derived from the layers, and a loop budget bounds the depth.

Work nodes and atomic tasks

Each node states a change and a done-when. Its tasks carry Reading references. A task is ticked only when its references were read, and a tick needs the earlier nodes to be finished.

Sheets

A sheet is a saved set of graphs with plan items and weights; progress is computed per sheet and per plan item.

Prompts

Reusable prompt templates, with a record of every send.

Decisions and human references

The human records decisions, links them, and picks any part of the page (Ctrl+drag) as a human reference the agent can fetch later. These are the human's standing preferences.

Delegation

The Creator hands a ready Work node to a Worker session (at most three open at once, independent, spaced apart). Workers see only their own work order.

Modes

Build-plan craft (everything halted, only the human enters it), Research and Execution. A tool is allowed or refused by its class in the current mode, with the reason.

Live updates

One server-sent update stream tells every open page when a project database changes; no polling.

Hooks

Small Node scripts for Claude Code: a read gate (a peer with unread references may only read), a mode gate, a lease gate for messages to peers, a stop hook that sends an idle Worker back once, and a web-search recorder.

Related MCP server: ContextPact

Architecture

 agent (Claude Code)                     human (browser, 127.0.0.1)
        |  MCP over stdio                        |  HTTP + live update stream
        v                                        v
 node dist/mcp/main.js <workflow|graph>   node dist/http/main.js  ---> serves ui/ (vite build)
        |                                        |
        +--------------- ProjectHub -------------+
                              |
                      Store (one transaction per write)
                              |
                  project.db per project (SQLite, migrations/001_baseline.sql)
  • src/store/ is the write layer and the read model; every public method runs in one transaction, and rules live in the database as constraints and triggers as well as in code.

  • src/mcp/ registers the tools (workflow: projects, sheets, decisions, delegation, systems of references; graph: graphs, nodes, edges, tasks, traces, blockers, tags, prompts).

  • src/http/ is the Fastify app: Host and Origin checks on every request, a strict content-security policy, JSON routes, and the live update stream.

  • ui/ is the Web UI: a Cytoscape canvas, a left panel of graphs, node cards, hover cards for edges, pop-ups for plan, prompts, decisions and activity. Every database string is rendered as text, never as HTML.

Run

Requirements: Node.js 20.19 or newer.

npm ci
npm run build          # server (tsc), UI (tsc + vite, bundled locally, no CDN)
npm run seed           # optional: a fictional project "pizza-delivery" with graphs, sheets and tasks
npm start              # UI on http://127.0.0.1:18640
npm test               # server tests (vitest)
npm run test:ui        # UI tests

Environment: CW_PORT (default 18640), CW_REGISTRY (registry file, default data/registry.json). CW_HOST may only be 127.0.0.1; any other value stops startup.

Add the MCP servers to your agent's configuration, one entry per group:

{
  "mcpServers": {
    "manage_workflow": { "command": "node", "args": ["/path/to/claude-workflow/dist/mcp/main.js", "workflow"] },
    "manage_workflow_graph": { "command": "node", "args": ["/path/to/claude-workflow/dist/mcp/main.js", "graph"] }
  }
}

Tools

Server

Tools

manage_workflow

create_project, delete_project, upsert_sheet, record_decision, search_decisions, link_decisions, get_human_decisions, get_agent_open_questions, answer_agent_question, get_human_reference, list_human_references, get_mode, switch_mode, add_system_of_refs, remove_system_of_refs, get_my_work, next_work, delegate_work, reassign_work, release_work, allow_worker, get_peer_searches

manage_workflow_graph

upsert_graph, upsert_node, add_edge, add_target, remove, upsert_checklist_item, fetch_graph_details, fetch_node_details, search_graph, filter_nodes, report_action_trace, get_action_traces, open_blocker, close_blocker, log_attempt, add_comment, upsert_tag, set_optional, set_loop_budget, split_sheet_plan, upsert_prompt, attach_web_img_reference

A drift test fails when a registered tool has no mode class, and another pins the exact tool list of each server.

Tests

npm test runs the server suite against real SQLite databases built from the baseline migration (about 1,000 tests: store rules, database constraints and triggers, every tool through the MCP SDK's in-memory transport, the HTTP guards, hooks). npm run test:ui runs the pure parts of the UI (layout, filters, wiring checks that read the source). The browser itself is not driven by automated tests in this repository.

Limitations

  • Single user, single machine, by design. The server refuses any host but 127.0.0.1.

  • The Web UI is not covered by browser-level tests; its checks are pure functions and source-wiring assertions.

  • The hooks and some tool messages are written for Claude Code sessions and assume its settings-file format.

  • A qr: Reading reference is confirmed by running the reference-system script from the system-of-references repository (put it on PATH, or set CW_QR_SCRIPT); other address kinds, such as url:, pass without it.

  • The baseline schema was produced by applying an earlier history of 147 migrations and keeping the tables this edition uses; it starts at version 1 and is not an upgrade path from that history.

Layout

Path

What

src/

Server: store, MCP tools, HTTP app, search, seed, hooks guard

ui/

Web UI source and its build config

hooks/

The Claude Code hook scripts

migrations/

001_baseline.sql, the whole schema

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI agents and tools to share durable, approved knowledge, current decisions, task ownership, and handoffs from a local-first workspace kept outside any single AI product. Markdown holds human-readable rules, goals, and narratives while SQLite tracks agents, sessions, tasks, leases, and audit events behind one transport-independent core.
      2
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      Enables coding agents to run persistent, budgeted work sessions with dependency graphs, human decision queues, required validation, and clean handoffs for autonomous or human-in-the-loop execution.
      16
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables a fleet of AI agents to connect over MCP to a local-first hub, where they can read time-ordered project feeds, keep session-scoped memory that survives compaction and resume, exchange artifacts, and send finished work or approval requests to a human inbox.
      MIT