Inspiration 💡

Large language models have become an essential part of software development, but developers often paste lengthy source code, stack traces, terminal logs, and configuration files into AI assistants. These inputs quickly consume context windows, increase API costs, and leave less room for meaningful conversation.

We wondered:

What if every developer prompt could be optimized before it ever reached ChatGPT or Claude—without losing any code or debugging context?

That idea became Paritok Trim. ✨

Paritok trim logo

What it does ❓

Paritok Trim is a browser extension that sits on top of ChatGPT and Claude.ai.

When you paste code, stack traces, terminal output, build logs, or other developer-focused prompts that exceed a configurable length, the extension offers to rewrite them into a more concise version using Paritok's hosted 4B model.

The rewritten prompt preserves instructions, code blocks, quoted text, numeric values, and debugging context while reducing the overall token count.

Before sending anything, users can compare:

• Original vs. optimized token count
• Percentage of tokens saved
• The rewritten prompt

Nothing is sent to ChatGPT or Claude until the user approves the optimized version.

Nothing is sent to ChatGPT or Claude until the user approves the optimized version

How we built it⚙️

Paritok Trim is built as a Manifest V3 Chrome extension.

The extension uses a bundled cl100k_base tokenizer to calculate accurate token counts for developer prompts. Once a configurable threshold is reached, it offers one-click optimization by sending the prompt to Paritok's hosted 4B model.

The model is optimized for compressing source code, terminal output, stack traces, and other software engineering context, preserving instructions, code blocks, quoted strings, and numeric values while reducing token usage. Users can compare the original and optimized prompts before deciding which version to send, while cumulative token savings are stored locally.

Architecture Diagram

Challenges we ran into ⚡

One of the biggest challenges was balancing compression with reliability. Compressing developer prompts is only useful if no important debugging context is lost. Our goal was to preserve instructions, source code, stack traces, quoted strings, numeric values, and other critical technical details while significantly reducing token usage.

Another challenge was integrating seamlessly into existing AI workflows. Rather than replacing ChatGPT or Claude, the extension needed to feel like a natural part of the interface without disrupting how developers already work.

Accurately measuring token counts also required using the same tokenizer family used by modern OpenAI models instead of simple character-based estimates.

Accomplishments that we're proud of 💪

Built a fully functional Chrome extension that integrates directly with ChatGPT and Claude. Implemented accurate token counting using the same tokenizer family used by modern LLMs. Successfully optimized developer prompts using Paritok's hosted inference API while preserving technical context. Created a transparent review workflow that lets users compare original and optimized prompts before sending. Added persistent statistics so users can track cumulative token savings across sessions.

What we learned🙌

Building Paritok Trim reinforced that efficiency isn't just about faster models—it's also about communicating technical information more effectively.

We learned that small, specialized models can dramatically improve developer workflows by acting as intelligent preprocessing layers for code, logs, and debugging context. We also gained valuable experience integrating browser extensions with modern AI applications while designing workflows that prioritize transparency and user control.trol.

What's next for Paritok Trim 🚀

Our roadmap includes:

Support for additional AI platforms beyond ChatGPT and Claude Support for more developer prompt types Side-by-side prompt diff visualization User-selectable compression levels Local inference support for privacy-conscious users Team analytics and organization-wide token savings Automatic optimization suggestions while typing

Note ⚠️ Paritok Trim requires a valid Paritok API key to perform prompt optimization. API credentials are not included in this repository. Please use your own credentials to run the project locally.

Built With

Share this project:

Updates

Submission history