PrototypeExperiment

TokenZen

Stable work of AI coding agents

TokenZen sits between an agent (Codex, Claude Code, Cursor, and others) and the model API and watches for signs that the work has gone off course: the same error again and again, a bloated context, libraries that do not exist, a dangerous command. When the signs appear, it intervenes.

The approach is borrowed from psychological practice: a pause, a change of angle, unloading memory, a return to the basic rules.

Status
Prototype (local, version 0.1)
Direction
Experiment
For
Developers and teams that hand code to AI agents
Two modes
Proxy (agent traffic passes through TokenZen) and check-in (the agent reports its own state)
Interventions
Digital Breathing, Context Exhale, Cool the Mind, Grounding
Access
By request

Status

Prototype. A limited demonstration is available. The service runs locally.

For Whom

Developers and engineering teams that hand code to AI agents and want to see what the agent does when something goes wrong.

Researchers of agentic systems who work with context, authority limits, and checkpoints.

How it can work

Situation. An agent repeats the same fix five or twenty times. Its history grows and every step costs more. It invents libraries, or moves toward a command such as deleting files. Ordinary monitoring tools mostly show this afterwards.

System. TokenZen evaluates the state of a session on each request and, when needed, intervenes: a hint to try another approach, a compressed context, a lowered temperature, a repeated safety instruction. A dashboard shows live sessions, failure indicators, and logs.

Human role. The developer sees which intervention was applied and why, can pause a session, and decides whether the agent continues.

What we study

Whether techniques borrowed from psychological practice (a pause, a change of approach, unloading memory, a reminder of basic rules) help to bring an agent out of a dead end in time. We also look at what this saves in tokens and time, and we count it only from real sessions.

Interventions

Digital Breathing. The same error three or more times: a system hint to step back and try a different approach.

Context Exhale. A token threshold is exceeded: a summary of about 500 words replaces the noise in the context.

Cool the Mind. A hallucination is detected: the temperature drops to 0.1 and standard patterns are enforced.

Grounding. A destructive operation is detected, or at set intervals: the basic safety instruction is repeated.

In check-in mode the agent or its wrapper reports its state itself, and TokenZen answers with advice and, if needed, queues an intervention.

Fixed rules, thresholds, and templates drive the interventions. There is no second model behind them.

Savings are shown as a forecast and as a measured value, split by mode. We give no percentage of saved tokens in advance.

Limitations

TokenZen runs locally. It is not a hosted service, has no billing or multi-user mode, and covers OpenAI-compatible and Anthropic interfaces only.

It adds a reminder and a pause point. It does not isolate an agent the way a sandbox does.

The thresholds of the interventions are working assumptions that still have to be tuned on real sessions.

Access

Access is by request. Terms of use are agreed before you start working with the project.

HandS Lab research tools and prototypes are not a catalog of commercial products. If a specific applied solution involves commercial deployment, it is carried out by an external operator or partner.