Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

20 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Token Optimizer

Token Optimizer β€” Claude AI Skill

Maximum Output. Minimum Input. Zero Waste.

Version License Claude Skill Stars By Sami Bajwa

⭐ Star this repo to unlock usage rights

Built by Sami Bajwa β€” AI Educator & Automation Builder


🧠 What Is This?

Token Optimizer is a production-ready Claude AI Skill that teaches you how to extract the highest-quality, most complete responses from Claude using the fewest possible input tokens.

πŸ’‘ Most people waste 60–80% of their tokens on filler, bad formatting, and unstructured prompts β€” and get worse results because of it. This skill fixes that.

A fully optimized session uses 3–8x fewer tokens than an unoptimized one β€” for the same or better output quality.


✨ What This Skill Covers

πŸ—œοΈ Pillar 1 β€” Prompt Compression

Turn 50-token verbose prompts into 8-token precision instructions. Shorthand syntax for every common task type.

πŸ“ Pillar 2 β€” Output Format Control

Eliminate 30–50% of response bloat. Tell Claude exactly what format, length, and structure you want.

🏷️ Pillar 3 β€” XML Tag Structuring

The most underused prompting technique. Reduce clarification rounds to zero with structured input.

πŸ“¦ Pillar 4 β€” Instruction Density

Bundle 4 messages into 1 structured prompt. Stop the back-and-forth.

🚫 Pillar 5 β€” Negative Space Instructions

Tell Claude what NOT to do. Cuts filler by 20–35% instantly.

🎯 One-Shot Examples

One perfect example replaces 100 tokens of style instructions. Ready-made examples for 10 domains included.


πŸ“ Repository Structure

token-optimizer-skill/
β”‚
β”œβ”€β”€ SKILL.md                              # 🧠 Core skill file β€” load this into Claude
β”‚
β”œβ”€β”€ references/
β”‚   β”œβ”€β”€ compression-patterns.md           # 50+ shorthand patterns across 6 categories
β”‚   β”œβ”€β”€ output-formats.md                 # 10 format templates + Anti-Filler Block
β”‚   β”œβ”€β”€ system-prompt-templates.md        # 10 production-ready system prompts (<200 tokens each)
β”‚   β”œβ”€β”€ one-shot-examples.md              # Ready-made examples for 10 domains
β”‚   └── context-management.md            # 7 techniques for conversation pruning
β”‚
β”œβ”€β”€ examples/
β”‚   └── before-after.md                   # 20 real prompts with token counts (avg 65% savings)
β”‚
β”œβ”€β”€ .github/workflows/
β”‚   └── star-reminder.yml                 # Auto-reminds contributors to star
β”‚
β”œβ”€β”€ LICENSE                               # Star-Required License
β”œβ”€β”€ CONTRIBUTING.md                       # How to contribute
β”œβ”€β”€ CHANGELOG.md                          # Version history
└── README.md                             # This file

πŸ“Š Proven Results

Technique Average Token Savings
Prompt Compression 40–70% input reduction
Output Format Control 30–50% response reduction
XML Structuring Eliminates 2–3 clarification rounds
Instruction Bundling 60–80% fewer messages
Negative Instructions 20–35% shorter responses
One-Shot Examples Replaces ~100 tokens of style description
Context Pruning 70–90% history token reduction
Combined Effect 3–8x fewer tokens. Same quality.

πŸš€ How to Use

Option 1 β€” Claude.ai Projects (Recommended)

  1. Go to claude.ai β†’ Projects
  2. Create or open a project
  3. Upload SKILL.md as a project instruction file
  4. Claude now uses all optimization techniques automatically

Option 2 β€” Claude Skills (if available in your plan)

  1. Go to Settings β†’ Skills
  2. Upload SKILL.md
  3. Done β€” skill activates when relevant

Option 3 β€” Paste as System Prompt

Copy the full contents of SKILL.md β†’ paste into Claude's system prompt field

Option 4 β€” API Integration

with open("SKILL.md", "r") as f:
    system_prompt = f.read()

# Pass as system_prompt in your Anthropic API call
response = client.messages.create(
    model="claude-sonnet-4-20250514",
    max_tokens=1024,
    system=system_prompt,
    messages=[{"role": "user", "content": "Your task here"}]
)

