ZCode sessions and local usage in the Mac notch

ZCode sessions, tools, and tokens in one place.

Download for macOSFree 3-day trial · Apple silicon
AgentPeek monitoring ZCode sessions and local token usage on a Mac

01

Terminal and desktop sessions, observed live

AgentPeek recognizes interactive zcode and internal zcode-cli processes, plus the signed ZCode desktop app. Management commands such as doctor, login, plugins, and skills stay out of the session list. zcode app-server is also excluded from terminal-session detection. Zed-hosted ACP processes remain attributed to ZCode without turning that app-server into an attach transport.

Seven global lifecycle hooks report session start, prompts, tools, permission waits, failures, and turn completion. They are observers only: a permission request becomes an attention handoff, and ZCode keeps the decision in its own terminal or app.

02

Strict read-only sessions, conversation, and tools

ZCode persists sessions in ~/.zcode/cli/db/db.sqlite. AgentPeek reads that database without writes and projects visible user and assistant messages, completed tools, working directory, model, parent-linked workflow and subagent sessions, files touched, and commands run.

The reader accepts the exact ZCode 3.3.6 migrations and columns. An unknown future schema, malformed JSON, orphaned part, or torn usage relationship is unavailable instead of being guessed. Synthetic, model-only, reasoning, and internal control parts are not presented as user conversation.

03

Exact local token accounting, not a quota guess

AgentPeek sums ZCode's persisted model_usage rows for calendar-month and daily views. Input includes input, cache-creation, and cache-read tokens; output stays separate; and computed_total_tokens remains authoritative. Turn counters are not added a second time.

These are raw local tokens. ZCode does not expose a provider quota percentage, spend ledger, or provider reset window through this store, so AgentPeek does not invent them.

04

Config, MCP, and Quick Routes stay under your control

AgentPeek merges one bounded command into each managed group under hooks.events in ~/.zcode/cli/config.json, preserving unrelated keys and existing hooks. It reads MCP servers from mcp.servers. ZCODE_STORAGE_DIR relocates the complete root when set.

Quick Routes opens commands, skills, agents, instructions, config, database, and root. Project configuration can also live in zcode.json or .zcode/config.json. AgentPeek does not treat zcode app-server as ACP, so Direct Chat, prompt delivery, cancellation, and in-notch permission answers are unavailable.

Questions

Yes. AgentPeek observes ZCode terminal and desktop sessions, reads its local SQLite session store, and shows conversation, tools, subagents, model, monthly tokens, and daily usage.
No. ZCode hooks are observation-only. AgentPeek surfaces the permission wait and can open the owning terminal, but ZCode remains authoritative for every decision.
No. zcode app-server speaks ZCode Protocol, not ACP, and AgentPeek has no compatible attach transport for an existing session. Follow-up prompts, cancellation, and permission answers stay in ZCode.
It sums exact model_usage rows from db.sqlite. Input includes input plus both cache token fields, output stays separate, and computed_total_tokens is authoritative. No quota percentage, spend, or provider reset is inferred.
The default root is ~/.zcode. Global config is ~/.zcode/cli/config.json and the local session database is ~/.zcode/cli/db/db.sqlite. ZCODE_STORAGE_DIR relocates the root.

Keep your agents in view

Download for macOSFree 3-day trial · Apple silicon