Productivity
token-surgeon avatar

token-surgeon

Audit and optimize your AI prompts with Token Surgeon. Detect 10 common waste patterns, calculate efficiency, and reduce token usage for better prompt performance.

Introduction

Token Surgeon is a specialized productivity skill designed for developers and AI engineers who need to maximize prompt efficiency within Claude Code. By functioning as a clinical, unsentimental auditor, this tool helps you identify and eliminate "token bloat"—text that consumes context window capacity without adding functional value. The tool enforces a strict two-phase workflow: first, it performs a detailed analysis of your input prompt, then it provides a calculated efficiency score based on 10 specific waste patterns, such as Hedging Language, Role Throat-Clearing, and Politeness Padding. It only proceeds to rewrite the prompt upon explicit user confirmation, ensuring that you maintain control over the intent and capability of your instructions.

  • Performs automated token count estimation based on character ratios (~1 token per 4 characters).

  • Scans for 10 specific waste patterns including Dead Context, Negation Bloat, and Over-Specified Examples.

  • Provides a quantitative efficiency score (1-10) to help you prioritize which prompts need urgent refactoring.

  • Offers non-destructive analysis by quoting offending lines rather than forcing immediate changes.

  • Generates optimized, token-efficient versions of your prompts upon request, including side-by-side comparison stats.

  • Best used when refining system prompts, complex multi-step instructions, or debugging high-token-cost LLM calls.

  • Expected inputs include raw prompt text or system instruction sets; outputs include audit reports, cost-saving estimates, and refined prompt snippets.

  • Operates under a clinical tone to prioritize clarity, brevity, and data-driven improvements.

  • Designed specifically for the Claude Code ecosystem, allowing for quick integration into local development workflows via standard slash command installation.

  • Follows strict architectural constraints: preference for deletion over paraphrasing to ensure prompt integrity and behavioral consistency.

Repository Stats

Stars
1
Forks
0
Open Issues
0
Language
Python
Default Branch
main
Sync Status
Idle
Last Synced
May 3, 2026, 10:29 PM
View on GitHub