Skip to content

feat(widgets): add an Agent Name widget - #842

Open
nateainsworth wants to merge 3 commits into
sirmalloc:mainfrom
nateainsworth:feat/agent-name-widget
Open

nateainsworth wants to merge 3 commits into
sirmalloc:mainfrom
nateainsworth:feat/agent-name-widget

Conversation

@nateainsworth

Copy link
Copy Markdown

What

An Agent Name widget shows the name other sessions use to message one another. Raw value mode shows just the name. The widget hides when Claude Code hasn't written a name for the session.

Why

With agent teams, sessions message each other by name, but nothing on screen shows which name belongs to which terminal. Without it, you either rename every session to something you'll remember, ask each session for its name, or your agent ends up messaging every agent just to find the one working in a certain worktree or on a certain branch.

This name is different from the other two names a session can have:

  • Session Name shows the session's title, such as Fix login redirect.
  • --agent is the agent definition a session was started with.

Demo

Each terminal shows its own name:

Model: Opus 5.5 | Ctx Used: 12.0% | Agent: web-app-b3

You read the name off the other terminal and tell this session to message it:

> tell web-app-b3 to ping us when it's done with the worktree it's on, then start implementing the plan

How

Claude Code writes <config>/sessions/<pid>.json for each running session, with sessionId, name, bridgeSessionId and updatedAt. Remote Control Status already reads these files, so the scan becomes shared:

 src/utils/claude-settings.ts
+  findSessionManifest(sessionId)      # matches session_id; newest updatedAt wins over stale files
   getRemoteControlStatus(sessionId)
-    readdir sessions/ → first match   # could pick a crashed session's leftover
+    findSessionManifest → bridgeSessionId
+  getAgentName(sessionId)
+    findSessionManifest → name        # wrong-typed name/updatedAt ignored, never hides Remote Control

 src/widgets/
+  AgentName.ts                        # like SessionName: Session category, "Agent: ", raw value

Settings

This adds a new widget type, agent-name. Older ccstatusline releases skip it and leave the settings file unchanged.

Testing

  • bun run lint is clean and bun run build succeeds.
  • bun test: 4411 pass. Eight tests fail, and the same eight fail on main on my machine: 7 context window override tests and 1 line bars test.
  • New tests cover:
    • the widget's preview and render
    • getAgentName: matching, missing or empty names, newest-wins, and malformed, wrong-typed or .key files
    • getRemoteControlStatus: newest-wins, and wrong-typed fields
  • I piped the built CLI real payloads from three live sessions, and each showed its own name.

@nateainsworth
nateainsworth force-pushed the feat/agent-name-widget branch from fdf8637 to 19e7d91 Compare December 1, 2026 21:30
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.

1 participant