Token efficient

From wasabeef/claude-code-cookbook · View interactive version

Token efficient is an AI agent skill from the GitHub repository wasabeef/claude-code-cookbook. Compress responses to reduce context usage by 30-50%. Trigger with "token efficient mode", "compress responses", "save context", "save tokens".

How to use this skill

Skill file

Compress responses to reduce context usage by 30-50%

Reduces AI response context usage by 30-50% through compression efficiency mode.

Compress responses to reduce context usage by 30-50%

Token Efficiency Mode leverages visual symbols and abbreviation systems to compress Claude's responses.

Generated code quality and content remain unchanged. Only the explanation method changes.

Usage

# Enable mode
"Respond in Token Efficiency Mode"
"--uc mode"
"Concise mode"

How It Works

1. Symbol System

Logic & Flow

| Symbol | Meaning | Example |

| ------ | ---------------- | ------------------------------- |

| โ†’ | leads to, causes | auth.js:45 โ†’ ๐Ÿ›ก๏ธ security risk |

| โ‡’ | converts to | input โ‡’ validated_output |

| โ† | rollback, revert | migration โ† rollback |

| โ‡„ | bidirectional | sync โ‡„ remote |

| & | and, combine | ๐Ÿ›ก๏ธ security & โšก performance |

| \| | or, separator | react\|vue\|angular |

| : | define, specify | scope: file\|module |

| ยป | then, sequence | build ยป test ยป deploy |

| โˆด | therefore | tests โŒ โˆด code broken |

| โˆต | because | slow โˆต O(nยฒ) algorithm |

Status & Progress

| Symbol | Meaning | Usage |

| ------ | ----------------- | ----------------------- |

| โœ… | complete, success | Task completed normally |

| โŒ | failed, error | Immediate action needed |

| โš ๏ธ | warning | Review recommended |

| ๐Ÿ”„ | in progress | Currently active |

| โณ | pending | Scheduled for later |

| ๐Ÿšจ | urgent, critical | High priority |

Technical Domains

| Symbol | Domain | Usage |

| ------ | ------------- | --------------------- |

| โšก | Performance | Speed, optimization |

| ๐Ÿ” | Analysis | Search, investigation |

| ๐Ÿ”ง | Configuration | Setup, tools |

| ๐Ÿ›ก๏ธ | Security | Protection, safety |

| ๐Ÿ“ฆ | Deployment | Package, bundle |

| ๐ŸŽจ | Design | UI, frontend |

| ๐Ÿ—๏ธ | Architecture | System structure |

| ๐Ÿ—„๏ธ | Database | Data persistence |

| โš™๏ธ | Backend | Server processing |

| ๐Ÿงช | Testing | Quality assurance |

2. Abbreviation System

System & Architecture

Development Process

Quality & Analysis

Example Comparisons

Example 1: Error Report

Normal Mode (85 chars)

Security vulnerability found in the user validation function at line 45 of the auth system.

Token Efficient (39 chars)

auth.js:45 โ†’ ๐Ÿ›ก๏ธ sec vuln in user val()

Example 2: Build Status

Normal Mode (112 chars)

Build process completed successfully. Tests are currently running, followed by deployment.

Token Efficient (35 chars)

build โœ… ยป test ๐Ÿ”„ ยป deploy โณ

Example 3: Performance Analysis

Normal Mode (95 chars)

Performance analysis revealed slow processing due to O(nยฒ) algorithm complexity.

Token Efficient (42 chars)

โšก perf: slow โˆต O(nยฒ) โ†’ optimize to O(n)

Use Cases

โœ… Effective Scenarios

โŒ Scenarios to Avoid

Implementation Examples

Debugging Session

[14:23] breakpoint โ†’ vars: {user: null, token: expired}
[14:24] step โ†’ auth.validate() โŒ
[14:25] check โ†’ token.exp < Date.now() โˆด expired
[14:26] fix โ†’ refresh() โ†’ โœ…
[14:27] continue โ†’ main flow ๐Ÿ”„

File Analysis Results

/src/auth/: ๐Ÿ›ก๏ธ issues ร— 3
/src/api/: โšก bottleneck in handler()
/src/db/: โœ… clean
/src/utils/: โš ๏ธ deprecated methods
/tests/: ๐Ÿงช coverage 78%

Project Status

Frontend: ๐ŸŽจ โœ… 100%
Backend: โš™๏ธ ๐Ÿ”„ 75%
Database: ๐Ÿ—„๏ธ โœ… migrated
Tests: ๐Ÿงช โš ๏ธ 68% (target: 80%)
Deploy: ๐Ÿ“ฆ โณ scheduled
Security: ๐Ÿ›ก๏ธ ๐Ÿšจ 1 critical

Configuration Options

// Compression levels
--uc; // Ultra Compressed: Maximum compression
--mc; // Moderate Compressed: Medium compression
--lc; // Light Compressed: Light compression

// Domain-specific
--dev; // Development-focused compression
--ops; // Operations-focused compression
--sec; // Security-focused compression

Benefits

  1. Context saving: 30-50% token reduction
  2. Visual understanding: Intuitive grasp through symbols
  3. Information density: More information in the same space
  4. History retention: Maintain longer conversation history
  5. Pattern recognition: Easier problem detection through visual patterns

Notes

Command Examples

# Enable
"Token Efficient Mode on"
"Respond concisely"
"Analyze with --uc"

# Disable
"Return to normal mode"
"Explain in detail"
"Token Efficient Mode off"

Implementation Impact

| Item | Impact |

| ----------------------- | ------------------- |

| Generated code quality | No change โœ… |

| Implementation accuracy | No change โœ… |

| Functionality | No change โœ… |

| AI explanation method | Compressed ๐Ÿ”„ |

| Context usage | 30-50% reduction โšก |


๐Ÿ’ก Pro Tip: For long work sessions, start with normal mode to build understanding, then switch to Token Efficient Mode to optimize efficiency and context retention.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.