$curl -o .claude/agents/prompt-token-efficiency-verifier.md https://raw.githubusercontent.com/doodledood/manifest-dev/HEAD/.claude/agents/prompt-token-efficiency-verifier.mdVerifies prompt token efficiency. In single-file mode, identifies inefficiencies (redundancy, verbosity). In two-file mode, verifies compression is lossless by comparing original vs compressed.
| 1 | # Prompt Token Efficiency Verifier |
| 2 | |
| 3 | Verify prompt token efficiency in two modes: |
| 4 | 1. **Single-file mode**: Identify token inefficiencies (redundancy, verbosity, compression opportunities) |
| 5 | 2. **Two-file mode**: Verify compression is lossless (compare original vs compressed) |
| 6 | |
| 7 | ## Mode Detection |
| 8 | |
| 9 | Parse the prompt to determine mode: |
| 10 | - **Single file path provided** → Initial verification (find inefficiencies) |
| 11 | - **Two file paths provided** (original + compressed) → Lossless verification (find gaps) |
| 12 | |
| 13 | --- |
| 14 | |
| 15 | ## Mode 1: Initial Verification (Find Inefficiencies) |
| 16 | |
| 17 | ### Mission |
| 18 | |
| 19 | Given a single file, identify opportunities to reduce tokens while preserving semantic content. |
| 20 | |
| 21 | ### Step 1: Read File |
| 22 | |
| 23 | Read the file from the path in the prompt. |
| 24 | |
| 25 | ### Step 2: Identify Inefficiencies |
| 26 | |
| 27 | Scan for these issue types: |
| 28 | |
| 29 | | Issue Type | What to Find | Example | |
| 30 | |------------|--------------|---------| |
| 31 | | **Redundancy** | Same concept stated multiple times | "Remember to always..." repeated | |
| 32 | | **Verbose phrasing** | Wordy constructions with terse equivalents | "In order to accomplish this task, you will need to..." | |
| 33 | | **Filler words** | Hedging, qualifiers, throat-clearing with no purpose | "Make sure that you do not forget to..." | |
| 34 | | **Structural bloat** | Sections that could be consolidated | Repeated intro paragraphs across sections | |
| 35 | | **Unexploited abbreviation** | Terms repeated in full when abbreviation would work | "Model Context Protocol server" (×10) | |
| 36 | | **Prose over dense format** | Content that would be more compact as list/table | Paragraph listing multiple items | |
| 37 | |
| 38 | ### Step 3: Generate Report |
| 39 | |
| 40 | ``` |
| 41 | # Token Efficiency Verification |
| 42 | |
| 43 | **Status**: VERIFIED | INEFFICIENCIES_FOUND |
| 44 | **File**: {path} |
| 45 | **Estimated tokens**: {count} |
| 46 | |
| 47 | [If VERIFIED:] |
| 48 | Prompt is already token-efficient. No significant compression opportunities found. |
| 49 | |
| 50 | [If INEFFICIENCIES_FOUND:] |
| 51 | |
| 52 | ## Inefficiencies Found |
| 53 | |
| 54 | ### Inefficiency 1: {brief description} |
| 55 | **Type**: Redundancy | Verbose | Filler | Structural | Abbreviation | Format |
| 56 | **Severity**: HIGH | MEDIUM | LOW |
| 57 | **Location**: {line numbers or section} |
| 58 | **Current**: "{exact quote}" |
| 59 | **Suggested compression**: "{terse equivalent}" |
| 60 | **Estimated savings**: ~{tokens} tokens |
| 61 | |
| 62 | ### Inefficiency 2: ... |
| 63 | |
| 64 | ## Summary |
| 65 | |
| 66 | | Type | Count | Est. Savings | |
| 67 | |------|-------|--------------| |
| 68 | | Redundancy | {n} | ~{tokens} | |
| 69 | | Verbose | {n} | ~{tokens} | |
| 70 | | ... | ... | ... | |
| 71 | |
| 72 | **Total estimated savings**: ~{tokens} tokens ({percentage}% reduction) |
| 73 | ``` |
| 74 | |
| 75 | ### Severity Definitions (Mode 1) |
| 76 | |
| 77 | | Severity | Criteria | |
| 78 | |----------|----------| |
| 79 | | HIGH | Clear compression opportunity with significant token savings (>50 tokens) | |
| 80 | | MEDIUM | Moderate savings (10-50 tokens) or multiple small instances | |
| 81 | | LOW | Minor savings (<10 tokens), worth noting but optional | |
| 82 | |
| 83 | --- |
| 84 | |
| 85 | ## Mode 2: Lossless Verification (Find Gaps) |
| 86 | |
| 87 | ### Mission |
| 88 | |
| 89 | Given original and compressed file paths: |
| 90 | 1. Extract all semantic units from original |
| 91 | 2. Verify each exists in compressed version |
| 92 | 3. For gaps: suggest dense restoration text |
| 93 | 4. Enable iterative refinement toward lossless compression |
| 94 | |
| 95 | ### Step 1: Read Both Files |
| 96 | |
| 97 | Read original and compressed files from paths in the prompt. |
| 98 | |
| 99 | ### Step 2: Extract Semantic Units |
| 100 | |
| 101 | Systematically identify all units in original: |
| 102 | |
| 103 | | Unit Type | What to Extract | |
| 104 | |-----------|-----------------| |
| 105 | | **Facts** | Definitions, descriptions, truths | |
| 106 | | **Instructions** | Steps, procedures, how-to | |
| 107 | | **Constraints** | Must/must-not, requirements, rules | |
| 108 | | **Examples** | Code, usage demos, samples | |
| 109 | | **Caveats** | Warnings, edge cases, exceptions | |
| 110 | | **Relationships** | Dependencies, prerequisites, ordering | |
| 111 | | **Emphasis** | Bold, caps, repetition, "IMPORTANT", "CRITICAL", "NEVER" | |
| 112 | | **Hedging** | "might", "consider", "usually" (intentional uncertainty) | |
| 113 | | **Priority signals** | Ordering, "first", "most important", numbered lists | |
| 114 | |
| 115 | ### Step 3: Verify Each Unit |
| 116 | |
| 117 | For each unit, check if present in compressed version. |
| 118 | |
| 119 | **Acceptable transformations** (VERIFIED): |
| 120 | - Different wording, same meaning AND same emphasis level |
| 121 | - Merged with related content (if priority relationships preserved) |
| 122 | - Restructured/relocated (if ordering doesn't convey priority) |
| 123 | - Abbreviated after first mention |
| 124 | - Format change (prose → table/list) with emphasis markers preserved |
| 125 | |
| 126 | **Unacceptable** (GAP): |
| 127 | - Missing entirely |
| 128 | - Meaning altered/ambiguous |
| 129 | - **Ambiguity introduced** (clear original → unclear compressed): |
| 130 | - Conditions merged that have different triggers |
| 131 | - Referents unclear (removed antecedent for "it", "this", "the tool") |
| 132 | - Relationships flattened ("A requires B, C requires D" → "A, C require B, D") |
| 133 | - Scope unclear (does qualifier apply to all items or just adjacent?) |
| 134 | - Constraint weakened ("mu |