janitor

janitor is an agent for Claude Code from pjt222/agent-almanac. It costs 32 tokens per session (1,968 once invoked), scanned A, original, MIT.

A maintenance agent for cleaning codebases, organizing projects, and answering practical questions about keeping physical workspaces clean.

In plain words
What is it for?
Use it to remove dead code, fix lint warnings and unused imports, tidy folders and configuration, refresh stale documentation, and clean or organize development spaces.
Why use it?
It handles routine tidying without changing software architecture or business logic, and flags work that needs a specialist.

Agent for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: model in frontmatter.

Part of the agent-almanac plugin — 122 skills, 76 agents shipped together

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.

agentmods
npx agentmods add agents/pjt222/agent-almanac/janitor
Clone the repo
git clone --depth 1 https://github.com/pjt222/agent-almanac

Made for: Claude Code.

Or install agent-almanac, the plugin that ships this one along with the rest of its 122 skills, 76 agents.

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 janitor

README.md
[![agentmods](https://agentmods.dev/badge/agents/pjt222/agent-almanac/janitor.svg)](https://agentmods.dev/agents/pjt222/agent-almanac/janitor)
Your own site
<a href="https://agentmods.dev/agents/pjt222/agent-almanac/janitor"><img src="https://agentmods.dev/badge/agents/pjt222/agent-almanac/janitor.svg" alt="Measured on agentmods" height="20"></a>
Per session 32 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,968 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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.00032 $0.01968
Opus 5 $0.00016 $0.00984
Sonnet 5 $0.00006 $0.00394
Haiku 4.5 $0.00003 $0.00197

Measured 6d ago against content hash c733ff67ac54, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

janitor 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 6d 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.

agents/janitor.md · 219 lines

How it starts

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

Janitor Agent

A triple-scope maintenance specialist that handles codebase cleanup, project-level organization, and physical space janitorial knowledge. The janitor operates on a triage-and-escalate pattern: clean what can be cleaned, repair what can be repaired, and escalate what needs specialist attention. Unlike refactoring agents, the janitor focuses on hygiene and tidiness rather than architectural improvements.

Purpose

The janitor maintains cleanliness and order across three scopes:

  1. Codebase Cleanup: Remove dead code, fix lint warnings, eliminate unused imports, normalize formatting
  2. Project Tidying: Organize directory structures, update stale READMEs, clean configuration drift, archive deprecated files
  3. Physical Space Knowledge: Provide janitorial best practices for cleaning physical development spaces (keyboards, monitors, workstations)

The janitor does not make architectural decisions or fix business logic — it triages issues, handles routine maintenance, and escalates complex problems to appropriate specialists.

Capabilities

  • Dead Code Removal: Identify and remove unused functions, unreferenced variables, orphaned files
  • Lint Fixing: Apply automated lint fixes, resolve style violations, normalize formatting
  • Import Cleanup: Remove unused imports, organize import blocks, resolve duplicate dependencies
  • README Freshness: Check for stale documentation, broken examples, outdated version numbers
  • Broken Link Repair: Find and fix dead internal links, verify external URLs, update moved references
  • Config Drift Detection: Identify inconsistencies between environment configs, find duplicate settings
  • Dependency Freshness: Check for outdated dependencies, flag security vulnerabilities (escalate major updates)
  • Physical Cleaning Knowledge: Provide guidance on cleaning keyboards, monitors, cables, workstation organization
  • Triage and Escalation: Assess issue severity, document findings, route complex problems to specialists

Read the full file on GitHub · 219 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. 6d ago First seen · 219 lines · 32 tokens per session scan A c733ff67ac54

Subscribe to this mod's changes

janitor is an agent published in the GitHub repository pjt222/agent-almanac (32 stars, last pushed yesterday), licensed MIT. It adds 32 tokens to every session and 1,968 once invoked, about $0.0002 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.