Skip to content

feat(hooks): retire the Claude Code mod and hand lich's edit note through the touched report - #110

Merged
omartelo merged 2 commits into
mainfrom
feat/remove-mod
Nov 23, 2026
Merged

omartelo merged 2 commits into
mainfrom
feat/remove-mod

Conversation

@omartelo

Copy link
Copy Markdown
Collaborator

Cut 2 of the Claude Code mod's removal, and the edit guard as a hook on every harness, against lich's reborn c62b0796 (docs/hooks/session-touched.md, which removed the /mod/* contracts and extended session-touched with paths, hold, collect and a 200 {"note"}).

Removed

The whole mod: hooks/lich.js and the modules entry, mod-control.js, mod-status.js, mod-usage.js, mod-compacting.js, self-command.js, status-line.js, edit-guard.js, prompt-text.js, their tests and engine tests, docs/mod-*.md, docs/edit-guard.md, docs/self-command.md, and the vendored mod-control, mod-commands, mod-usage and mod-status fixtures with their refresh lines. The plugin is hooks and skills. lich's chat drives Claude Code with claude -p over stream-json, where every one of these mods but the edit guard was already inert.

The edit note, per harness

Harness Client Paths Note
Claude Code, Cursor CLI report-touched.sh on PostToolUse tool_input.file_path hookSpecificOutput.additionalContext
Codex the same (Windows through win-veto.cmd, which keeps stdout) patch headers, relative to cwd additionalContext
Crush PostToolUse from v0.99.0 tool_input.file_path {"version":1,"context":note}; on an older Crush's PreToolUse, no paths and nothing printed
Antigravity PostToolUse report-touched.sh hold, PreInvocation report-touched.sh collect toolCall.args.Path injectSteps system message; the matcher names write_file/edit_file beside the old pair, fixing the 1.5.15 rename
Kiro CLI lich registers hold on postToolUse and collect on userPromptSubmit tool_input.path, relative to cwd stdout of the collect
opencode 1 tool.execute.after for write, edit, apply_patch, bash args.filePath; metadata.files[].filePath appended to output.output
oh-my-pi tool_result details.resolvedPath / details.path {additionalContext}

Paths are absolute with . and .. folded, each once. opencode no longer reports file.edited, which fires before the same write's tool.execute.after, so one edit is never sent twice. opencode's write and edit were measured on 1.19.4 (DeepSeek) before this change. The plugin writes no text of its own: the note is lich's envelope, passed on byte for byte.

tests/fixtures/session-touched.jsonl is read at lich c62b0796, which no release ships yet; the version spots stay 0.22.0.

Not measured: Claude Code's NotebookEdit payload, Cursor's edit through a tool other than Write, opencode 2 (which keeps its path-less refresh), and Windows.

Test plan

  • node --test tests/*.test.mjs: 462 pass. The new tests/touched.test.mjs runs every harness's client against a stub answering with the fixture's notes: the body each sends, hold and collect, the note in each harness's shape byte for byte, nothing on a 204, a held touch or an old Crush's PreToolUse, and fail-open (outside lich, refused connection, 500, non-JSON, no note).
  • claude plugin validate .claude-plugin/plugin.json and agy plugin validate . pass with their usual warnings.
  • tests/refresh-fixtures.sh leaves no diff.

…ough the touched report

The plugin is hooks and skills. The mod's controls, usage, errands footer,
compacting bracket, self-run commands and prompt catalogs go with lich's
/mod/* contracts. The edit guard becomes the session-touched contract at lich
c62b0796: report-touched.sh names the files a write touched (absolute, each
once) and hands lich's note to the model in each harness's shape; Antigravity
and Kiro hold it and collect it before the next model call or prompt. The
opencode and omp modules do the same in process. Antigravity's matcher names
its 1.5.15 write tools too.
@omartelo
omartelo merged commit 179fb11 into main Nov 23, 2026
2 checks passed
@omartelo omartelo mentioned this pull request Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant