Skip to content

Comments

Add Session Name widget#142

Merged
sirmalloc merged 3 commits intosirmalloc:mainfrom
arjunlall:feature/session-name-widget
Feb 21, 2026
Merged

Add Session Name widget#142
sirmalloc merged 3 commits intosirmalloc:mainfrom
arjunlall:feature/session-name-widget

Conversation

@arjunlall
Copy link
Contributor

Summary

Adds a native Session Name widget that displays the Claude Code session name set via the /rename command.

Currently, displaying session names requires a custom-command workaround with a bash script that parses the session file. This PR adds native support, making it simpler to configure and more performant (direct file read vs spawning a subprocess).

Implementation

  • Reads transcript_path from the status JSON (already available in context)
  • Parses the JSONL file to find custom-title entries
  • Returns the most recent session name (searches from end of file)
  • Supports rawValue mode like other widgets
  • Returns null when no session name is set (widget hidden)

Changes

  • src/widgets/SessionName.ts - New widget implementation
  • src/widgets/__tests__/SessionName.test.ts - 9 unit tests
  • src/widgets/index.ts - Export
  • src/utils/widgets.ts - Registry entry
  • README.md - Documentation

Test plan

  • All existing tests pass (49 total)
  • New widget tests pass (9 tests)
  • Lint passes
  • Build passes
  • Manual testing with test JSONL file

🤖 Generated with Claude Code

arjunlall and others added 3 commits January 23, 2026 23:04
Adds a native widget to display the Claude Code session name set via the
/rename command. The widget reads the transcript file and extracts the
customTitle from custom-title entries.

- New SessionName widget with rawValue support
- 9 unit tests
- README documentation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@sirmalloc sirmalloc merged commit 62903d8 into sirmalloc:main Feb 21, 2026
@sirmalloc
Copy link
Owner

Thanks for this, it'll go out in the next release

@sirmalloc sirmalloc mentioned this pull request Feb 21, 2026
@arjunlall
Copy link
Contributor Author

arjunlall commented Feb 21, 2026 via email

@sirmalloc
Copy link
Owner

I think how claude code handles this may have changed. Ill take a look and file another fix if so. Its also handled natively in CC so less needed in statusline, but a good option nonetheless if it works.

@arjunlall I tested it briefly with a /rename in v2.1.50 of CC and it seemed to pick it up just fine. Did they add it to the statusline json or something recently?

@sirmalloc sirmalloc mentioned this pull request Feb 21, 2026
2 tasks
@arjunlall
Copy link
Contributor Author

arjunlall commented Feb 21, 2026 via email

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