Tianhao Zhang

Case study 5 · Automation

Running many AI work sessions from one inbox

One coordinating AI session assigns work to project sessions that each own their files. Every result comes back as a card in an append-only event log.

388events in the first 28 hours
155cards across 30 projects
7card types
10always-on programs watched

Python · local web app · JSON Lines · Claude Code · Codex review

Problem

I run many AI work sessions at once, one per project. Results used to come back as long text files that had to be read one by one, two sessions could edit the same file, and "done" had no fixed meaning.

Design

  • One coordinator. A single session takes requests, assigns them, and passes results on. It does not write code itself.
  • One owner per file. Each project session owns its own folder and notes. Another session that needs a change asks the owner.
  • Seven card types. Every result is one card: task, report, decision, action, date, question or done. A decision card must list the options with the benefit and the cost of each, and a recommendation.
  • Done needs evidence. A card cannot be closed without proof such as a test result, a screenshot or an email subject.
  • Independent review. Every code change is reviewed by a second AI model (Codex) at maximum effort before it ships.
Owner
one request
→
Coordinator session
assigns work, writes no code
→
Project sessions
one per project, own their files
→
Event log
append-only; state is replayed
→
Inbox
seven card types; done needs evidence
# events.jsonl: synthetic example lines showing the structure; not excerpts from the real log
{"seq": 201, "t": "2026-11-19T22:10:04", "action": "post",   "card": 140, "by": "coordinator", "type": "task",   "title": "Add price check to deal list"}
{"seq": 202, "t": "2026-11-19T23:41:37", "action": "status", "card": 140, "by": "project-session","to": "done",  "evidence": "test_backend 40 OK"}
{"seq": 203, "t": "2026-11-19T23:52:10", "action": "undo",   "card": 140, "by": "owner",       "of": 202}
Top: how work moves. Bottom: the log only grows. Undo is a new event, so the history of every card can be replayed.

Data model

The only source of truth is an append-only event log, one JSON object per line. Posting a card, changing its status, a click in the inbox, an undo: each is a new line. The current state is rebuilt by replaying the log, so no record is ever overwritten and any change can be undone by adding an undo event. The old text-file overview was moved in as 39 cards, with a dry run first.

Running it

  • The inbox is a small local web app that listens only on 127.0.0.1. Every write must carry a page token and pass Host and Origin checks; a 27-item self-test covers these.
  • A watchdog checks 10 always-on programs every 2 minutes and restarts a program whose process is gone, at most 3 times an hour. It never restarts the main chat app, because that would cut off live sessions.

Results

In its first 28 hours the log recorded 388 events and 155 cards across 30 projects (39 of the cards moved in from the old overview). The owner reads short cards instead of long files, and every closed card says how it was verified.

Built with Claude Code: I set the goal, wrote the rules and the checks, and decided what counts as done; Claude Code wrote the code and the tests; a second model reviewed them.

Next: A rule-based pipeline for about 200 course documents →