🎁Consider a compact DSL tool protocol for lower-token agent workflows
What variant of Codex are you using?
CLI
What feature would you like to see?
I would like to propose looking at an experimental Codex-based agent package that changes only the model-visible tool protocol:
https://www.npmjs.com/package/sagent-ai
The idea is to expose one compact dsl_batch tool instead of many JSON-shaped tool calls. The agent writes raw DSL commands such as:
%% RG --summary "GameEngine" src
%% READ --outline src/game/engine.ts
%% READ --def updateGame src/game/engine.ts
%% PATCH
...
%% SH
npm test
This keeps tool use readable, batchable, and much cheaper in context.
Key advantages I have observed:
Fewer tool calls: search, read, edit, move files, run tests, web lookup, image commands, and shell commands can be grouped into one batch.
Lower token overhead: no JSON wrapper around every command, no escaping large patches or multi-line code blocks as JSON strings.
More readable history: the transcript looks like a script of actions rather than nested function-call JSON.
Better recovery: failed batches are saved and can be resumed with RESUME, without rerunning completed commands.
Structural code operations: READ --outline, READ --def, REPLACE --def, COPY --def, MOVE --def, and DELETE --def work for JS, TS, JSX/TSX, Vue SFC, Rust, etc.
Safer whole-definition edits: REPLACE --def replaces definitions by symbol name and runs syntax diagnostics after edits.
Background shell jobs: SH 0 starts long-running processes; SH --status, SH --log, and SH --stop manage them.
Passive notifications: completed background jobs and unread logs can be surfaced at the end of later tool results.
Web and image commands can be represented in the same compact DSL.
Smaller system/tool prompt surface: the model mostly needs to learn one batching tool.
This is not a request to replace the existing protocol outright. I am suggesting it may be worth evaluating whether Codex could benefit from a compact batch-oriented DSL layer, especially for coding workflows where the model frequently needs to search, inspect, patch, and test in one logical step.
The npm package is currently a Windows-focused experiment based on Codex, with the main change being the working protocol exposed to the model.
Additional information
_No response_
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