Back to library
AI
best practice

Monitor Token Usage and Manage Agent Permissions via /stats and /settings

Track your AI token spend and manage environment settings in one interface.

Use the /stats and /settings commands to monitor your daily AI expenditure and manage project-specific permissions or directory contexts without leaving the terminal.

Qwen

The Scenario

You are working on a high-volume coding project and need to monitor your API usage costs or change environment permissions on the fly.

Before & after

The old way

Developers have to log into various provider dashboards (OpenAI, Anthropic, etc.) to check API credit consumption, costing 5-10 minutes to track spend.

With AI

Run /stats to instantly see your spend and use /settings to adjust model parameters or MCP gates. It takes 10 seconds to verify costs.

The Prompt

/stats

Qwen Code provides a centralized /stats command to track daily token costs and a tabbed /settings view to manage environment configurations, MCP (Model Context Protocol) approval gates, and directory switching (/cd) all in one session.

Source

Qwen Code Blog: AI Coding Updates and Guides | Qwen Code Docs
"/stats shows your daily token spend, /settings is now a tabbed view instead of a flat list — search, status, and stats."