Repository navigation
feat: tell a session which other lich session just edited a file - #36
Merged
Merged
Conversation
… 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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.jsrecords 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 suggestingsend_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).