lich-plugin
The agent side of the lich integration. lich is a harness that orchestrates agent CLI sessions; this companion plugin gives it eyes and hands inside each session. It installs on Claude Code, OpenAI Codex, Antigravity CLI, opencode, omp (oh-my-pi) and Crush from this same repository. Every hook implements a contract that is canonical in the lich repository (docs/hooks/ there); the docs in docs/ here point at each contract and describe the client side:
- session state —
busy/done on the session card (UserPromptSubmit/PreInvocation/Stop)
- session start — persists the agent's session id on the lich session (
SessionStart/PreInvocation)
- session title — names the card after the session's own title (
Stop)
- session touched — refreshes the card's git status right after file-mutating tools, and hands the model lich's note when another session wrote the same file minutes ago (
PostToolUse)
- subagent cards — turns the agent's own subagent call into a lich session, asking lich before the tool runs (
PreToolUse, or the module's pre-tool event)
The four reports are what Claude Code, Codex, Antigravity, opencode and omp send. Crush reports two of them — its session id and the git-status refresh (on PostToolUse from Crush v0.99.0, with the edit note) — and no state: none of its newer turn events was measured yet, and a state nothing can end is worse on a card than no state. omp reports all four minus the bell: no event of its own for "your turn" has been measured yet, so its card shows a spinner while the agent waits on you. docs/providers.md has the event mapping per harness.
On opencode under a lich from before it registered its MCP server there, it
also carries the other direction: the operations lich offers a session for
driving the sessions beside it, as tools of opencode's own. A newer lich hands
opencode that server at spawn, as it does Claude Code and Codex, and the module
then defines none. docs/opencode-tools.md has the
list and the cases where they are deliberately absent.
On every harness here but opencode 2, and on Kiro CLI through lich's own
registration, the agent's subagent call becomes a lich session: before the
tool runs, the plugin asks lich, which opens the task as a card you can watch
and steer and refuses the native call with a reason the model reads. The card's
report arrives at the asking session's prompt on its own as a
<lich-notification kind="worker-finished">. Which subagent types stay native,
such as the read-only explorers, is lich's call, and when lich cannot be reached
the native subagent runs. docs/subagent-cards.md has
the veto per harness. Since a card shares the checkout unless the call asked
for a worktree, the touched report names the files a write touched, and when
another lich session wrote one of them in the last ten minutes, lich answers
with a note naming it that the hook hands to the model; on Antigravity and Kiro
CLI, whose post-write hooks cannot show text, it arrives before the next model
call or with the next prompt (docs/session-touched.md).
It also ships skills for the parts of lich you configure from inside a session:
- theme (
/lich:theme in Claude Code; on Codex and Antigravity the theme skill loads from its description; Cursor CLI loads it from the Claude Code install; lich copies it as lich-theme into opencode, where it is /lich-theme, oh-my-pi, Crush and Kiro CLI when it installs the plugin there): write, port or fix a lich color theme: the app tokens, the xterm palette, where the file goes, and a validator for the rules that otherwise fail silently
- extension (
/lich:extension in Claude Code, $lich:extension on Codex; run by hand only, no agent loads it on its own, except on Antigravity and Cursor CLI, which list every skill a plugin ships to the agent; lich copies it as lich-extension into opencode, oh-my-pi and Crush, and leaves Kiro CLI without it): write, develop and publish a lich extension: the template repository, the manifest, permissions, translations, trying it in place, lich extension check, a release and the catalog listing
Structure