Skip to content

feat: Context Inspector — sub-agent context visibility, coverage scores, lint warnings#267

Merged
vivekchand merged 1 commit intomainfrom
fix/gh-clawmetry-9-context-inspector
Mar 21, 2026
Merged

feat: Context Inspector — sub-agent context visibility, coverage scores, lint warnings#267
vivekchand merged 1 commit intomainfrom
fix/gh-clawmetry-9-context-inspector

Conversation

@vivekchand
Copy link
Owner

Closes #9

What

Implements the Context Inspector feature for debugging context loss in multi-agent AI systems.

Backend ():

  • Scans workspace for known context files (SOUL.md, AGENTS.md, MEMORY.md, USER.md, TOOLS.md, etc.)
  • Reads session index to build agent tree with depth/parent relationships
  • Computes per-agent Coverage Score (0–100) based on: task presence, SOUL.md, MEMORY.md, AGENTS.md, task length ≥50 chars, memory/ files present
  • Generates Lint Warnings per agent: context starvation on deep sub-agents, missing USER.md when task references user data, missing SOUL.md/MEMORY.md
  • Deduplicates global lint warnings across sessions

Frontend (Context tab):

  • Nav tab in both light/dark themes
  • 4 stat cards: Total Agents, Avg Coverage %, Lint Warnings, Context Files Found
  • Workspace context file checklist with ✅/❌ and KB sizes
  • Lint warnings panel with colour-coded severity (🔴 error / 🟡 warn / 🔵 info)
  • Agent context tree with depth indentation, coverage score badges, spawn task snippet, and missing file highlights

How

  • New blueprint with
  • helper with , , sub-functions
  • async JS function wired to
  • Page HTML added to both theme sections

Tests

5 new tests in — all 81 tests pass (6 skipped unchanged)

…lint warnings (closes #9)

- /api/context-inspector endpoint: workspace file discovery, per-agent coverage score
  (0-100 heuristic: SOUL.md, MEMORY.md, AGENTS.md, task length, memory/ files),
  lint warnings (context starvation, missing USER.md, short sub-agent tasks)
- Context tab in both nav themes with 4 stat cards, context file checklist,
  lint warnings panel, and agent tree with depth indentation + coverage colour
- loadContextInspector() JS renders full inspector on tab switch
- 5 new tests in TestContextInspector — all 81 pass
@vivekchand vivekchand merged commit c7d67e7 into main Mar 21, 2026
9 checks passed
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.

Feature: Context Inspector — Sub-agent context visibility & debugging

1 participant