Feature request: instance registry so Claude knows if it's working alone in a folder before committing
For 20 years my workflow has included tiny drive-by fixes. While working on feature A, I spot weird wording or a wrong button color and just fix it on the spot. A one-line change, not worth a branch and not worth a worktree (I know about both, that's not the ask). Later I either commit it separately or leave it out of the feature commit.
With agents this breaks down. When an agent finishes its task and commits, it sometimes commits everything in the working tree, including fixes it never made. Sometimes it gets confused by changes it didn't author and asks about them. Sometimes it correctly notices they are unrelated and leaves them out, but that feels like luck rather than design.
The agent has no way to know whether it is the only writer in that folder.
My proposal: Claude Code instances register themselves in a local registry, which could be as simple as a shared file under ~/.claude/ with pid, cwd and a heartbeat. Before committing, an instance checks it:
- If it is the only registered instance in that folder, unknown changes are probably the human's. Ask about them, or leave them unstaged.
- If other instances are registered in the same folder, be conservative and stage only the files it actually touched.
Related issues: #77463 (instance identity and visibility across concurrent sessions), #74386 (session liveness signal), #60295 (sessions in the same repo interfering with each other), #68915 (agent committed all uncommitted changes). This request combines the two halves: use instance awareness to make commit scoping smart.
I am not asking for locking or coordination between instances, just awareness, so agents can commit like a careful human colleague: only what they actually did.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