Token Optimizer is an open-source agent plugin and context optimization harness developed by Alex Greenshpun (alexgreensh). Designed to integrate directly with terminal-based coding agents such as Codex CLI and Claude CLI, the project provides lifecycle hooks and modular skills aimed at minimizing token consumption and preventing context window bloat during complex software engineering tasks. In daily use, Token Optimizer operates as an extension inside host agent runtimes. It attaches custom skills and hook scripts to the agent's command loop, allowing developers to filter unnecessary file content, optimize prompt sizes, and automate context-clearing routines without disrupting existing CLI workflows. It interfaces cleanly with agent marketplace manifests and local hook runtimes. What differentiates Token Optimizer from generic token counters or prompt wrappers is its architecture as a multi-runtime plugin harness. It natively supports both Codex CLI and Claude plugin structures, incorporating preflight verification, hook diagnostics (such as codex_doctor.py), and mirror synchronization to ensure consistent skill execution across developer environments. The project is available as open-source software on GitHub with public development and community funding via GitHub Sponsors and Ko-fi.
Tags: AI, cli, developer tools, OpenSource, productivity, prompts