Skip to content

Context usage monitoring #24

@nthomsencph

Description

@nthomsencph

Summary

Display context window usage on task cards and in the task header by querying Claude Code's /context command via hooks.

Context

Dash has no visibility into context usage. Claude Code handles compaction internally and exposes context info via the /context slash command. This can be queried programmatically through the PTY on each agent turn without disrupting the user.

Implementation

  • Query context usage by sending /context through the PTY, triggered asynchronously via hooks (e.g., on each Stop hook callback)
  • Parse the structured output to extract token count / percentage
  • Display a context usage indicator (token count or percentage bar) on task cards and in the task header
  • Visual warning when context is running high, cueing users to start a new conversation or trigger /compact
  • Surface compaction events in the task's activity timeline

References

  • Inspired by pi.dev's visual context limit indicators and auto-compaction
  • See docs/pidev-feature-analysis.md §6

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium priorityenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions