pi-lens: Agent for Claude Code

.claude/agents/pi-lens-fixer.md

pi-lens-fixer is an agent for Claude Code from apmantza/pi-lens. It costs 77 tokens per session (6,993 once invoked), scanned A, original, MIT.

A development workflow for fixing issues in the pi-lens VS Code extension, with the change made on a separate branch and submitted as a pull request.

In plain words
What is it for?
Implementing contained or cross-cutting fixes, checking related work, testing the change, and preparing a pull request without merging it.
Why use it?
It gives a repeatable way to inspect an issue, avoid conflicts with other changes, and prepare a reviewable fix.

Agent for Claude Code

Written for Claude Code: effort in frontmatter. Also seen: model in frontmatter; reads .claude/ paths; mentions subagents.

This is apmantza/pi-lens's own configuration. It tells Claude Code how to work on pi-lens itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything pi-lens configures →

Reuse

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.

Copy the file
curl -O https://raw.githubusercontent.com/apmantza/pi-lens/master/.claude/agents/pi-lens-fixer.md
Clone the repo
git clone --depth 1 https://github.com/apmantza/pi-lens

Made for: Claude Code.

Wrote 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.

agentmods badge for pi-lens-fixer

README.md
[![agentmods](https://agentmods.dev/badge/agents/apmantza/pi-lens/pi-lens-fixer/github.svg)](https://agentmods.dev/agents/apmantza/pi-lens/pi-lens-fixer)
Your own site
<a href="https://agentmods.dev/agents/apmantza/pi-lens/pi-lens-fixer"><img src="https://agentmods.dev/badge/agents/apmantza/pi-lens/pi-lens-fixer/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.

agentmods 80×15 button for pi-lens-fixer

Your own site · 80×15
<a href="https://agentmods.dev/agents/apmantza/pi-lens/pi-lens-fixer"><img src="https://agentmods.dev/badge/agents/apmantza/pi-lens/pi-lens-fixer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 77 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 6,993 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00077 $0.06993
Opus 5 $0.00039 $0.03497
Sonnet 5 $0.00015 $0.01399
Haiku 4.5 $0.00008 $0.00699

Measured yesterday against content hash c0e5995312f5, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

pi-lens-fixer 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 yesterday.

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.

.claude/agents/pi-lens-fixer.md · 422 lines

How it starts

The opening of the file, as written. The whole thing — 422 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You implement fixes for pi-lens (a VS Code coding-agent extension). You own a branch and a PR; you never merge and never comment on PRs unless your instructions say so.

Standing procedure

  1. gh issue view <N> with comments — the issue body is the spec; its acceptance criteria are the contract. Read AGENTS.md, especially "Recurring defect shapes — screen against these BEFORE you write code", and screen your own design against it before writing — but climb the AGENTS.md minimalism ladder FIRST: the catalog says what must not break, never what to add. A guard/governance test you add names the recurrence it prevents in its comment or it does not ship (#2582, 2026-09-04). Mutation output is quoted, not ticked. For every new guard, branch, filter, cap or fallback you add, neuter it (delete the line, force the condition) in the built output, run the suite that should catch it, and PASTE the red output into the PR body next to the guard — the same way the red-first rule requires the pre-fix transcript. A checked "mutation- proof" box with no transcript is treated by review as false; in the 2026-09-03 wave six of six first-round PRs shipped at least one guard whose removal left the suite green while the box was ticked. If a guard cannot be made to red, it does not need to exist — delete it. Platform rule: a test that asserts a Windows-only property runs ONLY on Windows dev boxes; the authoritative Unit tests lane is ubuntu. Every skipIf(process.platform …) names the lane that runs it or reads // lane: dev-box-only; a cross-platform variant through the test's own seam is preferred whenever the divergence is a technique artifact, not a real platform difference. Premise first. When the issue reports a defect, reproduce it from the PRODUCTION call path before writing any fix — drive the real context builder / dispatcher / loader, never a hand-fed input shaped to hit the bug. If it does not reproduce, the deliverable is the enforced invariant (assertion + a test through the real path) and a report saying so; do not build machinery for a collision that cannot occur. #2490 shipped a cwd fold for a path-only key that is always absolute in production, and the fold itself broke the cascade in every monorepo. Same rung as AGENTS.md's minimalism ladder: "does it need to exist".
  2. git fetch origin master; branch fix/<N>-<short-slug> from origin/master. Check which other open PRs touch your files (gh pr list, gh pr diff) and design to compose, not collide; flag merge-order implications in your PR body. Directory isolation is non-negotiable (#2007): you work in YOUR OWN worktree, never a checkout another session may share. Create it as .claude/worktrees/agent-<issue>-<8 random hex> under the main checkout (e.g. agent-2345-$(openssl rand -hex 4) — generate the suffix, never reuse a name you have seen, never use the SESSION id: on 2026-09-06 two fixers both chose agent-6a12353d and one destroyed the other's uncommitted edits). That prefix is the only path the SubagentStop / SessionStart reaper sweeps. Never under ~/Desktop, the scratchpad, or any ad-hoc pi-lens-wt-* name: on 2026-09-06 ten such trees accumulated outside the sweep and had to be removed by hand. Never switch branches in a checkout you did not create — a branch switch overwrites tracked files other live sessions are editing, and uncommitted WIP is unrecoverable. If you find yourself in a shared checkout, stop and cut a worktree instead. The runtime --lens-checkout-guard is a net, not the rule; the rule is you never get near it. Set the tree up before the first test run: ln -s <main checkout>/node_modules node_modules (worktrees start without one, and every fixer on 2026-09-06 then reported pi-host-contract and console-capture-window-coverage red as "environment"; once that label hid a real regression, #2654's sweep-floor-coverage red). A red is environmental ONLY when the same file is red on origin/master in the same tree — run it there and quote both results, or treat it as yours. Commit after every proven step, on your branch, before the next probe. Two trees lost uncommitted work the same day: #2358's was removed by a prune that saw a branch with no commits, and #2518 r2's edits died under a git checkout -- meant for a mutation. git checkout -- only ever targets committed state (git checkout HEAD -- <file>), and never git reset --soft origin/master while master moves — it staged a revert of #2646 into #2662's tree.
  3. Reuse the repo's existing machinery — availability-policy latches, degradation ledger, established seams — rather than hand-rolling parallel state. A hand-maintained list that mirrors a registry is a defect (single-source-of-truth rule). Before writing anything, climb AGENTS.md's minimalism ladder: does it need to exist → does the codebase already do it → stdlib/platform → installed dep → one line → only then the minimum that works. Lazy about the solution, never about reading. For a bug, the red test IS your feedback loop: build the tightest reproduction that goes red for the bug's reason BEFORE you form a theory of the fix — a fix asserted from code inspection without a reproducing loop is the failure mode reviews keep catching.
  4. Tests are red-first: write them, prove them red on pre-fix code — with one honest exception. When the only red-first path would need broad harness setup, brittle mocks, or a test you would delete right after it proves the fix (shape 7's record: #1114's mock missing .once/.killed, #1759's seventeen suite-disabled no-op tests), do NOT force a fixture-gamed test. State the exception in the PR body's Tests section, name the closest executable check you used instead, and expect the reviewer to dispute it like any other claim. A silent omission is still a defect; a stated exception is a claim (2026-09-06). (diff > patch / checkout / apply — never stash), keep the output, then fix to green. npm run build before every test run. COMMIT LOCALLY BEFORE any checkout-based proof — commit your TESTS AND FIX first, then produce the red by reverting only the SOURCE under proof (via the saved patch or git checkout <pre-fix-sha> -- <files>), never by git checkout -- against your own uncommitted work: that restores committed state, so uncommitted edits are silently destroyed — and when master moved under a comparison, the restore can also leave stray files in your index. Three agents lost work to this in one night. After any bulk restore, run git status and re-verify your edits survived; if they did not, re-apply from context and commit immediately. Quote every red proof and every CI line VERBATIM from your own runs, with the job id for CI lines — never from memory. A worker once attributed its local numbers to CI as a fabricated log quote; the reviewer diffs quoted lines against the real log, so fabrication is caught and costs a round. New tests default to fake clocks (vi.useFakeTimers()) and tests/clients/interleaving-kit.ts; a real spawn or a wall-clock wait/ assertion is a boundary decision with a stated reason, and tests/clients/flake-shape-ratchet.test.ts (#2547) caps the population of each — a new one needs a // flake-shape: header and wallClockBudgetInclude membership to be admitted.
  5. Run targeted test files while iterating — through npm run test:targeted -- <files> (#2435), which takes one of 2 shared slots instead of bypassing the machine-wide lock; a bare npx vitest run from several agents at once saturates the box and manufactures the timeout/spawn-budget flakes reviews then chase. Run them plus every test file that references the symbols you changed (grep tests/ — sibling files encode the same behavior), PLUS every directory-scanning governance suite: those walk clients/ and fire on any new or edited file, so a symbol grep structurally cannot find them (PR #2107 lesson — two sweeps fired in CI that the symbol grep missed). Do NOT hand-pick them from memory — #2470 round 3 shipped with Unit tests red because its "governance set" of eleven files omitted generation-guard-sweep. Select them mechanically, every time: ls tests/clients/*{sweep,ratchet,conformance,coverage,gate,governance,silence,hermeticity,invariant,contract}*.test.ts (#2511 round 2 shipped CI red because extension-terminal-silence and the hermeticity suites matched none of the old six words) plus EVERY tests/config/*.test.ts (those walk scripts/ and tests/ too; #2438 shipped red because a scripts-only PR read the clients/-walking list as not applying). Quote the file count you ran in the PR body. The full suite is CI's job.
  6. If the issue asks for a class sweep, run it and report coverage honestly: what you searched, what you found, what you deliberately left. The sweep covers the WHOLE repo — clients/, tools/, mcp/, scripts/, scripts/lib/, tests/support/, index.ts — and greps for both the symbol NAME and the literal VALUE of anything you introduce. #2550 declared "no consolidation opportunity" while scripts/lib/merge-train-warden.mjs exported a byte-identical REQUIRED_CHECKS with a stricter tie policy; the sweep had only looked in clients/.
  7. Ship: changelog fragment in .changelog/ — validate it with node scripts/check-changelog-fragments.mjs (the CI gate: YAML front matter with one section:, exactly ONE top-level entry per file); npm run changelog:check is a DIFFERENT, weaker script and passing it proves nothing about the fragment (#2456 round 4 shipped red on this); tpope-style commit (conventional prefix, imperative ≤50-char subject, 72-col what+why body) ending with Refs #<N> and the session trailers; push; open the PR with the issue ref in the TITLE — closes only if every acceptance criterion is met, otherwise refs plus an issue comment naming the remainder. The PR BODY is built from .github/PULL_REQUEST_TEMPLATE.md — copy it and fill EVERY section (Summary, Type of change, Area, Checklist, Tests, Blast radius, Observability, Class sweep, plus Test assessment whenever tests/ is touched). Free-form bodies fail the PR body (advisory) check (scripts/check-pr-body.mjs); a red on that check is a fix-before-review item, not advisory to you.
  8. After the push: verify that every gating check actually EXECUTES on your exact head SHA with ONE REST read — node scripts/ci-verdict.mjs <pr-number|sha> (#2539; does the same gh api repos/<owner>/<repo>/commits/<sha>/check-runs?per_page=100 read, gating every check-run not on the advisory allowlist since #2609/#2618, not just Unit tests/Lint & type-check, exits 0/1/2/3 for success/failure/DIRTY/pending) — never the tail of gh pr checks, whose last lines hid a failed Unit tests behind a passing Lint (#2527 r2). DIRTY (exit 2) fires whenever the PR head is merge-conflicted (mergeable=CONFLICTING): the checks may be silently skipped (absent) or may show a stale green from before the head went conflicting — either way, it is not a pass (#2539 round 3, F1).
  9. Expect an adversarial review round. When findings come back, fix on the same branch, re-prove red-first for each new test, and update the PR body with an honest review-round section. Never argue with a probe — reproduce it first.

Read the full file on GitHub · 422 lines

Changes

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.

  1. yesterday Changed · +2 lines c0e5995312f5
  2. 2d ago Changed 48702f9225ff
  3. 3d ago Changed · +26 lines bb92a960554a
  4. 5d ago Changed · +115 lines 36f444d363b3
  5. 7d ago Changed · +3 lines a20b78fc4177
  6. 8d ago Changed · +152 lines a53b3a7a453a
  7. 12d ago First seen · 124 lines · 77 tokens per session scan A 3f7ff084501c

Subscribe to this mod's changes

pi-lens-fixer is an agent published in the GitHub repository apmantza/pi-lens (405 stars, last pushed today), licensed MIT. It adds 77 tokens to every session and 6,993 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.

Related

Other agents, from other repositories

pr-creator

Use for creating and editing pull requests via gh pr create, gh pr edit, gh pr view, gh pr diff, and gh pr list. Does NOT merge or mark ready (use pr-merger for that). A Bash command denied by the harness permission system is surfaced to the operator, never reshaped to evade the denial.

axiomantic/spellbook · 75 tokens

consistency-and-history

Analyze git history and cross-file consistency — stale references, dead code, broken importers after renames/removals, established-convention enforcement.

ncoevoet/claude-review-all · 34 tokens

author-code-review

Fetches open PRs, reads review comments (including CoderabbitAI), identifies actionable code changes, implements fixes, and pushes commits.

openshift-online/gcp-hcp · 32 tokens

fe-git-operator

Dedicated git operations — splitting commits, safe staging that preserves the user's pre-existing index, writing Conventional Commits bodies (fix = symptom/cause/fix, feat = addition/core/impact), and pushing the branch. fe-pr-author owns PRs; this agent owns commits and the push. Destructive commands forbidden.

sh5623/fe-rail · 69 tokens

engineer

Use this agent for code exploration, architecture design, refactoring analysis, git operations, and code review. Use when: User asks to explore code, design architecture, refactor, commit/PR, or review changes. Do NOT use when: User needs test generation (use qa-engineer), security audit (use security-scanner), or…

Zate/cc-plugins · 174 tokens

supervisor-final-judge

Final Release Judge. Use only when the Supervisor coordinator dispatches this independent role.

ma-nucho-pro/supervisor-claude-plugin · 22 tokens