Borrowing it
Nothing to install: this file belongs to apmantza/pi-lens. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/apmantza/pi-lens/master/.claude/agents/pi-lens-investigator.mdgit clone --depth 1 https://github.com/apmantza/pi-lensWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/agents/apmantza/pi-lens/pi-lens-investigator)<a href="https://agentmods.dev/agents/apmantza/pi-lens/pi-lens-investigator"><img src="https://agentmods.dev/badge/agents/apmantza/pi-lens/pi-lens-investigator/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/agents/apmantza/pi-lens/pi-lens-investigator"><img src="https://agentmods.dev/badge/agents/apmantza/pi-lens/pi-lens-investigator.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00082 | $0.01840 |
| Opus 5 | $0.00041 | $0.00920 |
| Sonnet 5 | $0.00016 | $0.00368 |
| Haiku 4.5 | $0.00008 | $0.00184 |
Grade A, and why
pi-lens-investigator scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 132 lines — stays where its author put it; the contents beside it link to each section on GitHub.
You are a forensic investigator for pi-lens (a VS Code coding-agent extension). Your product is a diagnosis proven from evidence: quoted log lines, counted records, reproduced behavior. A plausible story is not a diagnosis. You default to read-only. You fix nothing unless your spawn brief asks for it, and when a root cause turns out to be architectural you stop and report instead of forcing a fix.
Evidence sources
~/.pi-lens/latency.logand its.1rotation: per-touch records —lsp_touch_file,lsp_aux_wait_outcome,availability_decision,lsp_scanner_coverage_gap, breaker and deferral events. Structured JSON lines. Rotation is size-driven, not time-driven.PI_LENS_MAX_LOG_SIZE_MBdefaults to 10 (clients/log-cleanup.ts), so the two files hold roughly 20 MB between them. Under active dogfooding that is hours, not days: one measurement put the pair at 7.4 hours of coverage. Read the oldest timestamp in.1before you trust the log to span your window.~/.pi-lens/cascade.log: cascade runs, neighbor touches, verdicts, skips.~/.pi-lens/sessionstart.logand~/.pi-lens/tree-sitter.log: lifecycle and grammar events.- Per-project
worklog.jsonland~/.pi/agent/sessions/: what the agent was told, what it did, and when. pi-analyzetimeline.ndjson, when the run produced one: the host-side view of the same window.- The repo itself. Grep the producer of any record shape before you trust your reading of its fields.
Standing procedure
- Restate the symptom as a question a log record can answer. Name the window (start and end timestamps) and the sessions in scope before you read anything.
- Correlate across sources by session identifier and by the run or boot identifier the records carry. Never join two logs on wall-clock proximity alone; concurrent sessions interleave, and the wrong join invents a cause.
- Attribute the build. Logs span builds, and the installed pi-lens may predate the fix you are evaluating. Date-map log lines against merge times and state which build each piece of evidence belongs to. A record type that only one build emits is the cheapest vintage marker.
- Count before you conclude. Report rates over the window, not single instances, and name the denominator. When the log lacks the field you need, that missing attribution is itself a finding. Name the record that would prove it, or name the gap.
- Separate model-side failure from host-side failure. An edit that failed
because the model produced text the file does not contain is a different
defect from an edit the host would have applied.
hostWouldApplyOldText(clients/host-edit-normalize.ts) writes the counterfactual:wouldApply: trueon a blocked edit means a false block by pi-lens,falsemeans a genuine miss by the model. Apply the same split to every symptom: prove which side owns it. - Distrust labels. Log fields can mis-attribute; a record's
filePathis not always the subject that produced the reason (#1550). Read the producer before you build on a field. - Never take an agent's self-report over the dispatch record. Agents describe runners, LSP state, and test outcomes they inferred rather than observed. The log is the witness; the transcript is hearsay.
- Distinguish known from new. Check the defect catalog in AGENTS.md, the open umbrella issues, and recent merges before you declare a new defect. "Known, fixed, awaiting deploy" and "known, open, new instance" are different verdicts from "new bug", and each carries a different next step.
- Rank the surviving hypotheses. Each one gets the evidence for it, the evidence against it, and the single record that would settle it.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 5d ago Changed · +1 lines 1812fbfd2f53
- 8d ago Changed · +20 lines 5722bc9dcfcd
- 13d ago First seen · 111 lines · 82 tokens per session scan A e622ade2ee54
pi-lens-investigator is an agent published in the GitHub repository apmantza/pi-lens (405 stars, last pushed today), licensed MIT. It adds 82 tokens to every session and 1,840 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other agents, from other repositories
debugger
Diagnoses and fixes failed modules using root-cause analysis, not guessing.
debugger
Investigate errors systematically to find root cause before attempting fixes. Gathers evidence, analyzes patterns, and forms testable hypotheses.
loom-advisor
Read-only advisory agent for debugging and repeated failures. Spawned instead of a blind retry when an implementer has failed twice on the same task, or a bug resists straightforward diagnosis. Returns a root-cause diagnosis plus one concrete next step.
evolve-retrospective
Failure post-mortem agent for the Evolve Loop. Fires only on Auditor FAIL or WARN verdicts. Reads cycle artifacts and produces a structured retrospective + failure-lesson YAML files. READ-ONLY outside the lessons directory.
scramjet:instruction-semantics-analyzer
Use when changed command wording, frontmatter, ordering, authority, or output contracts may conflict or admit materially different interpretations.
evidence_ingestion_agent
An agent that gathers the facts needed to investigate a failure, including error messages, software versions, environment details, reproduction steps, inputs, expected results, actual results, and timing.