feat(warp): include session_name in structured payloads#74
Open
nscrdev wants to merge 2 commits into
Open
Conversation
Claude Code maintains a session registry at ~/.claude/sessions/<pid>.json containing each session's human-readable name (kept current on /rename). Look it up by session_id at payload-build time and forward it as session_name on every warp://cli-agent payload, so Warp can label the sidebar/tab with the session name instead of duplicating the cwd path. Addresses the data half of warpdotdev#34; Warp-side rendering can adopt the field once it is present in payloads. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ntry Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The Warp sidebar shows the cwd path twice for a Claude Code session — once as the title and once as the subtitle — because the structured payloads only carry
session_id,cwd, andproject. The human-readable session name never reaches Warp. This is the data half of #34 (tab title not updated on /rename).Change
Claude Code maintains a session registry at
~/.claude/sessions/<pid>.json— one file per running session containingsessionId,name,updatedAt, etc. Thenamefield is kept current on/rename.build_payload()now looks up the session name bysession_idin that registry and includes it assession_nameon everywarp://cli-agentpayload. Since the lookup happens at payload-build time, any payload sent after a/rename(next prompt submit, tool use, or stop) carries the new name.Details:
session_name— hooks never break.sessionIdentries exist (stale files), the most recently updated entry wins (max_by(.updatedAt)).jqinvocation per payload; respectsCLAUDE_CONFIG_DIR, andCLAUDE_SESSIONS_DIRoverrides the registry location for tests.main).Warp-side note
This PR only supplies the data. To fix the duplicated sidebar line, Warp's sidebar renderer should prefer
session_nameovercwdfor the title row when the field is non-empty.🤖 Generated with Claude Code