Have you been noticing your 3.8 Flash using way more tokens? Try this skill to improve your efficiency.
▲ 22 r/AGYSkills+2 crossposts

Have you been noticing your 3.8 Flash using way more tokens? Try this skill to improve your efficiency.

Note: Posting this as an open-source reference pattern and diagnostic tool that you can build on, adapt to your own environment, or use as inspiration.

Hey everyone, here is an updated version of the skill I have been refining to audit Antigravity agent sessions. Ever since Gemini 3.8 Flash came out, I noticed token usage was draining significantly faster than before.

Watching the agent execute, I found that token drain primarily comes from three structural bottlenecks:

  1. Command retry loops: A single failed command that takes 2 or 3 retries permanently injects thousands of tokens of stderr and broken payloads into every subsequent turn of that conversation.
  2. Unbounded file reading: Agents repeatedly calling view_file on 500+ line files without line bounds, dumping entire source files into context instead of inspecting specific slices.
  3. Context accumulation in long sessions: As conversations exceed 30 to 50 tool calls, model output and internal reasoning tokens scale rapidly because the entire tool history is re-sent on every step.

What the Skill Does

Instead of feeding megabytes of raw transcripts into the agent and wasting tokens, the skill runs zero-dependency local Python scripts under the hood in seconds.

Importantly, this tool does not blindly modify your configuration or overwrite files. It operates as an interactive diagnostic assistant: it first discovers what is happening, reports the exact bottlenecks to you, proposes categorized remediations, and waits for your confirmation before applying any changes.

Here is the updated skill definition header:

---
name: improve-agent-efficiency
description: Probes host development tools, mines causal command failure chains across past agent sessions, measures token burn and efficiency gains, and executes verified remediation across host binaries, global rules, and workspace AGENTS.md files.
---

You can trigger it directly from chat:

  • For status & efficiency gains: "Analyze our efficiency gains and token burn since yesterday."
  • For a full diagnostic audit: "Audit my past sessions and optimize agent rules."

How the Scripts & Workflow Work

The workflow is structured across distinct phases:

1. Interactive Scoping and Discovery (< 1 second)

For developers with dozens of repositories, you do not want to scan hundreds of sessions blindly. The script scripts/audit_trajectories.py includes a rapid inventory mode (--inventory-only) that discovers your active workspace, top repositories, and session date boundaries. If invoked bare in chat, the agent renders an interactive selection modal (ask_question) so you can select the exact repository scope and time window before deep parsing begins.

2. Out-of-Band Host Probing & Trajectory Mining

The skill bundles two standalone Python 3 scripts in scripts/:

  • probe_environment.py: Inspects your local machine. It tests terminal output stream encoding for non-UTF8 crashes, detects installed CLI binaries (git, gh, rg, dotnet, node, cargo, python), and cross-references your active GEMINI.md to flag discrepancies.
  • audit_trajectories.py: Parses local session transcripts out-of-band at zero LLM token cost. It measures true failure rates, calculates native token burn telemetry across prompts, model responses, thinking tokens, and tool output streams, and reconstructs multi-turn incident chains: [Initial Failed Command] -&gt; [Intermediate Retries / Scratch Scripts] -&gt; [Eventual Working Command]

3. Zero-Match Search Disambiguation

In command-line tools like rg, grep, findstr, and diff, exit code 1 denotes that zero matches or differences were found, rather than an execution crash. The auditor explicitly disambiguates clean zero-match returns from actual syntax or runtime crashes, preventing false alarms.

4. Read-Only Mode vs. Guided Remediation

Depending on what you ask for, the skill adapts its behavior:

  • Mode A (Read-Only Gains & Token Burn Audit): Run with --compare (e.g. audit_trajectories.py &lt;dir&gt; --since &lt;YYYY-MM-DD&gt; --compare). It splits your session history into a baseline and target window, outputs a comparative table of failure rates, retry loops, and token burn per turn/session, and exits without making changes.
  • Mode B (Guided Remediation Pipeline): If you ask to fix or optimize rules, the agent presents the diagnosed friction points to you, outlines proposed changes across three layers, and requests confirmation before applying them:
    • Host Layer: Package manager installs (winget, brew, apt) or persistent environment variables (PYTHONIOENCODING=utf-8).
    • Global Rules (~/.gemini/config/GEMINI.md): File-First execution SOP for multi-line scripts, bounded file reading conventions, and compact git commands.
    • Workspace Rules (&lt;repo_root&gt;/AGENTS.md): Language-specific runtime pinning, package manager lockfiles, and dev server hygiene.
  • Verification Gate: If fixes are confirmed and applied, the agent executes live verification commands to confirm exit code 0 before concluding.

Multi-Platform & Zero Dependencies

The scripts rely exclusively on the Python 3 standard library (os, json, re, platform, datetime). They run on Linux, macOS, and Windows without requiring pip install, and support projects across TypeScript/Node, Python, Go, Rust, and .NET.


Links

u/Substantial-Pride682 — 7 days ago

I can't be the only one feeling this...

Ever since 3.7 Flash came out, my workflow has completely changed. A lot of projects I was struggling with or about to give up on, I was finally able to get working. Even the ones I decided to put on hold, I was able to extract real value, context, and documentation from them instead of just abandoning them in frustration.

The biggest shift is that I am no longer spending half my time annoyed and fighting with the agent over output. Whenever I get stuck now, I just pause and tell it to create educational docs, investigate the issue, and get more context. Through that back-and-forth, new patterns, custom skills, and better workflows have just naturally emerged. I have been able to start way more projects and work on them in parallel without losing momentum.

A big part of it is the workspace navigation and instruction following, but the real differentiator is the sheer speed. When the agent moves that fast, your trial-and-error loop becomes almost instant. You immediately see whether an approach is working or not, and you can quickly tell it to change course, investigate deeper, and learn from it on the fly.

Before, you would spend so much energy wrestling with an agent over a single minor thing that you never had the time or mental bandwidth to let bigger ideas develop. Now, you get through those issues so fast that it opens up a wide horizon where almost any project you think of feels genuinely possible to build.

I am curious if anyone else is experiencing this right now. For people who have been using Claude or Codex, is this what you have been experiencing all along, or is there something truly distinct about 3.7 Flash and its speed?

Edit: Actually, re-reading what I just posted, the biggest piece for me is really the personal learning and growth.

Because the back-and-forth is so fast, it allows me to see further ahead and understand unfamiliar problem domains on a much deeper level. I am not just getting projects built; I feel like I am personally growing and expanding my own technical range at an accelerated pace. The speed of that personal learning is what feels almost breathtaking when I step back from a session.

reddit.com
u/Substantial-Pride682 — 1 month ago

Anyone else massively leveled up their ambition and output with 3.7 Flash?

Ever since Gemini 3.7 Flash came out, there is really something to be said about the speed. The fact that you get results so fast makes it much easier to stay in that flow state where you can continuously iterate, experiment, and learn as you go. Honestly, it has kind of brought the joy back to programming for me.

I have not personally tried other models like Claude or Codex because I have solely been using Antigravity for the past couple of months. That said, the near-instant feedback loop here feels like a massive game changer that really sets it apart.

For those of you who have extensive experience with Claude, Codex, or other alternatives, do you feel the same way? Or do you think there is something major I am missing where their deeper reasoning still beats out the sheer speed and rapid iteration of 3.7 Flash? Curious to hear what others think.

reddit.com
u/Substantial-Pride682 — 2 months ago