πŸ’¬ Example Prompts After Loading This Skill

"Optimize this prompt for me: [your verbose prompt]"
"Help me write a system prompt for a customer support bot"
"Show me the compressed version of this instruction"
"How do I structure this multi-part request efficiently?"
"Reduce tokens in this conversation history"
"Write a one-shot example for [my use case]"

πŸ”₯ Quick Start Formula

The fastest way to improve any prompt immediately:

[ROLE (1 line)] + [TASK (compressed)] + [FORMAT (explicit)] + [CONSTRAINTS (negative)]

Example β€” Before (74 tokens):

I have a Python script that I wrote and it's having some issues. Can you please 
review it carefully and tell me what's wrong with it and also suggest how I could 
improve it to make it better and more efficient?

After (12 tokens):

You are a Python expert. debug+optimize: [code]
Format: issues list β†’ fixed code. No intro.

Same output. 84% fewer tokens.


πŸ“š Reference Files Overview

File Contents
compression-patterns.md 50+ shorthand patterns: analysis, writing, code, extraction, research, ideation
output-formats.md 10 format templates + Universal Anti-Filler Block + length modifiers
system-prompt-templates.md Code assistant, content writer, data analyst, support bot, researcher, summarizer, translator, creative, tutor, business automation
one-shot-examples.md Code review, email, data extraction, simplification, summaries, social media, meeting notes, product descriptions, SEO, feedback
context-management.md State Summary Method, Rolling Compression, Stateless Design, Role Pinning, Reference Injection, Checkpoint Commits, Context Scoping

⚠️ License β€” Read Before Using

This repository uses a Star-Required License.

⭐ You must star this repository before using, copying, or distributing this skill. Attribution to Sami Bajwa / samioutic.com must appear in any product that uses this skill.

See LICENSE for full terms.

⭐ Click here to star and unlock usage β†’


πŸ‘€ About the Creator

Sami Bajwa

Sami Bajwa is an AI Educator, web developer, and digital entrepreneur based in Sargodha, Pakistan. He operates under the brand SAMIOUTIC (samioutic.com) and is dedicated to helping Pakistani freelancers and learners master AI tools and earn online.

Credentials & Expertise

  • πŸ† Anthropic Academy Certified β€” Claude 101 Β· Claude Code in Action Β· AI Fluency Framework & Foundations Β· Introduction to Agent Skills
  • πŸ“š Author β€” 100+ books on AI, automation, and digital skills
  • 🌐 Full-Stack Developer β€” Production websites for clients in Pakistan, Dubai, Georgia, and beyond
  • πŸ€– AI Automation Builder β€” n8n, Claude API, ManyChat, TikTok automation systems
  • πŸŽ“ Community Educator β€” Teaching AI literacy to thousands of Pakistani learners via social media

Projects & Work

Project Description
Samioutic.com Personal brand β€” AI education, web development, digital services
CIPHER Trading Skill Claude skill for institutional-grade crypto/forex trading signals
HabitQuest Pro Gamified habit tracking system (GitHub Pages)
VoiceScribe AI Bilingual Urdu/English voice-to-text prototype
Universal AI Chat Single-file app supporting 8 AI providers (Claude, GPT, Gemini, Groq...)

Connect

Website Facebook LinkedIn WhatsApp Channel GitHub


🀝 Contributing

Contributions that improve token efficiency are welcome. Before contributing:

  1. Star the repository (required by license)
  2. Read CONTRIBUTING.md
  3. Check open issues for current priorities

πŸ“„ Versions

Version Date Description
v1.0.0 (Latest) 2025-05-28 Initial release β€” 5 pillars, 6 reference files, 20 before/after examples

See CHANGELOG.md for full version history and roadmap.


If this skill saves you tokens and time β€” drop a ⭐ on the repo.

It helps other developers and AI users find it.


Star This Repo

Built by Sami Bajwa Β· Samioutic Β· Pakistan πŸ‡΅πŸ‡°

About

Maximum Claude output with minimum tokens. 50+ compression patterns, 10 system prompts, benchmarked results. Star to unlock usage.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

Packages

Contributors