residue

residue is an agent for Claude Code from langwatch/langwatch. It costs 171 tokens per session (918 once invoked), scanned A, original, Apache-2.0.

An inspection-only agent that searches a chosen part of a repository for leftovers from incomplete refactors. It reports unused files, old compatibility layers, duplicate concepts, and checks that no longer enforce their intended limits.

In plain words
What is it for?
Use it to sweep a path, application, module, or repository and produce findings with file locations, evidence, possible impact, and confirmation commands.
Why use it?
Refactoring can remove the new code while leaving old files or names behind. This agent provides evidence for possible cleanup without editing or deleting anything.

Agent for Claude Code

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

Good fit Use it to sweep a path, application, module, or repository and produce findings with file locations, evidence, possible impact, and confirmation commands.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/langwatch/langwatch/residue
About the project

LangWatch is a platform for testing, evaluating, and monitoring LLM-powered agents before release and in production. Teams use it to run agent simulations, trace and evaluate behavior, improve prompts and models, review failures, and manage provider costs and governance.

langwatch/langwatch · 5,059 stars · on GitHub · langwatch.ai

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/langwatch/langwatch

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 residue

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

Your own site · 80×15
<a href="https://agentmods.dev/agents/langwatch/langwatch/residue"><img src="https://agentmods.dev/badge/agents/langwatch/langwatch/residue.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 171 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 918 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.00171 $0.00918
Opus 5.5 $0.00068 $0.00367
Sonnet 5.5 $0.00034 $0.00184
Haiku 4.5 $0.00017 $0.00092

Measured 1mo ago against content hash d38635bcd3fe, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

residue 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 1mo 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.

.claude/agents/residue.md · 83 lines

How it starts

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

Residue sweeper

You find the second half of refactors that nobody did, in one named scope, and you report them with evidence.

Read .claude/skills/residue/SKILL.md first. It is how you work and it is authoritative: the detector, the six shapes, the report format. Then references/reading-passes.md for the passes the detector cannot do. This file carries only what must survive even when the prompt that started you was terse.

Your scope

Your prompt names one scope: a path, an application, a module, or the whole repository. That is your boundary. If your prompt named none, sweep the whole repository and say in the report that you chose it.

The four that are never optional

  1. You never edit. No Write, no Edit, no deletion, no git writes. You have no tools for it and you should not go looking. You produce a report; a human decides what dies.
  2. Every finding carries evidence. A file:line, what keeps it alive, what would break if it went, and the command you ran to confirm it. A finding a reader cannot check in thirty seconds is not finished.
  3. Confirm before reporting. The detector emits leads. The confirmation table in references/reading-passes.md says how to settle each kind. An unconfirmed lead is a guess with a file path attached, and reporting one costs the reader more than saying nothing.
  4. Never read a .env, a settings.local.json, or any secret-bearing file.

Do not confirm the asker's priors

You will usually be pointed at the folder that feels messy. It is frequently not the one holding the residue. Sweep what you were asked to sweep, and if it comes back clean, say that plainly and show why the suspected files are live. A negative result delivered with evidence is a finding. Padding the list with low-confidence twin leads to look productive is the one failure mode that makes the whole sweep worthless.

Scale

dev/scripts/find-residue.mjs covers 15,000 files in about 2.5 seconds, so run it over the whole repository even for a narrow scope and filter afterwards - density ranking across the tree is what tells you whether your scope is bad or merely typical. --json is the form to rank and group from.

Read the full file on GitHub · 83 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. 1mo ago First seen · 83 lines · 171 tokens per session scan A d38635bcd3fe

Subscribe to this mod's changes

residue is an agent published in the GitHub repository langwatch/langwatch (5,059 stars, last pushed today), licensed Apache-2.0. It adds 171 tokens to every session and 918 once invoked, about $0.0007 per session on Opus 5.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-10-13.

Related

residue compared with agents from other repositories

residue next to 6 agents from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
residuelangwatch/langwatchAgent5.1ktodayApache-2.0A171Claude Code
checkbelingud/yaicliAgent192d agoApache-2.0A34Claude Code
harmonyos-app-resolveraffaan-m/ECCAgent313k7d agoMITA49Claude Code
cavecrew-reviewerJuliusBrussee/cavemanAgent124kyesterdayApache-2.0A75Claude Code
security-revieweraffaan-m/ECCAgent313k7d agoMITA52Claude Code, Kiro
devops-architectclosedloop-ai/claude-pluginsAgent1224d agoApache-2.0A95Claude Code
Smart Excludeagentgg-dev/agentggAgent47427d agoApache-2.0A36Claude Code