Skip to content

feat: attach a reply address so the receiver can answer - #4

Merged
abruption merged 1 commit into
mainfrom
feat/3-reply-address
Sep 7, 2026
Merged

abruption merged 1 commit into
mainfrom
feat/3-reply-address

Conversation

@abruption

Copy link
Copy Markdown
Owner

Summary

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 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:

---
Reply: cc-peer send --host 100.122.73.69 --to documents-ed
  • Own session resolved from CLAUDE_CODE_MESSAGING_SOCKET (pid → registry → name). Outside a session the line is skipped.
  • Host resolution: --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.
  • Only 100.64.0.0/10 counts as a tailnet address — matching 100. alone would accept ordinary public IPs like 100.200.x.x.
  • Built before dispatch. Detecting on the far side would advertise the receiver its own address.
  • --no-reply-to omits it; --reply-to HOST states 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

  • feat
  • fix
  • docs
  • chore / refactor / test / perf

Checklist

  • python3 cc_peer.py list works locally
  • python3 cc_peer.py list --host <a real host> works over SSH
  • --dry-run resolves a target without posting anything
  • Commits follow Conventional Commits
  • Docs updated if behavior changed (README / SKILL.md / CLAUDE.md)
  • No secrets, tokens, or session keys in the diff

Verified against

v2.1.263 — macOS 26 (arm64) sender, Ubuntu 24.04 (arm64) receiver.

Detection returns documents-ed / 100.122.73.69 on this machine; --dry-run reports 65 chars with the line and 1 without it. Reverse SSH was confirmed working first (OK: abruptly.local from 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-to so an exchange ends after one round. A full round trip gets exercised after this lands and the four machines are updated.

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.
@abruption
abruption merged commit 0d6702c into main Sep 7, 2026
1 check passed
@abruption
abruption deleted the feat/3-reply-address branch September 7, 2026 07:47
@abruption abruption mentioned this pull request Sep 7, 2026
7 of 10 tasks
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.

feat: attach a reply address so the receiving session can answer

1 participant