hermes - 💡(How to fix) Fix Feature: Smart context injection + token efficiency tracking dashboard

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
RAW_BUFFERClick to expand / collapse

Problem

Some agent tools have features around token optimisation that we should consider:

1. Smart Context Injection

At session startup, inject a project map (structure, entry points, recently modified files) into the agent context — potentially saving 30K-100K tokens per session by preventing the agent from blindly exploring the filesystem.

2. Token Efficiency Dashboard

Track tokens used vs. tokens saved per session, with a dashboard showing total tokens used, saved, average efficiency, and session ranking by savings.

We already have token tracking in some places but no structured injection of project context, and no visual dashboard for token efficiency.

Proposed Solutions

Smart Context Injection

  • Before spawning a coding session, generate a compact project structure map (tree of key dirs, entry points, recent git changes)
  • Inject this as a system message or early user message
  • Respect .gitignore / project-specific ignore patterns

Token Efficiency Dashboard

  • Add a view to the Hermes dashboard (or TUI) showing:
    • Total tokens consumed per session (we already track this via API responses)
    • Estimated tokens 'saved' via context injection
    • Per-session breakdown with ranking

Implementation Notes

  • For context injection: git diff --name-only HEAD~1 + tree -L 2 --gitignore gives a good starting point
  • Token tracking: we already get usage.prompt_tokens / usage.completion_tokens from API responses — just need to aggregate and store
  • Dashboard: extend the existing dashboard plugin or add a new endpoint

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING