Attyx v0.4.14
v0.4.14
Agent token & cost telemetry
The per-pane agent status dot now comes with usage telemetry. For every AI coding agent Attyx already tracks — Claude Code, Codex, opencode, and Pi — you can see how many tokens it’s burned, how full its context window is, and what it’s cost, live. The dots also populate the moment you launch Attyx now, instead of only after you visit each agent’s tab.
See it live in the dashboard, or query it with list agents / watch agents — both below.
What each agent reports
- Claude Code — accurate cumulative tokens, context window, and cost, straight from Claude’s own status data. Output tokens are a true running session total that only climbs — it keeps counting straight through the agent’s context compactions instead of resetting.
- opencode and Pi — tokens, context, and each tool’s own computed cost.
- Codex — tokens and context from the active session; cost is estimated from a built-in price table and marked with a
~(Codex doesn’t report cost, and builds older than Sep 2025 don’t report tokens at all).
Telemetry is read-only — only counters and the model name, never the contents of your conversations.
list agents & watch agents
attyx list agents prints a clean, aligned, colored table of every agent in the session — model, tokens, context vs. its window, cost, and status:
PANE SESSION STATE MODEL IN OUT CTX COST MESSAGE3 1 working opus-4.8 1.2M 320K 82K/200K $0.42 Editing parser.zig8 1 input opus-4.8 - - - - Approve running tests?attyx watch agents is the live version — a header, then a row each time an agent changes. A status dot (● green idle · orange working · purple waiting) reads the swarm at a glance.
attyx list agents # colored table at a terminalattyx list agents | grep input # plain + grep-safe when piped (auto-detected)attyx list agents --color # force color (e.g. into a pager); --no-color disablesBoth take --json for the machine-readable form (same record shape, raw numbers), with a usage object per agent:
{"pane_id":3,"state":"working","message":"Editing parser.zig", "usage":{"input_tokens":7199162,"output_tokens":320836, "context_used":82000,"context_max":200000, "cost_usd":0.4213,"cost_is_estimate":false,"model":"claude-opus-4-8"}}An absent field means unknown, never zero — so a missing cost is never mistaken for “free.” Color is automatic (full color on a TTY, plain when piped or redirected so scripts and --json stay clean), and list agents formats client-side, so the table renders correctly regardless of the running instance’s version.
Also fixed: attyx watch agents wasn’t being recognized as a command at all (it fell through to the launch path) — it now works.
Agent dashboard — attyx dashboard
A full-screen, live view of every AI agent running across all your sessions — tokens, cost, and context window — in one place. Think htop, but for your agent swarm.
attyx dashboard- Cross-session. Unlike the per-pane status dot, the dashboard shows agents from every session, including detached ones — each with its real session name and pane id.
- Navigate & jump.
↑/↓(orj/k) selects an agent; Enter switches to its session and focuses its exact tab and pane — whether the agent is in another session, another tab of the one you’re in, or one side of a split. Jumping to a busy agent is reliable and won’t stall the app.q(orCtrl-C) quits — your terminal is always restored cleanly. - Sort / filter / search.
scycles sort (state · cost · tokens · ctx · session),fcycles a state filter (all · needs-input · working · idle),/searches by model or message. - Act on a pane.
zzooms the selected agent’s pane,xcloses it (with ay/Nconfirm), andTabtoggles a detail panel with the agent’s full usage and latest message. - At a glance. Rows are colored by state (green idle, orange working, purple needs-input), sorted so the agents that need you float to the top, with an
ELAPSEDcolumn showing time-in-state and a totals footer for tokens and cost. - Survives restarts. If the stream drops it shows a “disconnected” banner and auto-reconnects with backoff (handy right after restarting the daemon) — and falls back to the attached window’s agents when talking to an older daemon instead of exiting blank.
- Scriptable.
attyx dashboard --onceprints a plain-text snapshot and exits — handy for scripts or piping. Non-interactive terminals get this automatically.
Bind it to a hotkey by adding a popup to your config (see the commented [[popup]] example in the default config): Ctrl+Shift+A opens it in a floating window. There’s also an in-window overlay (Cmd/Ctrl+Shift+A) for a zero-launch glance at the current window’s agents.
Attach images from the CLI — send-image
attyx send-image <path> [-p <pane>] drops an image into a pane as if it were dragged in — e.g. handing Claude Code a screenshot from a script. (Previously available only over MCP.)
Incremental capture — get-text --since
Reading a busy pane no longer means re-capturing the whole screen every time. attyx get-text --since <cursor> returns only the rows produced since your last read, so tailing a build, a test loop, or another agent is cheap — a quiet pane returns nothing.
Each read hands back a small cursor token; pass it to the next read to get just the new output. Seed with --since "" (returns the current screen plus a starting cursor), then feed the cursor forward:
attyx get-text -p 3 --since "" 2>cur; cur=$(cut -d' ' -f2 <cur)attyx get-text -p 3 --since "$cur" # only what's new since last timeFor scripts and agents, --json returns it all in one object — { "cursor", "text", "truncated", "reset", "rows" } — feed cursor back next time. It also surfaces when output scrolled past the retained scrollback (truncated) or the layout changed (reset, e.g. a resize or full clear — the text is then a fresh baseline). The same since parameter is available on the MCP get_text tool. Works on background sessions too (-s <id>).
Drive another agent — agent send / agent await
Orchestrating agents no longer means hand-rolling send-keys + a watch agents loop + get-text. attyx agent send -p <id> "<prompt>" --wait sends a prompt to the agent in a pane and blocks until that agent’s turn finishes, then reports the outcome:
attyx agent send -p 3 "run the tests and fix any failures" --waitattyx agent send -p 3 "summarize src/api" --wait --capture --jsonattyx agent await -p 3 --state any # just wait — send nothingThe prompt is pasted (so multi-line prompts and {/} are literal) and submitted; the agent is never interrupted. Outcomes — done, needs_input, timeout, no_turn, ended — map to exit codes (0/2/3/4), so attyx agent send -p 3 "build" --wait && attyx agent send -p 5 "deploy" --wait chains turns only on success.
--capturereturns just the output the turn produced — read straight from the agent’s transcript (the same reliable source asagent read, not a screen scrape), with a fallback to the screen for agents that don’t expose one.--tokensadds the per-turn token and cost delta.- Any agent, any session. You don’t need to be on the agent’s tab or pass
-s—agent send/agent awaitfind the agent by its pane id wherever it’s running, including background tabs and detached sessions.
agent await is the formalized version of “block until the agent in pane N is idle.” Both are also the MCP agent_send / agent_await tools — the clean way for one agent to drive another.
Read an agent’s last message — agent read
attyx agent read -p <id> returns the agent’s last message straight from its transcript file — not a screen scrape, no heuristics:
attyx agent read -p 3 # the agent's last messageattyx agent read -p 3 --offset 1 # the message before thatattyx agent read -p 3 --count 5 # the last 5 messages, oldest firstattyx agent read -p 3 --json # {pane,session,offset,count,total,message,messages}--offset <n> (-o) returns the n-th message back (0 = the last); --count <n> (-c) returns the last n messages (composing with --offset). It resolves the agent’s transcript through the daemon, so it works for any agent in any session — no -s needed — and reads the file locally. Supported for agents that expose a transcript file — Claude Code and Codex today; others return a clear “no transcript” message. Also available as the MCP agent_read tool.
Restart the daemon — restart-daemon
attyx restart-daemon hot-restarts the session daemon without losing your panes — it hands the running sessions off to a fresh daemon process. Use it after manually replacing the app binary to pick up the new build (the auto-updater does this for you on a normal update). Unlike kill-daemon, your sessions and the agents in them keep running.