Skip to content

Add clickable session link to statusline output#219

Merged
AnnatarHe merged 1 commit intomainfrom
claude/add-session-cost-link-bbUke
Feb 10, 2026
Merged

Add clickable session link to statusline output#219
AnnatarHe merged 1 commit intomainfrom
claude/add-session-cost-link-bbUke

Conversation

@AnnatarHe
Copy link
Copy Markdown
Contributor

@AnnatarHe AnnatarHe commented Feb 10, 2026

Summary

This PR adds support for displaying a clickable OSC8 hyperlink to the coding agent session page in the statusline output. The session cost now links directly to the session details page when user login, web endpoint, and session ID are available.

Key Changes

  • Model Update: Added SessionID field to CCStatuslineInput struct to capture session identifier from Claude Code
  • Command Update: Pass SessionID from the input data to the formatStatuslineOutput function
  • Formatting Logic: Enhanced formatStatuslineOutput to wrap the session cost display with an OSC8 hyperlink when all required parameters (userLogin, webEndpoint, sessionID) are present
    • Link format: {webEndpoint}/users/{userLogin}/coding-agent/session/{sessionID}
    • Only creates link if all three parameters are non-empty
  • Test Coverage: Added comprehensive tests for the new linking functionality
    • Test for successful link creation with all parameters
    • Tests for graceful fallback when any parameter is missing
    • Updated all existing tests to include the new sessionID parameter

Implementation Details

  • Uses the existing wrapOSC8Link utility function to create terminal-compatible hyperlinks
  • Maintains backward compatibility - statusline displays correctly even without session ID
  • Link is only generated when all required context is available, preventing broken or incomplete URLs

https://claude.ai/code/session_01WQfLuZR6hgxmy3pwvkukBU


Open with Devin

The session cost field (💰) now links to the session detail page at
shelltime.xyz when userLogin, webEndpoint, and session_id are available.
URL format: {webEndpoint}/users/{userLogin}/coding-agent/session/{sessionID}

https://claude.ai/code/session_01WQfLuZR6hgxmy3pwvkukBU
@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @AnnatarHe, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the statusline output by making the session cost clickable. Users can now directly navigate to their coding agent session details page from the terminal, improving usability and access to session information. The change ensures that the link is only generated when all necessary data is present, maintaining robustness and backward compatibility.

Highlights

  • Clickable Session Link: Implemented support for displaying a clickable OSC8 hyperlink for the coding agent session cost in the statusline output, linking directly to the session details page.
  • Model Update: Added a SessionID field to the CCStatuslineInput struct to capture the session identifier from Claude Code.
  • Formatting Logic Enhancement: Modified the formatStatuslineOutput function to conditionally wrap the session cost with an OSC8 hyperlink when the user login, web endpoint, and session ID are all available.
  • Test Coverage: Added new comprehensive tests to verify successful link creation and graceful fallback when any required parameter for the link is missing, and updated existing tests to accommodate the new sessionID parameter.
Changelog
  • commands/cc_statusline.go
    • Updated commandCCStatusline to pass the new SessionID to the formatStatuslineOutput function.
    • Modified formatStatuslineOutput to accept a sessionID parameter.
    • Added logic within formatStatuslineOutput to create an OSC8 hyperlink around the session cost if userLogin, webEndpoint, and sessionID are all provided.
  • commands/cc_statusline_test.go
    • Updated all existing formatStatuslineOutput test calls to include an empty string for the new sessionID parameter.
    • Added TestFormatStatuslineOutput_SessionCostWithLink to verify correct OSC8 link generation.
    • Added TestFormatStatuslineOutput_SessionCostWithoutLink to ensure no link is generated when required parameters are missing.
  • model/cc_statusline_types.go
    • Added a SessionID field of type string with a json:"session_id" tag to the CCStatuslineInput struct.
Activity
  • No human activity has been recorded on this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 3 additional findings.

Open in Devin Review

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds a great feature by making the session cost in the statusline a clickable link to the session details page. The implementation is straightforward and includes comprehensive test coverage for both the new functionality and fallback scenarios. I've made one suggestion to make the URL construction more robust against variations in the webEndpoint configuration.

Comment thread commands/cc_statusline.go
Comment on lines +149 to +152
if userLogin != "" && webEndpoint != "" && sessionID != "" {
url := fmt.Sprintf("%s/users/%s/coding-agent/session/%s", webEndpoint, userLogin, sessionID)
sessionStr = wrapOSC8Link(url, sessionStr)
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Constructing URLs with fmt.Sprintf can be brittle. If webEndpoint has a trailing slash, it will result in a double slash in the final URL (e.g., https://example.com//users/...). While many servers handle this, it's more robust to prevent it. Using strings.TrimSuffix is a simple way to ensure the URL is always correctly formed.

Suggested change
if userLogin != "" && webEndpoint != "" && sessionID != "" {
url := fmt.Sprintf("%s/users/%s/coding-agent/session/%s", webEndpoint, userLogin, sessionID)
sessionStr = wrapOSC8Link(url, sessionStr)
}
if userLogin != "" && webEndpoint != "" && sessionID != "" {
url := fmt.Sprintf("%s/users/%s/coding-agent/session/%s", strings.TrimSuffix(webEndpoint, "/"), userLogin, sessionID)
sessionStr = wrapOSC8Link(url, sessionStr)
}

@AnnatarHe AnnatarHe merged commit 763e116 into main Feb 10, 2026
4 of 5 checks passed
@AnnatarHe AnnatarHe deleted the claude/add-session-cost-link-bbUke branch February 10, 2026 11:50
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.

2 participants