The Pope Bot is an app for configuring an autonomous AI agent that can chat, run coding work, and operate continuously through connected language models and coding agents. People use it for questions, code changes, background development jobs, and live browser-based coding sessions. Its catalogue add-ons extend the bot with commands, skills, and operating instructions.
Borrowing it
Nothing to install: this file belongs to stephengpope/thepopebot. 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/stephengpope/thepopebot/main/.claude/commands/optimize-claudemd.mdgit clone --depth 1 https://github.com/stephengpope/thepopebotWrote 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/commands/stephengpope/thepopebot/optimize-claudemd)<a href="https://agentmods.dev/commands/stephengpope/thepopebot/optimize-claudemd"><img src="https://agentmods.dev/badge/commands/stephengpope/thepopebot/optimize-claudemd/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/commands/stephengpope/thepopebot/optimize-claudemd"><img src="https://agentmods.dev/badge/commands/stephengpope/thepopebot/optimize-claudemd.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.00014 | $0.00707 |
| Opus 5 | $0.00007 | $0.00353 |
| Sonnet 5 | $0.00003 | $0.00141 |
| Haiku 4.5 | $0.00001 | $0.00071 |
Grade A, and why
optimize-claudemd 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 9d 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 — 52 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Enter plan mode first. Do NOT edit any files — this command only produces an analysis and a todo list. The user will decide what to implement.
Follow these steps IN ORDER. The sequence matters — you must understand what's changed in the codebase before you can judge what the CLAUDE.md files should contain.
Step 1 — Discover all CLAUDE.md files and their ages
Find every CLAUDE.md file in the project. For each one, read its full contents and use git to find when it was last modified.
Special case — templates/: This directory should only have two CLAUDE.md-related files. templates/CLAUDE.md guides Claude when working on template files in this package's source code. templates/CLAUDE.md.template (or similar .template extension) gets scaffolded into end-user projects and should be designed for a Claude session working inside their project, not this repo. Flag any other CLAUDE.md files in the templates tree as unnecessary.
Step 2 — Detect codebase changes and identify gaps
This is the most important step. For each CLAUDE.md file, use git to figure out what code has changed in its relevant scope since it was last modified. The goal is a clear picture of what's new, changed, or removed.
What to look for:
- New directories, modules, API routes, server actions, or endpoints not documented anywhere
- Changed or new
package.jsonexports that affect how code is imported - Schema changes (new tables, columns, relationships)
- Architectural shifts (new patterns, deprecated approaches, refactored modules)
- Deleted or moved files that are still referenced in CLAUDE.md
- New patterns or conventions that Claude would get wrong without guidance
For each gap, apply the litmus test: "Would Claude make mistakes without knowing this?" If yes, it's high priority.
Step 3 — Audit existing content against best practices
NOW evaluate each CLAUDE.md for quality — informed by what you learned in Step 2.
Root CLAUDE.md
Size budget: under 200 lines. Count current lines and flag if over budget.
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.
- 9d ago First seen · 52 lines · 14 tokens per session scan A aba2ad001f5c
optimize-claudemd is a command published in the GitHub repository stephengpope/thepopebot (1,860 stars, last pushed 3mo ago), licensed MIT. It adds 14 tokens to every session and 707 once invoked, about $0.0001 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 commands, from other repositories
checklist
Generate a custom checklist for the current feature based on user requirements.
clarify
Identify underspecified areas in the current feature spec by asking up to 5 highly targeted clarification questions and encoding answers back into the spec.
specify
Create or update the feature specification from a natural language feature description.
converge
Assess the current codebase against the feature's spec, plan, and tasks, then append any remaining unbuilt work as new tasks to tasks.md so implement can complete it.
implement
Execute the implementation plan by processing and executing all tasks defined in tasks.md.
analyze
Perform a non-destructive cross-artifact consistency and quality analysis across spec.md, plan.md, and tasks.md after task generation.