Add task-lens mod (ui)

DE
8h ago
+1143-0

What it does

task-lens adds a band above the prompt with one line per background task (subagent, background shell, workflow): a kind tag for the work happening right now ([read] [code] [plan] [docs] [test] [run]), one plain sentence about why the task is running, and how long it has been going. Finished tasks keep a one-line result until the next prompt. /lens lists every tracked task, /lens clear removes finished ones. In the VS Code extension, where the band is not drawn, the same lines open in a task-lens pane.

task-lens demo

Install: npx claude-code-templates --mod ui/task-lens. One option, language (default auto, follows the language of the last prompt).

How it differs from ui/agent-flow

  • agent-flow is a side pane with the subagent tree. task-lens is a band above the prompt with no pane (a pane only in VS Code, where the band is not drawn).
  • task-lens also covers background shells (run_in_background Bash/PowerShell) and workflows (grouped, with finished/all progress), not only subagents.
  • One purpose sentence per task, written by Haiku in the user's language, instead of raw tool calls.
  • Kind tags and language-neutral symbols (▶ ✓ ✗ ■, $, ⏳, →).

Packaging

  • Vendored from https://github.com/delpotro96/task-lens at tag v0.5.3 (MIT). I'm the author.
  • Copied unchanged from the tag: .claude-plugin/plugin.json, .claude-plugin/icon.png, hooks/hooks.json, hooks/register.tsx, types/index.d.ts, LICENSE. The upstream marketplace.json, tsconfig.json and bundled .claude-plugin/types/ are not included; the shared types/claude-code.d.ts is used instead.
  • The upstream test file (hooks/register.test.tsx, 19 tests) is not included: it uses testing APIs newer than the shared 2.1.301 declarations, and the catalog CI only runs tests from a tests/ folder. It stays in the upstream repo.
  • README.md rewritten for the catalog: vendor line, --mod install, commands, language option, images as raw URLs pinned to the tag.
  • No generated catalog files touched (docs/components.json, dashboard/public/**).
  • Network only via $.model.complete (Haiku, through Claude Code's own model access): at most 12 calls per task and 120 per session. Secrets (tokens, passwords, Authorization/cookie headers, URL credentials) are masked before anything is drawn or sent. No $.process.run, no keys, no absolute paths.

Testing

Windows 11, Node v22.23.2, Claude Code 2.1.309.

  • Typecheck as in mods-typecheck.yml (cd cli-tool/components/mods && npx -y -p typescript@5 tsc -p tsconfig.json): exit 0, no errors. The module also typechecks against the 2.1.309 declarations upstream.
  • claude plugin validate cli-tool/components/mods/ui/task-lens: passed.
  • Upstream claude plugin test: 19 pass, 0 fail (band, VS Code pane, background Bash and PowerShell shells, workflows, kind tags, secret masking, language following).
  • The mods-typecheck.yml structure check (plugin.json has name, hooks.json modules exist) passes.

Summary by cubic

Adds the task-lens UI mod in cli-tool/components/mods/ui/task-lens: a band above the prompt with one line per running background task (subagents, background shells, workflows), showing a kind tag, a purpose sentence, and elapsed time, with results for finished tasks kept until the next prompt. In VS Code the same content appears in a task-lens pane instead of the band. Bumped to v0.5.5, which caps the band at four lines and limits it to one line per running task.

  • Vendored from delpotro96/task-lens v0.5.5 (MIT); it's a new component, and no catalog files (docs/components.json) are touched, nor any environment variables or secrets added.
  • Installs via npx claude-code-templates --mod ui/task-lens, adding /lens and /lens clear commands and a language option (default auto).
  • Secrets (tokens, passwords, headers, URL credentials) are masked before anything is drawn or sent; network access is limited to $.model.complete (Haiku) with caps of 12 calls per task and 120 per session.
  • The upstream test file isn't vendored; hooks/register.tsx typechecks cleanly, though the shared types/claude-code.d.ts (2.1.301) causes tsc errors on the Bash/PowerShell hook until regenerated.