Skip to content

AgentMeter User Guide


AgentMeter is a desktop Agent usage tool for viewing the account, quota, and Token usage of coding Agents on the local machine. After connecting AgentMeter to TrueWatch, you can also report usage metrics and Agent runtime traces to the current workspace to analyze Agent usage, performance, and invocation processes in a unified way.

AgentMeter currently supports Codex, Claude Code, and WorkBuddy. The data available varies by Agent:

Agent Supported Systems Local Display Service Integration
Codex macOS, Windows, Linux Account and plan, quota window, Token history, and available Credits Supports basic collection and enhanced collection
Claude Code macOS, Windows, Linux Local Token history; when the current account provides official quota fields, also displays subscription quota Supports basic collection and enhanced collection
WorkBuddy macOS, Windows Account and plan, remaining Credit Supports basic collection and enhanced collection
Data Scope
  • Codex Tokens come from the usage data of the currently logged-in account;
  • Claude Code Tokens are aggregated from the local statistics cache and session records and represent only the usage visible on the current device;
  • WorkBuddy currently does not provide Token history or a rolling quota window, and AgentMeter will not use 0 to replace missing data;
  • Fields not returned by the Agent or account are not displayed, and no estimated values are added.

Install AgentMeter

Before installation, install and sign in to the Agent you want to view on the current device. Download the corresponding installer based on your operating system and processor architecture:

Operating System Architecture Installer
macOS Apple silicon Download DMG
macOS Intel Download DMG
Windows ARM64 Download ZIP
Windows x86-64 Download ZIP
Debian / Ubuntu ARM64 Download DEB
Debian / Ubuntu x86-64 Download DEB
Fedora / RHEL ARM64 Download RPM
Fedora / RHEL x86-64 Download RPM

macOS

  1. Open the downloaded DMG file;
  2. Drag AgentMeter into Applications;
  3. Launch AgentMeter from the Applications folder.

After launch, AgentMeter stays in the menu bar and does not display a Dock icon.

Windows

  1. Extract the downloaded ZIP file;
  2. Run the installer inside;
  3. Launch AgentMeter after installation is complete.

After launch, AgentMeter stays in the system tray.

Linux

For Debian or Ubuntu, use the following command to install the DEB package:

sudo apt install ./AgentMeter-latest-linux-<架构>.deb

For Fedora or RHEL, use the following command to install the RPM package:

sudo dnf install ./AgentMeter-latest-linux-<架构>.rpm

Replace <架构> with arm64 or amd64. After installation is complete, launch AgentMeter from the application list.

View Agent Usage

After launching AgentMeter, click the AgentMeter icon in the menu bar or system tray to open the floating panel. AgentMeter automatically detects Agents installed on the current device and displays usage information it can read.

  • Click Refresh to immediately update account, quota, and usage data;
  • Click a Token metric to view historical usage displayed by day, calendar, or trend chart;
  • Go to Settings > Agents to select the Agents to display in the floating panel or system bar, and drag to adjust their display order;
  • Go to Settings > General to configure language, appearance, and launch at startup;
  • Go to Settings > About to check for and install AgentMeter updates.

After Claude Code quota reading is enabled for the first time, open or restart a Claude Code session once. If the current account or Claude Code version does not return subscription quota fields, AgentMeter can still display local Token history.

Connect to TrueWatch

To report Agent data to TrueWatch, go to Settings > Service Integration. Service Integration includes the following two collection levels:

Collection Level Collected Content Data Purpose
Basic Collection Snapshot metrics such as account, plan, Token, quota, and Credit Analyze usage and quota status for individuals or Agents
Enhanced Collection Runtime data such as Session, Trace, model invocation, Tool, and Skill Analyze complete invocation chains, performance, and behavioral risks in Agent Monitoring

Basic collection is built into AgentMeter; AgentMeter manages obs-agent-connector for enhanced collection. The two collection types can be enabled separately for each Agent.

Step 1: Configure the Connection

Go to Agent Monitoring > Summary > Connect Agent, and obtain the Data Endpoint and X-Token for the current workspace on the integration configuration page. Then import a JSON configuration file in Settings > Service Integration > Connection Configuration, or manually enter the following information:

