Skip to content

feat: tell a session which other lich session just edited a file - #36

Merged
omartelo merged 1 commit into
mainfrom
feat/edit-guard
Oct 5, 2026
Merged

omartelo merged 1 commit into
mainfrom
feat/edit-guard

Conversation

@omartelo

@omartelo omartelo commented Oct 5, 2026

Copy link
Copy Markdown
Collaborator

A subagent worker now shares its caller's checkout by default, so several Claude Code sessions can edit the same files.

Measured on 2.1.289: Claude Code already refuses Write, NotebookEdit and an Edit whose text changed when the file changed since its last read, and applies an Edit whose text is intact with a note. So the guard never denies: hooks/edit-guard.js records each successful edit under the checkout's git dir (lich-edits/<hash>), and when a different lich session edited the same file in the last 10 minutes the result gains a context line naming it and suggesting send_to_session / lich send. Outside lich or a git repo it does nothing; its own failures are logged and never fail an edit.

Tests: node 281/281, claude plugin test . 19/19, validate ok. Live with two sessions: the model received the note. Limits in docs/edit-guard.md (id not label, Bash edits unseen, markers never pruned).

… a file

A subagent lich opens shares the asking session's checkout, so two sessions
can edit one file. Each edit now leaves a marker under the checkout's git dir,
and an edit to a file another lich session marked in the last ten minutes
carries a context line naming it and how to reach it. Nothing is denied:
Claude Code 2.1.289 already refuses a Write, a NotebookEdit or an Edit that
would overwrite a change it has not read (docs/edit-guard.md).
@omartelo
omartelo merged commit f962e31 into main Oct 5, 2026
3 checks passed
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