miadi-orchestration-kit

miadi-session-observability

Session capture for Miadi hosts, as a Claude Code plugin. Install it once on a host and every Claude Code session there is captured. Nobody edits settings.json by hand. jgwill/miadi-orchestration-kit#56.

Install

claude plugin marketplace add jgwill/miadi-orchestration-kit      # or the path of a checkout
claude plugin install miadi-session-observability@miadi-orchestration-kit

Then remove the hooks block from ~/.claude/settings.json on that host, in the same step. If both are wired, every event fires twice and every capture line is written twice.

The plugin’s hooks load when a session starts. Removing the hooks block takes effect at once, so a running session captures nothing from that edit until it is restarted. Restart it right after the edit (seen on gaia, 2026-09-30).

To try the plugin without installing it: claude --plugin-dir <path to this folder>.

Where captures go

<root> is CLAUDE_SESSIONDATA_ROOT, else MIADI_SESSION_DIR, MIADI_SESSIONDATA_ROOT, SESSION_DATA_ROOT, else /src/_sessiondata when it exists, else _sessiondata beside this folder (hooks/claude_hooks/lib.sh).

Teams

The binding line’s team is {"id": "T1", "source": "session"}. It is resolved in this order:

  1. a declared team: MIADI_TEAM in the agent’s environment, or the tmux session option (tmux set-option -t <session> @miadi-team T1)
  2. the session names in teams/teams.json, matched against the tmux session name and the agent session’s name
  3. its folders, where the agent’s folder or one below it matches and the longest prefix wins
  4. its name patterns
  5. otherwise unassigned

The list is MIADI_TEAMS_FILE, else $MIADI_ORCHESTRATION_KIT_ROOT/teams/teams.json. An installed plugin is a copy of this folder, so it cannot reach the kit by a relative path. teams/README.md is the text people read, and the two are kept in step.

Which copy is canonical

Host integrations it uses when present

Check

bash tests/team-resolution.sh
bash tests/episode-resolution.sh
bash tests/transcript-archive.sh
CLAUDE_SESSIONDATA_ROOT=$(mktemp -d) claude --restricted --plugin-dir . --model haiku

--restricted ignores the user’s settings files, so only this plugin’s hooks run. One prompt that starts a subagent, a /rename and an exit write the same files as today’s capture, with each event written once.