Configuration Item Required Description
Data Endpoint Yes Data ingestion address for the current site; enter only the HTTP or HTTPS base address
X-Token Yes Data reporting Token for the current workspace
User ID Yes Unique user identifier, used to aggregate, filter, and drill down data by User
User Name Yes User display name, used for display and search

The import file uses the following format:

{
  "schemaVersion": 1,
  "ingestEndpoint": "<Data Endpoint>",
  "xToken": "<X-Token>",
  "user_id": "<User ID>",
  "user_name": "<User Name>"
}

The configuration file must use the .json extension and must not exceed 64 KB. After saving, AgentMeter hides the X-Token and does not display the full value in the UI.

Step 2: Enable Basic Collection

In the Basic Collection area, enable the switch for the Agents whose usage metrics you want to report. After enabling it, AgentMeter reports data immediately once, and then reports the latest snapshot every 60 seconds.

Basic collection data is written to the agent_runtime measurement. AgentMeter metric fields start with agent_meter_. Basic collection contains only usage and account snapshots and does not generate Session or Trace data.

Step 3: Enable Enhanced Collection

  1. In the Enhanced Collection area, click Install Connector;
  2. After installation is complete, enable enhanced collection for the Agents whose runtime traces you want to collect;
  3. Complete configuration and verification by following the on-page instructions;
  4. Restart running Agent sessions to make the collection configuration take effect;
  5. Use the Agent to start a new session or task.

AgentMeter manages only detected and supported Agents on the current device. After the connector is installed, you can continue to enable, disable, verify, or remove the integration for each Agent on the Service Integration page.

Verify Data

After completing service integration, verify data by collection level:

  • Basic Collection: In Metrics Analysis, select the agent_runtime measurement and query metric fields that start with agent_meter_;
  • Enhanced Collection: Go to Agent Monitoring > Explorer and view data by Agent type, User, Session, or Trace;
  • Trend Analysis: Go to Agent Monitoring > Analysis Dashboard and filter data by Agent type, Agent ID, or Agent name.

If you have just enabled enhanced collection, complete a new task with the Agent before querying. The collection configuration does not backfill complete Trace data from before it was enabled.

Configure Long Task Notifications

AgentMeter supports sending notifications through a Lark group bot after a Codex long task is completed.

  1. Go to Settings > Notifications;
  2. Enable notifications and Long Task Completion Notification;
  3. Enter the Webhook URL of the Lark group bot;
  4. If the bot has signature verification enabled, also enter the signing secret;
  5. Set the long task threshold and save;
  6. Click Test Notification to confirm that the group chat can receive messages properly.

Only Codex tasks whose execution time reaches the threshold send completion notifications.

FAQ

Agent Not Detected

Confirm that the Agent is installed and has been started successfully at least once, then click Refresh in Settings > Agents. Codex also requires account sign-in. Linux currently does not support detecting WorkBuddy Desktop.

Claude Code Has No Quota Data

Open or restart a Claude Code session once and wait for AgentMeter to receive the first quota response. Some account plans or Claude Code versions do not provide quota fields; in this case, Token history is still available.

Basic Collection Has No Data

Confirm that the connection configuration has been saved, the basic collection switch for the target Agent is enabled, and at least one reporting cycle has passed. Then click View Basic Collection Diagnostics to check the latest collection time, reporting time, and error information.

Enhanced Collection Has No Trace

Confirm that the connector is installed, the enhanced collection switch for the target Agent is enabled, and verification has passed. Restart the Agent, start a new task, and then query in the Agent Monitoring Explorer. If there is still no data, click View Diagnostics to check the connector status.

View Diagnostic Logs

AgentMeter diagnostic logs do not record task content, complete Tokens, Webhooks, or signing secrets. The default log paths are as follows:

Operating System Log Path
macOS ~/Library/Logs/AgentMeter/agentmeter.log
Windows %LOCALAPPDATA%\\AgentMeter\\Logs\\agentmeter.log
Linux ${XDG_STATE_HOME:-~/.local/state}/agentmeter/agentmeter.log

Historical logs use the .1 through .4 suffixes. When submitting an issue, we recommend also providing the AgentMeter version, operating system, Agent type, and redacted diagnostic logs.

Further Reading