diff --git a/docker/sylph-port b/docker/sylph-port index 8d756913..e0c94aab 100755 --- a/docker/sylph-port +++ b/docker/sylph-port @@ -145,9 +145,12 @@ case "${1:-}" in remote) echo "waiting for the session to register" >&2 for _ in $(seq 60); do - url=$(docker exec "$NAME" sh -c \ - 'grep -ho "https://claude.ai/code/session_[A-Za-z0-9]*" \ - /sylph-home/port/.claude/**/*.jsonl 2>/dev/null | tail -1' 2>/dev/null || true) + # Read the container LOG, not the session transcript. The transcript + # records every command run inside the container -- including this + # lookup -- so grepping it matched our own pattern string back. + url=$(docker logs "$NAME" 2>&1 \ + | grep -aoE 'https://claude\.ai/code/session_[A-Za-z0-9]+' \ + | tail -1 || true) [ -n "$url" ] && { echo "$url"; exit 0; } sleep 2 done