Repository navigation
feat: attach a reply address so the receiver can answer - #4
Merged
Merged
Conversation
Messages were fire-and-forget, and SKILL.md told the receiving Claude outright that it could not answer — which is what actually made them one-way. The transport was never the problem: the far side can reply whenever it can SSH back here, it just had no way to know that or where to aim. Every send now appends one line naming this machine's tailnet address and the session cc-peer is running inside, resolved from CLAUDE_CODE_MESSAGING_SOCKET. --no-reply-to omits it; --reply-to states it directly. The line is built before dispatch on purpose. Detecting on the far side would advertise the receiver's own address back at it. Address detection prefers `tailscale ip -4` and falls back to scanning interfaces, since macOS keeps that CLI inside the app bundle. Only 100.64.0.0/10 counts — matching "100." alone would accept ordinary public addresses. SKILL.md now tells the receiver how to answer and to use --no-reply-to when it does, so two agents don't keep replying to each other.
10 tasks done
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.
Summary
Messages were fire-and-forget, and
SKILL.mdtold the receiving Claude outright that it could not answer — which is what actually made them one-way. The transport was never the limitation: the far side can reply whenever it can SSH back, it just had no way to know that or where to aim.Every send now appends one line:
CLAUDE_CODE_MESSAGING_SOCKET(pid → registry → name). Outside a session the line is skipped.--reply-to→CC_PEER_REPLY_HOST→tailscale ip -4→ interface scan. macOS keeps that CLI inside the app bundle, so the scan path is the one that actually runs there.100.64.0.0/10counts as a tailnet address — matching100.alone would accept ordinary public IPs like100.200.x.x.--no-reply-toomits it;--reply-to HOSTstates it directly.This grants no access: anyone who can reply could already have sent unprompted. What it adds is the receiver knowing a reply is possible.
Closes #3
Type
Checklist
python3 cc_peer.py listworks locallypython3 cc_peer.py list --host <a real host>works over SSH--dry-runresolves a target without posting anythingVerified against
v2.1.263 — macOS 26 (arm64) sender, Ubuntu 24.04 (arm64) receiver.
Detection returns
documents-ed/100.122.73.69on this machine;--dry-runreports 65 chars with the line and 1 without it. Reverse SSH was confirmed working first (OK: abruptly.localfrom KR, key auth), so the address is reachable rather than decorative.Notes
Loop risk is real now that replies are addressable — SKILL.md instructs the receiver to answer with
--no-reply-toso an exchange ends after one round. A full round trip gets exercised after this lands and the four machines are updated.