Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ export class SessionFull {
"desktopTitle"?: string;
"desktopId"?: string;
"permissionMode"?: string;
"remoteUrl"?: string;

/** Creates a new SessionFull instance. */
constructor($$source: Partial<SessionFull> = {}) {
Expand Down
8 changes: 8 additions & 0 deletions frontend/src/lib/SessionDetail.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,14 @@
<dt class="text-subtext">Worktree</dt>
<dd class="text-accent">yes {#if detail.mainRepo}<span class="text-subtext">({detail.mainRepo})</span>{/if}</dd>
{/if}
{#if detail.remoteUrl}
<dt class="text-subtext">Remote</dt>
<dd class="text-text truncate">
<a href={detail.remoteUrl} target="_blank" rel="noopener" class="text-accent hover:underline">
{detail.remoteUrl}
</a>
</dd>
{/if}
{#if detail.lastFileWrite}
<dt class="text-subtext">Last file</dt>
<dd class="text-text truncate">
Expand Down
2 changes: 2 additions & 0 deletions internal/api/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,7 @@ type SessionFull struct {
DesktopTitle string `json:"desktop_title,omitempty"`
DesktopID string `json:"desktop_id,omitempty"`
PermissionMode string `json:"permission_mode,omitempty"`
RemoteURL string `json:"remote_url,omitempty"`
}

// ToolItem represents a recent tool call.
Expand Down Expand Up @@ -464,6 +465,7 @@ func (s *Server) buildSessionFull(detail *core.SessionDetailView) SessionFull {
DesktopTitle: desktopTitle(sess),
DesktopID: desktopID(sess),
PermissionMode: desktopPermission(sess),
RemoteURL: sess.RemoteURL,
}
}

Expand Down
6 changes: 6 additions & 0 deletions internal/claude/jsonl.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ import (
// struct allocation entirely.
type jsonlEntry struct {
Type string `json:"type"`
Subtype string `json:"subtype"`
URL string `json:"url"`
SessionID string `json:"sessionId"`
CWD string `json:"cwd"`
Version string `json:"version"`
Expand Down Expand Up @@ -125,6 +127,10 @@ func scanEntries(scanner *bufio.Scanner, session *model.Session, initialOffset i
}
}

if e.Type == "system" && e.Subtype == "bridge_status" && e.URL != "" {
session.RemoteURL = e.URL
}

if !ts.IsZero() {
prevTimestamp = ts
entryTimestamps = append(entryTimestamps, ts)
Expand Down
33 changes: 33 additions & 0 deletions internal/claude/jsonl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -716,3 +716,36 @@ func TestCopyEntry(t *testing.T) {
t.Error("modifying copy should not affect original")
}
}

func TestParseJSONL_BridgeStatus(t *testing.T) {
content := mkJSONL(
`{"type":"system","subtype":"bridge_status","url":"https://claude.ai/code/session_ABC123","sessionId":"abc","version":"2.1.86","timestamp":"2026-01-15T10:00:00Z"}`,
`{"type":"user","timestamp":"2026-01-15T10:00:01Z","message":{"role":"user","content":"hello"},"cwd":"/proj","version":"1.0","gitBranch":"main"}`,
`{"type":"assistant","timestamp":"2026-01-15T10:00:05Z","message":{"role":"assistant","model":"claude-sonnet-4-20250514","content":[{"type":"text","text":"Hi!"}],"usage":{"input_tokens":10,"output_tokens":5}}}`,
)
path := writeTempJSONL(t, content)

sess, _, err := ParseJSONL(path)
if err != nil {
t.Fatal(err)
}
if sess.RemoteURL != "https://claude.ai/code/session_ABC123" {
t.Errorf("RemoteURL = %q, want %q", sess.RemoteURL, "https://claude.ai/code/session_ABC123")
}
}

func TestParseJSONL_NoBridgeStatus(t *testing.T) {
content := mkJSONL(
`{"type":"user","timestamp":"2026-01-15T10:00:01Z","message":{"role":"user","content":"hello"},"cwd":"/proj","version":"1.0","gitBranch":"main"}`,
`{"type":"assistant","timestamp":"2026-01-15T10:00:05Z","message":{"role":"assistant","model":"claude-sonnet-4-20250514","content":[{"type":"text","text":"Hi!"}],"usage":{"input_tokens":10,"output_tokens":5}}}`,
)
path := writeTempJSONL(t, content)

sess, _, err := ParseJSONL(path)
if err != nil {
t.Fatal(err)
}
if sess.RemoteURL != "" {
t.Errorf("RemoteURL = %q, want empty", sess.RemoteURL)
}
}
3 changes: 3 additions & 0 deletions internal/model/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ type Session struct {

// Desktop metadata (non-nil if session was started via Claude Desktop)
Desktop *DesktopMeta

// Remote control (Claude Code only, empty if unavailable)
RemoteURL string
}

// Clone returns a deep copy of the Session suitable for use as a base
Expand Down
2 changes: 2 additions & 0 deletions internal/tray/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ type SessionFull struct {
DesktopTitle string `json:"desktopTitle,omitempty"`
DesktopID string `json:"desktopId,omitempty"`
PermissionMode string `json:"permissionMode,omitempty"`
RemoteURL string `json:"remoteUrl,omitempty"`
}

// ToolItem is a tool call for the detail view.
Expand Down Expand Up @@ -253,6 +254,7 @@ func (s *SessionService) GetSessionDetail(id string) *SessionFull {
full.DesktopID = sess.Desktop.DesktopID
full.PermissionMode = sess.Desktop.PermissionMode
}
full.RemoteURL = sess.RemoteURL
return full
}

Expand Down
21 changes: 21 additions & 0 deletions internal/ui/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ type Model struct {
// Flash message (modal popup, dismissed by any key)
flashMsg string

// Inline "copied!" indicator for remote URL
copiedAt time.Time

// Update notification shown in footer
updateVersion string

Expand Down Expand Up @@ -494,6 +497,17 @@ func (m *Model) handleMouse(msg tea.MouseMsg) {
}
} else {
m.focus = 1
// Copy remote URL to clipboard on detail panel click.
if m.cursor >= 0 && m.cursor < len(m.visible) {
if u := m.visible[m.cursor].RemoteURL; u != "" {
if cmd := exec.Command("pbcopy"); cmd != nil {
cmd.Stdin = strings.NewReader(u)
if cmd.Run() == nil {
m.copiedAt = time.Now()
}
}
}
}
}
}
}
Expand Down Expand Up @@ -934,6 +948,13 @@ func (m Model) buildDetailLines(s *model.Session, width int) []string {
if s.GitBranch != "" && s.GitBranch != "HEAD" {
add(row("Git Branch", s.GitBranch))
}
if s.RemoteURL != "" {
remoteVal := lipgloss.NewStyle().Foreground(colorAccent).Render(s.RemoteURL)
if time.Since(m.copiedAt) < 2*time.Second {
remoteVal += lipgloss.NewStyle().Foreground(colorMuted).Render(" copied!")
}
add(row("Remote", remoteVal))
}

wtStr := "no"
if s.IsWorktree {
Expand Down