Skip to main content

docs/tools/HOWTO-CHECKUSAGE.md

Standard: DSOM For My AI Protocol v6.1 | GitOps · AIOps · Ansible Tool: tools/CheckUsage.ps1 | Version: v8.6 | Platform: Windows PowerShell (T1)

1. Purpose

CheckUsage.ps1 is the Sovereign Session Monitor for the Antigravity AI assistant. It reads the .pb conversation context files stored locally by Antigravity and displays real-time health metrics for each session, size, estimated token usage, growth velocity, age, and status. Use it to:
  • Know when your current session is approaching the context limit
  • Identify dormant old sessions consuming disk space
  • Detect burst rate spikes that may trigger API rate limits (RPM)
  • Keep a live health dashboard open in a side terminal during active work
Location: tools/CheckUsage.ps1 Monitors: C:\Users\[you]\.gemini\antigravity\conversations\*.pb

2. Prerequisites


3. First-Time Setup (Run Once)

Open PowerShell and run:
This allows locally written scripts to run. It only affects your user account. You will not need to run this again. Verify:

4. Usage

4.1 Run Once (Snapshot)

Displays the current state of all sessions and exits. A usage tip is shown at the bottom.

4.2 Live Monitor (Loop Mode)

Refreshes every 60 seconds. Shows a countdown bar between refreshes. Press Ctrl+C to stop.

4.3 Full Syntax

4.4 Examples


5. Reading the Output

5.1 Column Reference

5.2 Status Labels

  • Total MB, total disk used by all .pb files
  • Est Tokens, aggregate estimated token count across all sessions
  • WARN / CRIT, count of sessions in warning or critical state

6. Token Estimation Methodology

The tool estimates tokens using:
This is more accurate than the commonly cited 50,000 tokens/MB. Actual token count varies by content type (code is denser than prose). Interpret estimates as a guide, not an exact count. Use the [WRN] and [CRT] thresholds relative to your observed model behaviour.

7. Troubleshooting

Script will not run, Execution Policy error

Fix: Run once in PowerShell:

Unknown parameter error

Cause: Typo in the parameter name. Fix: Run .\tools\CheckUsage.ps1 -Help to see all valid options.

No .pb files found

Cause: Antigravity has not yet created any conversation context files, or the path is wrong. Check: Verify the path exists: C:\Users\[you]\.gemini\antigravity\conversations\

Loop mode exits immediately

Ensure you are using -Loop (not -Loops or -loop). The -l short alias also works.

8. Integration with DSOM SOD Ritual

As part of the Start-of-Day Ritual (docs/SOD-RITUAL.md Step 1), run the snapshot to verify the current session health before starting work:
If the current session exceeds CriticalMB, begin a new Antigravity conversation and use the SOD Reanimation Prompt to restore context.

Standard: DSOM For My AI Protocol v6.1 | Harisfazillah Jamel | LinuxMalaysia Tool Version: v8.6 | Document Version: v1.0 | Created: 2026-03-10
Deep State of Mind (DSOM) For My AI Protocol | Harisfazillah Jamel (LinuxMalaysia) | 2026-07-04 Standard: UK English | DBP-standard Bahasa Melayu Malaysia (Piawai) | GNU General Public License v3.0