Clean Up Legacy Prompt Patterns in Claude Code with One Line: `/claude-api prompt-audit`
Shared by Lance Martin and powered by Anthropic's official skills repository, the one-line Claude Code command `/claude-api prompt-audit` scans CLAUDE.md, AGENT
A one-line Claude Code command shared by Lance Martin and highlighted by @RoundtableSpace on X, /claude-api prompt-audit, helps developers diagnose and clean up accumulated prompt legacy across projects. Powered by the prompt audit specification in Anthropic's official skills repository (anthropics/skills), the command thoroughly scans CLAUDE.md, AGENTS.md, custom skill definitions, and system prompts within your working repository to identify outdated prompting workarounds that actively hold modern models like Claude Opus 5.5 back.

Image source: @RoundtableSpace via X
As developer workspaces evolve across successive model generations, rule files often retain rigid workarounds originally authored to bypass early model deficiencies such as unreliable tool triggering or weak autonomous planning. Running /claude-api prompt-audit triggers a non-interactive inspection pipeline that surfaces dated instructions alongside actionable justifications and clean replacement patches.
Why Dated Prompt Patterns Actively Degrade Modern Claude Models
When optimizing agent configurations and instruction files, developers frequently assume the primary goal is simply reducing token count. However, the guiding principle behind Anthropic's prompt audit framework is not brevity for its own sake, but rather: "Every token earns its place."
Earlier LLMs routinely under-triggered tools, ignored nuanced negative constraints, or struggled with multi-step reasoning. To compensate, developers added defensive layers: shouting in uppercase, rigid step-by-step reasoning scaffolds, and excessive repetition.
Modern models like Claude Opus 5.5 follow instructions far more faithfully and literally. As a result, outdated defensive instructions actively degrade agent performance in three specific ways:
- Over-triggering: Excessive tool emphasis leads agents to invoke tools repeatedly for queries that require simple synthesis.
- Over-planning: Hardcoded sequential planning scripts force the model into unnecessary intermediate stages for straightforward tasks.
- Rigid responses in gray areas: Overly strict rule sets prevent the model from adapting dynamically when encountering edge cases or ambiguous inputs.
Merely irrelevant text wastes tokens but is comparatively harmless. In contrast, obsolete behavioral constraints actively sabotage modern reasoning engines.
Prompt Surface Scope and Non-Interactive Execution
Developers can initiate the audit directly from their Claude Code terminal with:
/claude-api prompt-audit
Under the hood, this routine executes the specification defined in skills/claude-api/shared/prompt-audit.md from the official anthropics/skills repository.
The audit is strictly non-interactive by design: it does not interrupt execution to prompt the developer with conversational questions. Instead, it extracts context directly from the repository and the invocation parameters. This ensures identical, deterministic behavior whether run interactively in a developer chat session, as a CI/CD check, or as part of a batch codebase migration.
At startup (Step 0), the audit locks in the target model (such as Claude Opus 5.5) and scans across all key prompt surfaces within the workspace:
- Root and sub-directory configuration and rule files (
CLAUDE.md,AGENTS.md) SKILL.mddefinitions and custom skill directories- System prompt templates and role definitions
- Tool definitions and parameter schemas
- Application code that programmatically builds API system prompts
Key Targets: Three Obsolete Prompting Patterns Flagged by the Audit
The /claude-api prompt-audit routine focuses specifically on detecting three widespread classes of obsolete workarounds:
1. Artificial Step-by-Step Reasoning Directives ("think step by step")
Mandates like "think step by step before answering" or verbose chain-of-thought rules were essential when earlier LLMs struggled to organize sequential tasks. Modern Claude models feature integrated extended thinking and autonomous agentic planning; forcing manual step-by-step reasoning restricts reasoning bandwidth and introduces unnecessary latency.
2. Assistant-Turn JSON Prefills
Historically, developers steered models toward structured JSON by pre-filling the assistant response turn:
{"role": "assistant", "content": "{"}
Modern Claude APIs provide first-class structured outputs and schema validation. Prefill hacks should be replaced with official API features or removed entirely.
3. Quotes-First Extraction Scaffolds and Redundant Triggers
Elaborate extraction scaffolds that demand full quote extraction prior to synthesizing answers, along with excessive boldface warnings designed to prevent tool misses, are no longer necessary. Modern models exhibit high instruction fidelity, rendering these scaffolds redundant overhead.
Step 0–6 Pipeline and Core Deliverables: Audit Report and Proposed Diff
The audit executes sequentially from Step 0 through Step 6 without narrating intermediary steps back to the user, culminating in two comprehensive deliverables:
- Step 0: Establish audit scope and target model (e.g., Opus 5.5).
- Step 1–4: Systematic scan of the prompt surface and pattern matching.
- Step 5 (Deliverable 1): Detailed Findings Report.
- Step 6 (Deliverable 2): Actionable Proposed Diff.
Findings Report Schema
The audit report provides granular, evidence-based data for every flagged instruction:
| Field | Description |
|---|---|
| Location | Exact file path and line numbers where the legacy instruction was found |
| Evidence | Verbatim text snippet from the markdown or source file |
| Pattern | The identified legacy prompt pattern |
| Why Obsolete | Specific explanation of how this instruction degrades modern models like Opus 5.5 |
| Confidence | Diagnostic confidence level (e.g., High, Medium) |
| Proposed Action | Recommended resolution (remove, rewrite, move, or replace-with-API-feature) |
Immediately following the findings report, Step 6 provides a unified Git diff showing the exact lines to delete or rewrite. Developers can review the proposed diff and apply the optimizations cleanly to their workspace.
Multilingual Rule Files and Practical Session Integration
In community discussions, developers raised questions regarding non-English rule files—such as a CLAUDE.md written entirely in Vietnamese or Korean containing plain-language notes about previous edge cases or build failures.
The prompt audit does not penalize plain-text domain documentation or straightforward project constraints. Plain-language notes describing repository quirks remain valuable context for Claude. The audit exclusively targets artificial prompt engineering contrivances that were introduced to steer superseded model architectures.
Running /claude-api prompt-audit before launching heavy coding sessions ensures that modern models like Claude Opus 5.5 operate with maximum precision, autonomy, and speed.