TokenEconomizer

PythonClaude CodeCodexCLI HooksTOMLJSONL
TokenEconomizer preview

overview.

TokenEconomizer learns repository-specific facts from completed coding-agent transcripts, proposes unused-tool deny lists, and guards active sessions against repeated failing tool loops across Claude Code, Codex, Copilot CLI, and Pi.

I have 6 merged pull requests upstream (PR #110, PR #126, PR #127, PR #152, PR #153, PR #154): ignoring structured Edit and Write diff payloads in response_text so edited source code stops triggering false loop-guard errors (cutting false hits across 964 local session logs from 12,279 to 0), adding the absent_tool micro-skill fact family for missing tools with no working fallback, fixing TurnGuard._track so non-test commands like grep pytest stop clearing test-failure state, preserving newlines across multi-block tool_result content and generic Go/Rust/RSpec runner summaries, preferring non-WindowsApps Python interpreters in Windows hook launchers to avoid the AppXSvc leak, and recording Codex TOML capability toggles only when keys were inserted.

key features.

  • PR #152: stopped scanning structured Edit/Write file-diff dicts as error text (12,279 false hits reduced to 0 across 964 session logs)
  • PR #127: added absent_tool micro-skill fact family for missing tools with no working alternative and tightened run_build repair matching
  • PR #110 & PR #126: aligned TurnGuard._track with status_of_tests, matched python-invoked script runners in pipes, and preserved tool_result newlines for Go/Rust/RSpec summaries
  • PR #153 & PR #154: bypassed the WindowsApps Python stub in te-hook/te on Windows and gated Codex untool_applied tracking on actual TOML key insertion