feat: Task Objective widget with session discovery#263
Open
m-mcgowan wants to merge 3 commits intosirmalloc:mainfrom
Open
feat: Task Objective widget with session discovery#263m-mcgowan wants to merge 3 commits intosirmalloc:mainfrom
m-mcgowan wants to merge 3 commits intosirmalloc:mainfrom
Conversation
Adds a new widget that displays the current Claude Code task objective in the status line, with emoji status indicators and elapsed timer. The widget reads from session-keyed task files written by Claude via instructions injected into CLAUDE.md during install. A PreToolUse hook auto-approves writes to task files without prompting. Session ID discovery bridges the gap between Claude Code (which doesn't expose session_id to conversations) and the widget (which needs it): ccstatusline writes the session ID to a file keyed by the Claude CLI PID, which Claude discovers via echo $PPID. New files: - src/widgets/TaskObjective.ts - the widget - src/utils/session-discovery.ts - PID-based session ID bridge - src/utils/claude-md.ts - CLAUDE.md instruction management - docs/task-objective.md - architecture documentation Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The elapsed timer now uses a sidecar file (.started) to persist the start time across ccstatusline process restarts. The timer freezes when the task reaches a terminal status (complete, failed). Also updated CLAUDE.md instructions with status value table and guidance on task description length. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
4 tasks
Tests cover rendering, status indicators, elapsed timer with sidecar persistence, freeze on completion, maxWidth truncation, plain text fallback, preview mode, and editor display. Co-Authored-By: Claude Opus 4.6 (1M context) <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.
Summary
Adds a new task-objective widget that displays what Claude is currently working on in the status line, with emoji status indicators and a persistent elapsed timer.
session_idto conversations) and the widgetNew files
src/widgets/TaskObjective.ts— the widgetsrc/utils/session-discovery.ts— PID-based session ID bridgesrc/utils/claude-md.ts— CLAUDE.md instruction management (tagged markers for idempotent update/removal)docs/task-objective.md— architecture documentationHow it works
~/.cache/ccstatusline/sessions/<pid>echo $PPID+ reading the session file{"task":"...","status":"..."}to~/.cache/ccstatusline/tasks/claude-task-<session-id>Install flow additions
When the task-objective widget is in the config,
installStatusLine():Bash(echo $PPID)andRead(//...sessions/*)permissionsPreToolUsehook onWritethat auto-approves task file writes (needed because Claude Code's permission system doesn't reliably match Write paths outside the project)~/.claude/CLAUDE.mdSee
docs/task-objective.mdfor full architecture details.Test plan
task-objectivewidget to ccstatusline config🤖 Generated with Claude Code