README
¶
agentop
Reference for agentop. For a first tour, read Using agentop.
Every command here is also cortex <command>. The commands live in the cortex
binary (cli/), and agentop is a shim (main.go) that execs
cortex "$@" — so there is one binary to install and one version number to
keep current. Both spellings work and always will; this page uses the short one.
agentop works with the local Cortex on a laptop, and with an AuthBridge sidecar in a cluster.
It reads the proxy's session API.
It shows the sessions, the live event stream of each session, and each event as JSON.
Install
Run the installer. It puts agentop and cortex in ~/.local/bin:
curl -fsSL https://www.rossoctl.dev/cortex/install.sh | sh
Getting started tells what else the installer changes.
Or download the prebuilt agentop and cortex for your platform (linux/macOS,
amd64/arm64) from the
Releases page — agentop alone does
nothing without the cortex beside it, which is where the commands are — see
Download prebuilt binaries for the download,
checksum-verify, and macOS quarantine steps — and drop it on your PATH.
Or build from source. The commands are in cortex, so build that one; build the shim
too if you want to type agentop:
make cortex # ./bin/cortex and ./bin/agentop
agentop looks for cortex beside itself first, then on PATH, so a ./bin with
both in it works with no install. The linux builds are fully static.
Updating (agentop update)
agentop update installs the newest release at once.
Automatic updates tells how a service
install updates itself.
--auto is what the updater runs. It implies --yes and never asks.
The title bar shows one of these notices. When more than one applies, it shows the first:
· vX.Y.Z installed, quit and reopen agentop, in green. The proxy already runs vX.Y.Z. Only the open agentop still runs the old binary, so you do not needagentop service restart.· update to vX.Y.Z failed, see agentop doctor, in red.· vX.Y.Z available, in green: only when vX.Y.Z is newer than the installed release or release candidate. Adevormainbuild shows no notice.· no update check since <date>, in amber: service installs only, after 72 hours with no check.
Run
agentop observe connects to the Cortex on this machine. With no local Cortex, it opens
a picker of the AuthBridge agents in your current kubectl context. See
Choosing between a cluster and a local Cortex:
./agentop observe
Bare ./agentop does the same thing, but is deprecated and will stop
opening the viewer in a future release. It printed no hint that the
other subcommands existed, so anyone who never ran --help reasonably
concluded the TUI was all agentop did — agentop service least visible of
all, and that is what you need when Cortex is not running. Run
agentop --help for the full list.
To profile the viewer itself, set AGENTOP_PPROF_ADDR to a loopback address
before starting it — AGENTOP_PPROF_ADDR=127.0.0.1:47603 agentop observe —
and read the result with
go tool pprof http://127.0.0.1:47603/debug/pprof/heap. Off unless set: the
profiles expose the process's internals, and the viewer's heap holds the
session content it is displaying. Requests carrying a browser Origin, or a
Host other than localhost / 127.0.0.1 / ::1, are refused — and so is a
bind that does not land on loopback (:47603, 0.0.0.0:47603), since those
guards stop browsers, not a curl that names a loopback Host.
Connecting to an existing port-forward
Press l on the Namespaces pane to skip the cluster entirely and connect to a
session API on this host. Where that is depends on whether you have a Cortex
installed: it goes to the address in ~/.cortex/config.yaml when one answered
there (47601 by default), and otherwise to http://localhost:9094, the
in-cluster default port. The second case is the useful one when you already have
your own kubectl port-forward running, when agentop runs inside the mesh, or
when your kubeconfig can't list pods but a tunnel is up.
agentop probes /v1/sessions before switching panes, so an endpoint with
nothing listening surfaces as a footer error and leaves you in the
picker rather than dropping you into a silently empty session view.
Esc from a session entered this way returns to the Namespaces pane
(there's no pod to go back to).
Pipeline editing (e) follows the same split. Connected to this machine's
Cortex, e edits its config file — see Editing the pipeline.
Connected to :9094 through somebody else's port-forward, there is neither a pod
identity to resolve a ConfigMap from nor a local config file to write, so e
flashes a hint instead.
Power-user / scripting bypass
Pass --endpoint to skip the picker entirely:
kubectl port-forward -n team1 pod/weather-agent-xxxx 9094:9094 &
./agentop observe --endpoint http://localhost:9094
This preserves the pre-picker behavior for scripts, CI, or remote session APIs that aren't in your kube context.
Choosing between a cluster and a local Cortex (--kubernetes)
With no --endpoint, agentop decides between the cluster picker and the Cortex
running on this machine (read from ~/.cortex/config.yaml, and probed first —
a stale config from an install that is no longer running is ignored). A Cortex
that is still starting — right after a restart it accepts connections a few
seconds before it answers them — is waited for, up to 6s, with a line saying so;
nothing listening goes to the picker at once.
--kubernetes controls that choice and defaults to false, so a local Cortex
that is answering wins and the picker appears only when none is:
./agentop observe # the local Cortex, when one is running
./agentop observe --kubernetes # the picker, even with a local Cortex running
The default favours the local one because that is the quickstart, and it should
need no flag: install Cortex on your laptop, run agentop observe, watch traffic.
--kubernetes is for the machine that has both — a local install AND cluster
work — where the probe would otherwise win every time and --endpoint could
only substitute for the picker by naming a namespace, a pod and a port-forward
by hand.
A machine with no local install needs no flag either: with nothing answering,
agentop observe opens the picker on its own.
The flag is ignored when --endpoint is given — an explicit address always
wins. Resolution in full:
--endpoint |
Local Cortex answering | --kubernetes |
Result |
|---|---|---|---|
| given | — | — | that endpoint |
| — | yes | absent (default) | the local Cortex |
| — | yes | passed | Namespaces picker |
| — | no | either | Namespaces picker |
You'll see a Namespaces pane listing each namespace that contains an
AuthBridge agent. Enter drills into the Pods pane for that namespace;
Enter on a pod starts a kubectl port-forward automatically and drops
you into the session-events view. Esc backs out. q (or Ctrl+C) quits
and tears the port-forward down.
The picker shells out to kubectl — whatever context you're in is the
context agentop uses. There's no separate auth.
Naming sessions from Claude Code (--skip-claude-metadata)
Cortex buckets traffic by session id, and a session id is a UUID. Claude Code
knows more about the same session: it writes a transcript per session carrying a
model-generated title and the directory the session ran in. agentop observe
reads those transcripts and writes what it finds to
~/.cortex/session-metadata.json, so the sessions table can show a TITLE
column instead of a bare id.
This is one of two routes to a name, and the one this section is about. The
proxy also derives a title from a session's own events and serves it on
/v1/sessions; TITLE prefers the harvested name and falls back to that one,
so the column can be populated for a session with no transcript here at all.
Everything below concerns the harvest only — including --skip-claude-metadata,
which suppresses this route and not the served fallback.
The scan runs in the background, while the viewer is already up: agentop observe paints
immediately and the titles appear when the scan finishes — usually before you have
picked a pod. The viewer opens with whatever titles the last run recorded, so a scan
only ever adds names.
This happens by default; --skip-claude-metadata turns it off:
./agentop observe # open the viewer; titles arrive as they scan
./agentop observe --skip-claude-metadata # skip the scan; previously-recorded titles still show
The scan is also incremental: a transcript whose mtime has not moved since it was
last read is skipped, because a file that has not changed cannot have grown a new
title. On a tree of 124 transcripts totalling 207 MB, a launch that follows a recent
one re-reads 2 of them. A rewrite that preserves mtime — rsync -t, a restore from
backup — therefore keeps whatever title the entry already had; re-run the explicit
command below to force a re-read.
Because the scan outlives nothing, quitting the viewer before it finishes simply means it did not save, and the next launch scans again. The window is the ~0.7s of a first full scan, and milliseconds once the file exists.
Pass --skip-claude-metadata when the scan is unwanted, or when ~/.claude should
simply not be touched. It suppresses only the scan: the viewer still reads
~/.cortex/session-metadata.json, so titles recorded by earlier runs keep rendering and
only sessions new or renamed since the last scan go unharvested — and those still show the
title the proxy serves, if it derived one, rather than a bare id. There is no flag that
hides titles already on disk — delete the file for that, and note that it does not suppress
the served title either, which arrives over the API and not from any file.
A harvest that cannot run is never fatal, and it costs less than it used to: the viewer
still opens, and a session the proxy has named still shows that name, because the served
title arrives over the API and not from this file. What a missing or unreadable file
costs is therefore the TITLE column only for sessions the proxy has not named — which,
on a machine whose agents all route through the proxy, may be none of them. A file that
does not parse is rebuilt from the transcripts rather than costing anything; the entries
a rebuild cannot recover are sessions whose transcripts Claude Code has already pruned.
The failures that need a human, such as an unreadable metadata file, print one line to
stderr with the repair before the viewer starts; success says nothing.
The config directory is CLAUDE_CONFIG_DIR when set, and ~/.claude
otherwise. To read a different directory, or to force a full re-read of every
transcript — the way to repair entries that are wrong — run the harvest
explicitly:
./agentop experimental read-claude-sessions # full scan, reports counts
./agentop experimental read-claude-sessions --dir PATH # a different config dir
./agentop experimental read-claude-sessions --merge=false # rebuild, dropping stale entries
Both the background scan and the default subcommand run upsert, so an entry stays once
written: a session whose transcript Claude Code has pruned keeps its title indefinitely,
and the file grows with sessions-ever-seen rather than sessions-that-exist. That is what
--merge=false is for — but it drops every entry the run did not see, including entries
harvested from a different --dir, so pass it with the same --dir that built the file.
Only the explicit subcommand reports a transcript it could not read to the end. Such a session still gets whatever title was found before the stop, which may be an older one, and the background scan has nowhere to say so once the viewer owns the screen — so re-run the subcommand if a title looks wrong.
Panes
The UI has these panes. Enter drills in; Esc backs out.
Sessions is the only pane you land on. Pipeline (P), Usage (u), Timeline
(T) and Agents (A) are each opened by a key from the session views
and return to the pane you pressed it on. There is no tab strip: Sessions is what
agentop is for, and the others are surfaces you visit and leave.
-
Sessions (default): table of active sessions in the store, most recently updated first. Columns: session (truncated), title, updated (relative), event count, tokens, cost, saved, context.
TITLEcomes from Claude Code's transcripts — see--skip-claude-metadata— and falls back to the title the proxy serves on/v1/sessions, which it derives from the session's own events. So a session with no transcript on this machine can still be named, and the cell is empty when neither source names it — or when the proxy has stopped listing the session, since a row kept alive by its cached events alone has no summary to carry a served title. A session named only by the proxy therefore loses its name at that point while its events remain, which is the one case where a title visibly disappears. The harvested title wins when both exist — a fixed precedence, not a claim that it is always the better string; the two sides rank candidates differently and may not agree on a given session. The column does not say which source it used. Numerics are right-aligned so the digits line up between rows.SERVERappears when this Cortex'sinference-routerroutes — not underon_error: observe, which routes nothing — and has more than one server: the server each session's inference traffic last went to, which for a session that was running when its agent was switched is still the one it started on. A host no server has, such as an unrouted agent's own provider, is shown without its port in parentheses, and a session with no inference traffic seen as an em dash.Son a session's row moves it; seeagentop server. On a terminal too narrow for it the column is left out, not squeezed, and so isAGENT; neither shows untilCOSTandSAVEDdo, so widening the window never takes one away.A
pending:bucket holds an agent's calls from before its process named a session. When the process went on to name one, the bucket is folded into it: its row is hidden, and its calls appear in that session's timeline at the time they were made. A bucket whose process never named a session — or made calls after its last one, or whose calls belong to two sessions — is listed after the real sessions, under its agent. Its row shows the agent underSESSIONrather than the truncated id, and, when nothing else names it,calls outside any session · pid <n>underTITLE. The pid is the process the calls came from. Headers keep the full id, which is still what the API and/match on.CTX(1M)shows how full the conversation's context was on its latest turn. How CTX is derived tells how agentop calculates it.It replaced an
ACTIVEcolumn whose●nobody acted on —UPDATEDalready answers "is this live", in seconds rather than as a dot. Thecachedmarker that column also carried, for sessions the server has forgotten but agentop still holds events for, moved intoUPDATED.With a session archive — a local install — the table lists every session the archive holds beside the ones in memory, so neither a restart nor
session.max_sessionseviction takes a row off it. Enter opens an old session like any other; its events are read back from disk a page at a time — the latest on Enter, older ones from the timeline's first row, as for a resident session — so a long one costs no more to open than a short one.xon the agents pane's All agents row erases all of it, after asking; see the keybindings below.Every figure in this table is a per-session total, summed over that session's whole history rather than over a clock window — which is why its TOKENS column does not match the token counts on the
$breakdown or the Usage pane, each of which covers the window it names. Both are right; neither is a check on the other.The table is also not a longer span than the band, which is the reading worth heading off. With a session archive (a local install) a session's figures reach back through restarts to its first archived event. Without one — any cluster sidecar — the store is in memory, so they reach back only as far as the current proxy process, and on a freshly restarted proxy the whole COST column can sum to less than
TODAY, becauseTODAYcomes from the durable cost ledger and survives restarts.[?]states both facts; the title deliberately does not, since no single span is true of every row.The screen is shown in Using agentop.
The two money columns are dropped entirely on a terminal too narrow to show a sub-cent charge honestly — below 93 columns — rather than rounded to
$0.00or blanked. A charge under a cent reads<$0.01.TITLEis fitted first and the money columns yield to it, so from 69 to 92 the table carriesTITLEand no money, and at 93 the whole set holds every minimum at once. Any column added or resized moves these numbers;sessionsShowMoneystates the arithmetic.SAVED~carries the tilde in its heading rather than on every row: a saving is always an estimate, so the caveat belongs to the column rather than to any one figure in it. Neither money column in this table marks a value — the only glyph a cell here can wear is+, meaning the session's total hit the int64 ceiling and the figure is a floor. The conditional~, earned by a figure whose requests could not all be settled exactly, appears on the band'sTODAYandLAST 1Hand on the$drawer's per-model cost.The screen above shows all of this; the markers are absent there because that fixture has nothing to disclose, which is itself the rule — a clean figure wears none.
Labels sit above their values rather than beside them:
$30.94 todayreads as a list,TODAYover$30.94reads as a figure.One cell per span a budget is read against, ascending left to right, and every cell's label names the period its figure covers. That last part is the rule the band is built on: an earlier version carried
CACHE HITandTOKENSread off the rolling hour while sitting in a row that opened withTODAY, so an hour's token count read as a day's with nothing on screen to say otherwise. Volume readings live where there is room to scope them — the$breakdown, the sessions table, and the Usage pane.All four figures share one column width and are right-aligned, so their decimal points line up and the four periods can be compared by eye.
As the terminal narrows, whole cells drop — never a clipped figure — and the middle yields first:
7 DAYS, thenLAST 1H, leavingTODAYandMONTHas the last two readings. Four fit in 34 columns, three in 25, two in 16, one in 7.A span this deployment cannot answer reads
—, not a number. Without a cost ledger (Kubernetes by default) the proxy answerstoday,7dandmonthfrom its six-hour in-memory ring and reports the window it actually served; a six-hour figure under aMONTHlabel would understate the month by about 120x while looking perfectly well-formed.Spans and the cost ledger. Three of the four spans are ledger-backed, so what agentop can really distinguish depends on whether the proxy keeps one:
LAST 1HTODAY7 DAYSMONTHlocal install (ledger on) ring ledger ledger ledger Kubernetes (no ledger) ring ———The band detects this and draws
—, so it never labels six hours of spend as a month. The$breakdown does not:wstill offers all four spans there, and without a ledger three of them return the same clamped six-hour fold under three different captions. That is a known limitation rather than a design: the target is a local install, where the ledger is on by default and all four spans are real.wused to offer 15m/1h/6h, which is what a ledger-less deployment could actually tell apart, and those remain reachable throughagentop cost --windowand the Usage pane.A poll chain that stops answering is dated on its own label —
TODAY 7m— so a wedged chain cannot pass for a current reading. Each span polls on its own cadence (20s for the ring-served hour, a minute for today, five minutes for the two that walk many day files), so the age is per cell rather than per band.The
~onSAVEDsits in the heading, not on every value. A saving is estimated in every row, so a per-row marker distinguished nothing while diluting the same glyph where it is conditional — on a cost figure whose pricing was incomplete.+(the real figure is larger) and!(spend is missing from the sum) stay on the values, because those are per-row claims.How precise a money figure is depends on whether you scan it. Anything read down a column or compared against its neighbours reads in cents: all four band cells (
LAST 1H,TODAY,7 DAYS,MONTH), the sessions table'sCOSTandSAVED, the Usage pane'sCOST, and both columns of the$drawer. Two digits of extra precision are noise on a surface whose job is comparing rows to each other.One request is the exception, and keeps four decimals: the events table's
COST. A single cache-read request is $0.000038, so cents there would render a whole column identically — the one place the precision carries all of the information rather than a little of it.Neither form ever prints a positive figure as
$0.00: cents falls back to<$0.01and four decimals to<$0.0001. "Free" is a claim about the traffic, never a rounding artefact.Money is shown in the unit it was billed in. An endpoint configured with a
unit:(see Billing units) reads in that unit everywhere —0.03 Bobcoins, never$0.03— with the same precision rules as dollars. Figures in different units are never added: a band span holding both prints them side by side ($6.20 + 0.03 Bobcoins), and the drawer, the agents pane and the sessions table label each row with its own unit. In the Agents pane, an agent row or a project row that spans units shows the amount in each unit, dollars first:$1,065.52 + 0.95 Bobcoins. The COST column grows into the free width of the pane. When the terminal is too narrow for that cell, the cell reads(mixed). The Other rows, and a sessions table row that spans units, read(mixed). The drawer's tier column is withheld for a mixed window, and so is the Usage pane's cost chart — scope to one agent (A, thenu) to chart it. Where a column is too narrow for the name it is shortened (0.03 Bobc…), down to¤. In the Agents pane, a single unit is not shortened when the pane has free width (15.90 Bobcoins). A deployment with nounit:configured sees exactly the dollar figures it always did.A subscription login's cost is not money. A Claude Pro or Max request has no per-token bill, so its cost at API rates is shown beside the money, labelled, and never added:
$1.20 + $32.16 API equivon the band, inagentop costand at the end of a$drawer row, and$32.16 API equivin the COST cell of a session or agent with no money, shortened to fit a narrow column. An agent with both shows both where its COST has room; a session with both shows its money, and both are in the text a search reads. A band too narrow for it leaves it off rather than drop a span. Cost of unknown billing readsunknown billingthe same way. See Cost records.$expands the band into two columns — where the money went, by rate tier, and who spent it, by model, endpoint or agent:WHERE IT WENT BY MODEL output 54% ████████████ $5.85 claude-opus-5 $11.12 17 req └ reasoning 31% ███████▏ ~$3.48 claude-sonnet-5 <$0.01 2 req cache-read 35% ███████▉ $3.90 claude-haiku-4-5 <$0.01 120 req cache-write 8% █▉ $0.98 (other) <$0.01+ 9 req input 3% ▊ $0.39 [a] [model] · endpoint · agent [w] 1h [$] closesThe tier figures are modelled, not measured: the split comes from the rate table even when the total beside it is a gateway's own authoritative figure, because a gateway reports one number per call and never breaks it down. They are apportioned so the column sums to the window total exactly, and a tier the rate table says nothing about shows
—rather than$0.00, which would claim the tier was free. Below 86 columns the tier column drops and the panel degrades to the by-model breakdown alone.└ reasoningwears a~that no other row does, because it is modelled twice over: its share of output comes from the token counts, not from a cost the provider reported, so it is only the share of output spend where every model in the window bills output at one rate. A mixed window can be off by the spread between those rates. Nothing reports a reasoning cost, so this is the best available figure rather than a measured one.└ reasoningis a child of output, not a fifth tier. Reasoning has no rate of its own — it is the share of the generated tokens the model spent thinking, billed at the output rate — so its figure is already inside output's, and only the four unindented rows sum to the window total. Its share is denominated in that same total, which is what makes31% ⊂ 54%read as containment.The row is always present, in one of three states. A reported split shows its figure with a
~. A split reported as zero shows an exact$0.00and no~— the model was asked to think and spent nothing on it, which is a measurement and the reading that says an effort setting is not reaching the model.—means no figure: the endpoint reports no split, or the apportioned share fell below a micro. Anthropic reports the count asoutput_tokens_details.thinking_tokensand OpenAI-format endpoints ascompletion_tokens_details.reasoning_tokens; both are read.The four tier rows carry no
~, unlike the sessions table'sSAVED~(the└ reasoningchild does, for the reason given above). The caveat is real but this panel has no money heading to hang it on —WHERE IT WENTnames the column, not the figures — so the choice was a tilde on every row or the sentence above, and the sentence won.The selected row is reverse-video rather than marked with a glyph, so it is the one thing these listings cannot show.
What the markers on a figure mean. Each rides on the figure it qualifies, and a clean figure carries none — a marker present on every row would distinguish nothing:
~estimated, so the figure is a lower bound rather than an exact total +a floor: some traffic in the span is unpriced, or the span reaches back past what the ledger retains !short by an amount nothing can state — a damaged ledger read, or a counter that hit its ceiling This paragraph used to describe a single
SPENDline whose figures were grouped by span —SPEND $30.93 today 1h: $2.91 cache 81% …— with the day's cost and saving before1h:and the rolling window's readings after it, and a~on the saving on every row. That line is gone: it mixed spans on one row, which is the defect the band replaced, and the saving's unconditional~was noise on 100% of rows. Avoided spend now lives per session in the sessions table and per series in the$breakdown; volume readings live in the Usage pane. -
Events: per-session event table.
copens a column picker — a popup with a checkbox and a one-line description per column, since twelve abbreviated headers are not self-describing.The picker is also where sorting lives:
sorders the table by the column under the cursor, descending first, so "which calls took longest" and "which cost the most" are one keystroke from the column that answers them. Press it again for ascending, and a third time to return to arrival order. The sorted column is marked in its header (DURATION▼) and named in the footer ([sort: DURATION▼]) — the footer matters on a narrow terminal, where the sorted column may be one the table had to drop.Numeric columns sort numerically, not by the text in the cell: DURATION orders 90ms before 1.20s, and TOKENS orders 900 before 1,048,576. Blank cells — a request whose response has not landed, or a figure the proxy could not model — sort to the bottom of a descending view rather than crowding the end you sorted toward. Sorting never changes the
#numbers or a row's figures. It reorders the finished rows only.Each tool call has its own row under the exchange whose response asked for it. The row shows the tool's name, not its command or arguments:
/still finds them, andEnteropens the full call. Its#cell is┣⚒or┗⚒(the last tool of the exchange). A sort orders the exchanges, and the tool rows stay under their exchange. On DURATION, an exchange ranks by the longest DURATION of the exchange and its tool rows. A running tool counts with its time so far. A lost tool counts as 0. Therunandbgspans do not count. When a tool row sets the rank of its exchange, its DURATION cell is bold. All other columns rank an exchange by its own value. The tool's DURATION is measured from outside the agent: from the reply to the next request of the same agent. So it includes the client's own delay, and it can miss a tool that started while the reply still streamed.Enteron a tool row opens the exchange whose request carries the tool's output, with the cursor on the call and the output open below it. When no such request is held, it opens the exchange that asked for the tool.Escgoes back to the tool row.The twelve default columns together need about 180 terminal columns, so the table drops what does not fit and the footer says how many (
→ N more columns). Columns carry a keep rank rather than being equally expendable: DIR, DURATION, TOKENS and COST give way first, while#and HOST survive longest. That is what makes HOST usable at 80 columns despite being last in display order — it is the column most people open this pane for.All twelve are on by default:
#(exchange number), TIME, DIR, ACTION, PLUGIN, METHOD, STATUS, DURATION, BYTES, TOKENS, COST, HOST. On a narrow terminal the low-ranked ones are hidden rather than turned off, so widening the window brings them back without touching the picker.BYTES was the one opt-in column until recently, on the grounds that only an opaque tunnel's close row had a figure for it. Ordinary rows now carry one too — the body size the request forwarded (↑) and the body size that came back (↓) — so the reason for hiding it is gone and the picker is where you go to turn it off. A blank cell means the proxy counted nothing, which is not the same as a body of zero bytes: a body no plugin asked to buffer is relayed unmeasured and reads exactly as a body-less GET does.
A session with subagent traffic groups each subagent's rows under a collapsible header at the subagent's first row:
▸─ <label> · N rows · tokens · cost, where the label is the subagent's description from Claude Code's own records when the harvest can name it and the raw agent id otherwise. Blocks are collapsed by default — the point is that an agent's fan-out stops drowning the conversation — andEnteron the header opens it, showing its rows in time order with a│gutter in the DIR column;Enteragain closes it. The main conversation's rows stay top-level between them, so the interleaving stays honest. Blocks exist only while the table is chronological: a sort ranks rows, and grouping would contradict the ranking. A search opens every block, so a match inside a collapsed one is findable.Live-updates while in view — if the cursor is on the last row, it auto-follows new events.
All twelve columns, on a terminal wide enough for them. Each row is one exchange: a request and its response. A blank STATUS means the response is on its way.
lostmeans an outbound request with a request id got no response for 10 minutes, by the rule the Timeline uses. A tunnel open or an inbound request never showslost. A request the proxy did not stamp with a request id (an older proxy) keeps two rows that share one#:agentop · ctx-abc-1234… # TIME DIR ACTION PLUGIN METHOD STATUS DURATION BYTES TOKENS COST HOST 1 14:23:07.41 in allow jwt-validation 200 118ms ↑1.4kB ↓842B weather-agent 2 14:23:07.71 out observe inference-parser claude-sonnet-5 200 1.20s ↑118.6kB ↓12.4kB 681.3k(−9.9k)→412 $0.2767(−$0.0037) api.anthropic.com 3 14:23:09.01 out modify token-exchange tools/call 503 96ms ↑318B github-tool-mcp 4 14:23:09.40 out observe inference-parser claude-sonnet-5 ↑121.0kB api.anthropic.com ● connected 2.1 events/sec [/anthropic 2 matches] [sort: DURATION▼] [b/f] page [↵] detail [c] columns [u] usage [/] search [n/N] next/prev [esc] back [?] keys [q] quitExchange 3 has no ↓ figure because there was nothing to count: token-exchange could not reach the IdP, so the 503 is the proxy's own and no upstream body ever arrived. Exchange 4 is still on its way.
—in ACTION and PLUGIN means no plugin acted on that message; atunnelthere is an opaque CONNECT, where METHOD is blank because opaque bytes carry no request line. A tunnel's row gets its STATUS when the tunnel closes, with DURATION for how long it stayed open and, in BYTES, what it carried each way. That STATUS is the CONNECT's own (200, or 502 when the destination could not be reached), never the destination's, which travels inside the client's TLS. TOKENS reads prompt→output. TOKENS and COST carry what the context operators saved in parentheses —−for a counted saving,~for a projected one. -
Detail: one exchange in full, at the full width of the terminal: a REQUEST section, then a RESPONSE section, each the event as the proxy recorded it, under a title that names its time and the plugins that acted on it. The line above the JSON names the section at the top of the screen, then the exchange's figures.
Tabmoves to the other section's title, andEnterfolds the section or node at the cursor. The response leaves out the fields equal to the request's (client, direction, host, method, path, ids), andinvocationsstarts folded. A half that is missing says why: on its way, lost, denied, or not loaded yet. Move with the arrow keys.yyanks the section the cursor is in to~/.cortex/agentop-events/<timestamp>-<rand>.jsonand shows the path in the footer until you press another key. The directory is private to you (0700, inside~/.cortex) and the files are 0600 — yanked events carry identity subjects, raw LLM completions and tool arguments, so they are deliberately not written to a shared location such as/tmp. Nothing prunes them: they accumulate until you delete them, and unlike$TMPDIRthis location is never cleared by the OS. Given what they hold,rmthe ones you are done with. The footer shows the path expanded rather than abbreviated with~, and gives it the whole line while the notice is up; on a terminal too narrow for it the path is truncated from the left, so the filename stays readable. -
Pipeline: the active plugin chain in inbound + outbound order, opened by
Pfrom Sessions, Events or Detail;Escreturns to whichever of those it was opened from. Columns: position, direction, plugin name, DEPS (✓/✗ — see "Plugin dependencies" below), writes, body access, event count.eopens the editor. Under the chain, an── available ──divider lists every plugin the running binary can build (/v1/plugins) that the chain does not run, so you can see what to add before you edit. Those rows have no position, direction, DEPS or events, andEnteron one opens its detail. The list is fetched each timePopens the pane. This section replaced the plugin catalog pane, which had its own key,C. Outside the viewer,agentop pipeline getprints the same composition — plus each plugin's description and config — and--jsonemits/v1/pipeline's own shape for a script. It has no DEPS or event count: one is derived from the chain rather than reported by the proxy, the other counts invocations in cached session events, which a one-shot command has none of. -
Plugin detail: drill-into-row for a Pipeline row, available rows included. Shows description, position, reads/writes, body access, plugin config, and per-dependency satisfaction status against the active chain.
-
Usage: time-bucketed charts of volume, errors, latency and cost, opened by
ufrom Sessions (all sessions) or Events/Detail (the selected session). Sourced from/v1/usage, which the proxy aggregates server-side — so every operator watching a pod sees the same history, including traffic from before they attached. Refetches every 20s while in view.mcycles the metric. Counts (tokens/requests/errors) and cost render as bars; latency renders as mean-with-whiskers (┼mean,┬/┴±1σ), because a bar encodes magnitude from a zero baseline and mean latency has no meaningful zero. On a terminal with room to spare the bar chart captions its y-axis with the metric's unit (tok,req,err,USD, or a cost chart's billing unit, such asBobc…); latency has no caption, because its own labels carry the unit per magnitude (820ms,4.1s).bcycles the breakdown, which stacks each bar by status, model, plugin or host — each series marked with a letter derived from its name (sfor claude-sonnet-5) on a coloured ground, so the chart reads without colour too. Statuses ≥400 render red.bis not offered for latency: the aggregator holds no per-label latency, so there is no per-status mean to plot.The host breakdown answers "where is my traffic going" — one band per upstream, so two agents sharing one Cortex are told apart by the hosts they call. Ports are folded in, so a bridged
api.anthropic.com:443and the request inside that tunnel are one band. A request the listener recorded no host for joins the(unlabelled)remainder. Hosts are more numerous than models or statuses, so expect(other)here sooner.An idle bucket shows
0rather than an empty column, so a gap in traffic is distinguishable from traffic too small to plot. A bucket carrying traffic no label claims shows an(unlabelled)band, and series past the palette fold into(other)— every band drawn has a legend entry.agentop · http://localhost:9094 · usage · all USAGE — all sessions — 10m0s @ 1m0s — tokens — by model 12k ▄▄▄▄ ████ ssss 9.6k ▃▃▃▃ ssss ssss ssss ▅▅▅▅ ssss ssss 7.2k ▂▂▂▂ ssss ssss ssss ssss ssss ssss hhhh hhhh ssss 4.8k ssss ssss hhhh hhhh hhhh hhhh hhhh hhhh hhhh hhhh 2.4k hhhh hhhh ···· ···· hhhh ···· ···· ···· ···· ···· 0 ┼────┴────┴────┴────┴────┴──── 14:23 :25 :27 :29 :31 6.1k 8.8k 0 11k 9.9k 12k s claude-sonnet-5 (34.2k) h claude-haiku-4-5 (9.4k) · (unlabelled) (2.1k) REQUESTS 412 ERRORS 3 (0.7%) TOKENS 48.2k LATENCY 1.31s COST $0.94 updated 7s ago (every 20s) [m] metric [w] 10m [o] breakdown [/] search [esc] back [?] keys [q] quitUnder
latencythe bars give way to mean-with-whiskers and the breakdown hint disappears, since the aggregator holds no per-label latency. There is no value row: a row of durations under the time labels read as a second time axis, so each mean is read against the y-axis instead, and a bucket with no measured response is left as a blank column:USAGE — all sessions — 10m0s @ 1m0s — latency — no breakdown for latency 2.4s ┬ │ ┬ 1.8s ┬ │ │ │ ┼ │ 1.2s ┬ ┼ │ ┼ ┼ │ ┴ │ 600ms ┴ ┴ ┴ 0 ┼────┴────┴────┴────┴──── 14:23 :25 :27 :29 ┼ mean ┬ +1σ ┴ −1σ (blank = no measured responses) -
Timeline: where one session's time went, opened by
Tfrom Sessions (the highlighted row), Events or Detail, fromGET /v1/sessions/{id}/timeline. Rows are the main agent, each subagent indented under the agent that spawned it, and then the hosts the session talked to, busiest first, with a blank line between rows:window 5m 1h all ╷10-26 14:28 ╷15:17 ╷16:06 37m 10-26 20:08╷ model tools tok/s main agent ▂█▃▅▃██▁▄▃▁▃█▁▆▁▂▇█▂▁▁▂████████▁▁▅▁███▅▁ ┆ ▄▁ ┆ ▂▁▆▂▁███▄▁│ 1.6h 29m 85 Survey cortex egress da ▃▂▁ ┆ ┆ │ 4m 1m 92 ╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌ llm-gateway.example LLM ▂▃▂▁▂ ▁▂▁▁▃▄▄▂▁▁▁ ▁▁▁▂▂▂▂▂▂▂▂▂▂▂▁▁ ▂▁ ┆ ▁▁ ┆ ▂▂▁▁▁ │ 1041 reqAn agent cell is a bar of how that cell's time divided, stacked from the bottom: amber the agent's tools running — a background shell job is a tool still running, and counts here — purple its model generating, red retrying after a failed model call, teal waiting on its subagents, grey waiting on you, as is an
AskUserQuestionthe agent put to you. Waiting is read from the gaps between an agent's model calls: a gap that one of its subagents was running in, or that a subagent's result ended, is waiting on subagents; a gap before a call that re-sent the same conversation is retrying; after a failed call it is retrying until the last failed request to the model host, then waiting on you, since Claude Code shows the error and stops. On the main agent, any other time is waiting on you, except after a tool that lost its result, which is left blank. A subagent's gaps are otherwise blank. A subagent's cells are measured against the part of the cell it was alive for, so its row is one run from spawn to hand-back. A terminal cell holds two colours, so a cell that mixed three states (8% of cells at "all" in real sessions, none at 1h or 5m) shows its two largest; the line below the chart has the detail. A host cell's height is how many requests were in flight at once (▁one …█eight or more); red is an error or a refusal. Loopback hosts, the proxy itself among them, are not drawn. The gutter is the window's model time and tool time for an agent, and its output tokens for each second of model time over its last 60 s of model time (tok/s, in the model colour while a turn streams, blank when no turn has tokens), and the request count for a host.wcycles 5m / 1h / 24h / all, offering only the windows shorter than the session, so a short session shows "all" alone; the choice is saved, and a saved window too long for a session shows "all" without being overwritten. A session is live while its last recorded event is under 30 minutes old: its windows, "all" included, follow now, and a call still in flight grows. At "all" the wait since its last activity takes at most 6 cells, labelled with its length (+24m) once squeezed, so the work keeps the width. Once it is not, an open call ends at the session's last event, the last moment anything was seen, and the window ends at its last activity. "all" squeezes each stretch over 30 minutes with no model call or tool, anAskUserQuestionaside, into a┆, coloured by the state that held most of it, and the axis says how long it was; a host's┆is red when a request failed in it.←/→pick a moment, skipping those stretches, and the line under the chart lists the visible rows' tools that started then, and after them those still running from earlier ("since 12:41:04"), each with its duration and its command, path or description; a cell with no tool names the request↵would open.↵opens the Events pane on the first event listed.↑/↓scroll the agent rows, then the host rows, when they do not all fit; the?help lists them, not the footer. The pane refreshes at most once a second while the stream delivers that session's events, and every ten seconds while a call is in flight with nothing new recorded. A failed fetch is retried after 1s, then 2s, 4s … up to 30s, and the first fetch of a visit waits up to 30s, since a session only on disk is read from its archive.Subagent rows: Claude Code and IBM Bob only. Every recognised agent gets its main row. Subagents come from Claude Code's agent-id headers and Bob's task ids, and a tool's end from the first request carrying its result. Sessions recorded before the proxy captured agent ids show their subagents as one row; a client Cortex does not recognise shows host rows alone. A proxy too old to serve the endpoint gets a line saying so.
-
Kubernetes Namespaces (optional): the way in when agentop has no endpoint to connect to — one row per namespace holding an AuthBridge agent, then a Pods pane, then an automatic
kubectl port-forwardinto the session view. Shown when--endpointwas not given and either no local Cortex is answering or--kuberneteswas passed;[L]leaves it for the Cortex on this machine.agentop · pick namespace NAMESPACE PODS team1 2 team2 1 default 1 [↵] open [L] localhost:47601 [r] reload [/] search [?] keys [q] quitWithout
--kubernetes, a running local Cortex is connected to directly and this pane never appears. With--endpointthe flag is moot: an explicit address always wins.
Layered on top of all of them:
-
Key help: a modal overlay opened by
?from anywhere (picker included). It is a map of the panes as much as a key list, ordered by what a lost reader asks first:- the current pane, highlighted — what it shows, then its own keys;
- GO TO ANOTHER PANE — the keys that leave, each naming the pane
it opens and what is on it. Rendered per pane and only where the
key actually works:
u,Pand$from the session views, and on the two pickers the heading kept with a line saying they open once you're connected, rather than dead keys; - THE DRILL PATH —
namespaces → pods → sessions → events → event detailon one line, since that spine is also whatEscwalks back. If you're on one of its five panes it's in brackets; the four key-opened panes are not steps on it, so they get a line naming that and naming whereEscreturns them; - ANYWHERE —
?,p,q, the three keys with one meaning everywhere — then MOVING AROUND THIS HELP (↑↓/jk,b/f,g/G: these move the overlay on every pane, and a note names the one pane where their closed-overlay meaning differs), then INSIDE THE SPEND DRAWER (a/ware live only while it is open, so they are not mixed in with the keys that always work — and the section is omitted on the panes where$is refused); - EVERY PANE — the other nine in full, purpose and every
binding's description. Not compacted to bare keys:
USAGE m w b s escsaid the pane has five keys and nothing about what any of them do.
While it's up it owns the keyboard —
?,Esc, orqcloses it (qcloses the overlay rather than quitting agentop). This is the discoverable home for keys the single-line footer has no room for,Pamong them. Two exceptions: while a pipeline edit is in flight that overlay is already modal and ownsy/N, and while the search prompt is open?is a character you're typing (session IDs and hosts can contain one). In both cases?is inert until the keyboard is released.The body scrolls, so the full reference is reachable on a short terminal:
↑↓/jkby line,b/for PgUp/PgDn by page,u/dby half page,g/Gto the ends. A[↑↓] scroll <n>%affordance appears in the overlay's footer only when the content overflows; the close hint stays pinned there at every scroll position. Resizing the terminal re-ranges AND re-wraps the body without losing your place — prose wraps to the panel width rather than being clipped at the right edge, so the descriptions and the scope note survive a narrow terminal.Spelling out all ten panes costs roughly four screens at 24 rows, which
g/Gand the pinned close hint are what make affordable. The overlay is the one surface with no width or height budget to defend, so it is where completeness belongs. -
Footer notices: a refused key says why in amber, and a failed action says so in red. Both stay until the next key and at least three seconds, cut in the middle when too long. A yank's path and a server switch's result stay until the next key. Other notices, including a failed settings save, last three seconds.
Keybindings
| Key | Context | Action |
|---|---|---|
? |
any (not while searching or mid-edit) | open the key-help overlay (?/Esc/q closes) |
↑ ↓ / k j, b/f, u/d, g/G |
key help | scroll the overlay |
↑ ↓ / k j |
picker, list | navigate rows |
Enter / → / l |
namespaces | open the namespace |
L |
namespaces | connect directly to this machine's Cortex, or to localhost:9094 when none is installed. Capital, because l opens the row here as on every list |
Enter / → / l |
pods | port-forward + connect |
Esc |
pods | back to namespaces |
r |
namespaces, pods | reload agent list from cluster |
Enter / → / l |
sessions, events | drill into selection; on a subagent block's header row in the events pane, collapse/expand the block instead |
Esc / ← / h |
detail, events | back out |
Esc |
sessions | back to the agents picker when the list was reached by picking an agent there; otherwise (picker mode) tear down port-forward and back to pods. Sessions and the agents picker above it are the only panes that tear down — every key-opened surface returns to its caller instead |
/ |
any pane, and the key help | search what the pane shows, as in a text editor: every row stays, the matched characters are highlighted, and the cursor (or, in a text view, the view) jumps to the first match at or after where you pressed /, wrapping past the end, as you type. Case-insensitive substring of the text the pane displays: a table's columns that are turned on, at full width (a value cut to … matches in full, and so does a column the terminal had no room for); an exchange's or plugin's detail line by line, before it is wrapped; the key help's and the usage chart's lines as drawn. deny finds denied events because ACTION shows it. Enter keeps the place; Esc puts the place and the previous search back; Enter on an empty box clears the search. Each pane keeps its own search; the events pane's and an exchange's detail's last while you stay with one session (the detail's carries from exchange to exchange), and none is saved. On the events pane, Tab in the prompt turns on [x] details: then Enter, n and N find the next row whose detail view shows the query — in either half, every field, the exact capture too. The proxy finds the matches in one pass over memory and the archive (GET /v1/sessions/{id}/search), and agentop checks the summary rows it holds itself, so nothing is fetched. The footer counts the matches, and also the matches in events older than the ones agentop holds: Enter on the timeline's ▲ row loads those. A Cortex that predates the search says so in the footer |
n / N |
any pane with a search, and the key help | next / previous match, wrapping at both ends; in a text view an off-screen match is scrolled to a third of the way down |
x |
sessions, agents | erase the row under the cursor, in memory and on disk: the highlighted session, or every session of the highlighted agent — on All agents, every session this Cortex holds; that confirmation also shows the size on disk. Asks first, with the count; y erases, n/esc keeps. The cost ledger is kept. An agent still using a session brings it back with its next request. Refused — with the proxy's reason — anywhere but a loopback-only laptop install. Not in the footer; the ? overlay names it |
c |
events | open the column picker (↑↓/jk move, space toggle, s sort, r reset, Esc/Enter/c close); the selection and sort are saved on close |
s |
column picker | sort by the column under the cursor: descending → ascending → chronological. Pressing it on a different column starts that column descending. # is not sortable — its order already is chronological |
p |
any | pause/resume stream |
y |
detail | yank the event of the section the cursor is in (request or response) to ~/.cortex/agentop-events (path stays until the next keypress) |
Tab |
detail | jump to the other section's title: request or response |
g / G |
lists | jump to top / bottom. In the events timeline this also sets where the next session opens — see Where a session opens. On a paged-back events timeline, G also goes back to the live tail and resumes updates |
Enter on the ▲ row |
events | load the page before the oldest event shown. When a session holds more events than one response, the timeline's first row reads ▲ press Enter to load N older events, and the footer says N older (▲ at top) |
u |
sessions, events, detail | open the usage charts (sessions: all sessions; events/detail: the selected session) |
T |
sessions, events, detail | open the timeline (sessions: the highlighted row; events/detail: the selected session) |
w |
timeline | cycle window: 5m / 1h / 24h / all, only the windows shorter than the session |
← → / h l |
timeline | pick a moment, skipping collapsed stretches; the line below lists the tools running then |
↑ ↓ / k j |
timeline | scroll the agent rows, then the host rows, when they do not all fit |
Enter |
timeline | open the events pane at the cursor's first tool |
Esc |
timeline | back to the pane it was opened from |
$ |
every pane except the two pickers, usage and timeline | expand the band into a breakdown — where the money went by rate tier, and who spent it by model, endpoint or agent — in place, so the table stays on screen. $ again closes it; Esc does not, so it always backs out of the pane in one press. Needs 29 rows; refuses on the two pickers (nothing is connected yet), on the usage pane, which is already a breakdown with its own cycles, and on the timeline, whose w is its window. On the agents pane the breakdown — and the band above it, and the title — is scoped to the highlighted row, the same agent ↵ would scope to, read but never committed, and follows the cursor; leaving the pane returns both to the committed scope |
a |
while the breakdown is open | cycle the axis: model / endpoint / agent. Not g, which is the global "jump to top" |
w |
while the breakdown is open | cycle the span: the band's four — last 1h / today / 7 days / month. Without a cost ledger only the hour is distinct; see Spans and the cost ledger |
w |
agents | cycle the pane's window, drawer open or not: the rows, the title and the breakdown move together through the same four spans. Opens on today; the drawer's own span on other panes is left alone |
m |
usage | cycle metric: tokens / requests / errors / latency / cost |
w |
usage | cycle window: 10m / 1h / 6h |
o |
usage | cycle breakdown: none / status / method / plugin / host (not offered for latency — there is no per-label latency — or under an agent or project scope). Not b, which pages up everywhere else. The pane's scope comes from where u was pressed: all sessions from Sessions, the session being read from Events or Detail |
Esc |
usage | back to the pane it was opened from |
P |
sessions, events, detail | open the pipeline. Capital P because lowercase p pauses the stream and has no replacement worth the trade — space and d page the table, except on the agents pane, where space opens projects and d, PgDn and f still page down |
Esc |
pipeline | back to the pane P was pressed on |
A |
any session-view pane (not the picker) | open the per-agent breakdown — each coding agent's sessions, when it was last seen, and what it has spent today (w moves the window), plus a row for any agent that owns a listed session but has spent nothing in it, since the sessions list is not limited to today and every session in it needs a row to scope to. Capital A because lowercase a cycles the spend drawer's axis. Refetches on every press and opens however many agents it finds, one or none included; pressed on the agents pane it only refreshes the rows. Not in the footer, for width; the ? overlay names it |
↑↓ / jk |
agents | move the cursor |
↵ |
agents | on a row that opens (sessions record a project), open it into its projects or close it. Opening puts the cursor on its All projects sub-row, so ↵ ↵ lists the agent's sessions. On any other row, scope to the agent under the cursor and list its sessions, whichever pane A was pressed on — including the agent already scoped, which stays scoped. The first row, All agents, clears the scope — from its All projects sub-row when sessions record a project. It reaches the sessions list, the usage pane, and the spend band and its drawer — except on the agents pane itself, where the band and the drawer follow the highlighted row instead of the committed scope; agentop cost --agent is a separate process. On a project sub-row, ↵ scopes to that project and its agent; on a project under All agents, to the project only; on the project Other, to the sessions and spend that record no project. All projects clears only the project scope. x and S act on the parent on the open row and on All projects, and do nothing on a project or Other sub-row |
S |
agents | choose the inference server the highlighted agent's new sessions use: a picker over the pane, its cursor on what the agent has now. ↵ applies the highlighted entry, Esc/q/Ctrl+C close it, and an entry the config file already holds writes nothing. Opens only on an agent's row, when agentop is attached to this machine's Cortex and its inference-router routes; elsewhere a panel says why. See Choosing an agent's server |
S |
sessions | move the highlighted session to another server: a picker, its cursor on the server the session uses now, so ↵ at once changes nothing. Opens only when agentop is attached to this machine's Cortex and its inference-router routes; elsewhere a notice says why |
Esc |
agents | back to the pane A was pressed on, leaving the scope as it is. When the picker opened itself at startup, or was reached with Esc from the sessions list, it is the level above that list instead, and Esc backs out as Esc on sessions does: to the pods picker, or nowhere with --endpoint |
e |
pipeline | edit pipeline subtree in $EDITOR |
y |
edit/diff | apply the edit |
n / Esc |
edit/diff | cancel the edit |
r |
edit/error | retry: re-open the editor (post-edit failure) or refetch (fetch failure) |
Esc |
edit/{fetching,editing,applying} | abort the edit, return to Pipeline pane |
Esc |
edit/{waiting,rollback} | background the watch; result lands as a footer flash |
q / Ctrl+C |
any | quit (closes the key-help overlay first, if open) |
A trackpad or wheel scroll is ↑ ↓, in whichever pane has focus, in a terminal that
turns a scroll over a full-screen program into arrow keys. Terminal.app does that only in
application cursor-key mode, so when TERM_PROGRAM=Apple_Terminal agentop sets the mode,
as vi does; without it the scroll moves Terminal.app's own scrollback instead. Elsewhere
the mode stays off, because it makes xterm-style terminals send Home and End in a form
agentop cannot read. agentop does not ask for mouse reporting, so click-and-drag
selection stays the terminal's and copying text out of a pane works as it does at a
shell prompt. The cost is that a scroll moves the focused pane, not the one under the
pointer.
Autowrap is off while agentop runs, in every terminal, and back on when it exits or
hands the terminal to $EDITOR. agentop fits every row to the width its rendering library
measures, and a terminal can draw some text wider than that — Devanagari with a vowel
sign, such as वि, measures one column to that library and two to others. With autowrap
on, such a row wrapped and scrolled the whole screen up a line, and text from the event
detail pane then stayed on the divider rows after leaving it (#1461). With it off, an
overwide row loses its last column instead. agentop also repaints the whole screen on
every pane change, which clears anything that still drifted.
The picker also opens itself at startup, once per connection, when two or more
agents have spent in the window or own a listed session, so a one-agent proxy goes
straight to the sessions pane and says nothing; A still opens it there. The
default bucket and unrecognised clients' sessions never count toward the two. When the
spending reply beats the first session list, that list gets one more look, and only
while the sessions pane is still showing. The cursor starts on All agents, so ↵
keeps every agent in view. Opened this way the picker is the level above the sessions
list: Esc on a list reached by picking an agent comes back to it, and Esc on the
picker backs out to the pods picker, or does nothing with --endpoint. Nothing is
remembered between runs: a second agent appearing is exactly when the picker
becomes worth showing, so a remembered dismissal would go stale then.
Agents the proxy does not recognise share one row, Other, listed last. The
proxy names an agent only from a User-Agent it recognises (claude-code, bob,
opencode, codex, pi); anything else is reported under its raw
User-Agent, and one program can send several — the IBM Bob IDE was three rows before
it was recognised, and none of them could reach its session (#1210). Picking Other
lists every session that names no recognised agent, including the default
bucket and sessions only agentop's cache still holds, so every listed
session belongs to exactly one row. An Other row that only sessions put there —
no unrecognised traffic in the window — is shown when the picker opens, but never
opens it by itself. Its figures are the pooled series, narrowed by agentop rather
than asked of the server, so the spend drawer reads BY NONE on every axis under
it. The raw User-Agents are still in the unscoped drawer's agent axis and in
agentop cost --by agent.
agentop cost --by project gives a row per project, costliest first. A project is
the git repo root of the agent process's cwd, and traffic that had no project is the row
unknown. On every --by axis the LABEL column widens to the longest label and cuts
nothing. --by together with --agent stays refused: use one or the other.
While a scope is active, two things on the usage pane change: [b] disappears
from the footer, because the scope needs group=agent on the wire and there is
no second axis left to break down by; and the latency metric plots that agent's
own response times, which agentop asks of the server with /v1/usage?agent= —
the group=agent series carries none, because a bucket's latency covers every
agent that shared it. The server keeps them only for a recognised agent across
all sessions, so under Other, within one session, or against a proxy too old
to keep them, the metric reports that latency is unavailable per agent rather
than plotting zeroes.
Elsewhere, the sessions pane lists only that agent's sessions and its pending:
buckets — the default bucket belongs to no one agent and is listed under Other — and every pane's title
says agent=. Against a server that names no session's agent, the list stays whole
and its footer says list not scoped. The spend band and its drawer show that
agent's figures, asked of the server with /v1/usage?agent=; against a server too
old to answer that, agentop narrows the group=agent series itself, as the usage pane
does. The drawer drops its agent axis and breaks the agent's spend down by model or
endpoint in every window. It reads BY NONE under Other, and against an older proxy
that cannot break the last hour down for one agent. Unscoped, the sessions pane gains an AGENT column when
two agents are listed, and the agents pane SESSIONS and LAST SEEN once sessions
name their agent. Those two describe the whole sessions list; COST <window> is the
pane's only windowed column, and w moves it.
↵ opens an agents row into its projects, and closes it. An open row shows All projects
(the agent's figures), one row per project, then Other. A project row shows the last
path segment, or the shortest unique tail of segments when two share it, for example
github.com/kagenti/kagenti-extensions and git/kagenti/kagenti-extensions. Other
holds traffic with no project (no PID, or an app started by macOS with cwd /) and the
overflow past 16 series. COST of the projects and Other adds up to All projects;
SESSIONS does not, because a session that used two projects counts under both. Spend
recorded before the upgrade has no project and is in Other: for the month window
that can be most of the spend for up to a month. Rows start closed and stay open across
the 20s refresh, w and A, not across a restart. On a sub-row, the spend band and
drawer follow that project.
↵ on a project sub-row scopes to that project. The project scope narrows the
sessions list to the sessions that recorded the project, and narrows the usage pane,
the spend band and its drawer to the project's figures. Every title then says
project=<display name>, beside agent= when an agent is scoped. agentop sends
project=<label>, the label that group=project reports, to the server (with agent= when an agent is scoped), and
uses the reply only when the reply echoes project. A proxy that does not echo
project (older than #2033) gets the old read: agentop asks for the group=project
series and narrows the reply itself. agentop never sends project=Other or
project=(other): those scopes also use the old read. Under a project scope, [b] is
inert on the usage pane and latency is not available per project. The drawer axes are
model and endpoint, and a cycles them; the project Other has no axes. The
drawer says no breakdown for this scope in <window> only when the reply has no
breakdown (an older proxy, or a window that the proxy cannot break down). The spend
band shows each unit, for example $12.00 + 0.95 Bobcoins, under a project scope
too. Within one session, the usage pane reads that session's projects without the
agent. Against a server that names no session's project, the sessions list stays whole
and its footer says list not scoped. esc keeps both scopes; All projects clears
the project scope, and All agents clears both. The project scope is not saved across
a restart.
Choosing an agent's server (S)
When this Cortex runs the inference-router,
the agents pane gains a SERVER column: the server each agent's new sessions go to,
or by key for an agent with no agents: entry: each of its sessions goes to the
server its key selects. All agents, Other and
unknown show nothing there — routing is chosen per agent, Other is every client
Cortex does not recognise, and unknown is requests that carry no User-Agent, which
belong to no one agent. A router under on_error: observe records what it would
route and routes nothing, so it gets no column.
S on an agent's row opens a picker over the pane, its cursor on what the agent has
now: Each terminal's key decides first, then each server with its host and its
main and helper words. The first row removes the agent's agents: entry. Under it, a
muted line counts the agent's sessions by the server each one goes to by its key: the
key_routes: target of its key's server (one hop only), else that server. For example
by key: 2 sessions → team-b, 1 → team-a. A running session stays on the server it
started on, so the line does not say where each session is now. When no session sent
the key of a configured server, the line reads no session sends a known key now.
When the agent has an agents: entry, there is no line: that entry wins over the key.
↵ applies the highlighted entry, as in every agentop picker; Esc, q or
Ctrl+C closes it; choosing what the config file already holds writes nothing — the
file decides, not where the cursor opened, since the route can change while the
picker is up. The change is
the one agentop server use or reset makes — the same file, the same checks — and
the footer shows [switching claude-code → glm…] until the proxy has reloaded, then
one line, which stays until the next key:
New claude-code sessions → glm. 3 running sessions stay where they are.
The count is of the agent's sessions this proxy holds in memory whose inference last
went somewhere other than the new choice (for a switch back to by key, to any
of the servers), and is left out when there are none. A switch moves none of them:
the router keeps a running session on the server it started on, across a proxy
restart too (see agentop server).
The sessions table's SERVER column shows where each one is, and S on a session's
row moves that one.
When the switch does not go through, a panel over the pane says so, whole, and where
it left the config file; Esc, q, Ctrl+C or ↵ closes it. A reload the proxy
refused is the proxy's error, with the file put back and the agent where it was; a
proxy that stopped answering before it reported the reload leaves the change
unconfirmed and the file put back; an error before the write changed nothing. A
failure that lands while another pane is up is the one line instead. A proxy that
reports neither a reload nor a refusal within 30 seconds is the line too: the file is
left as written, and it names the /reload/status to check. A choice the file
already holds writes nothing and says so — that it is already in force, or, when the
pane has not caught up with an agentop server use or a hand edit, that the file
holds it. A line wider than the terminal loses its beginning, not its end, and after
every outcome the pane rereads the proxy's pipeline, so the column shows what the
proxy runs.
S opens only on an agent's row, when agentop is attached to this machine's Cortex —
the one ~/.cortex/config.yaml names, its stats server answering when agentop
started — and that Cortex's router routes; [S] server is in the footer only there.
Elsewhere S opens a small panel saying why, which Esc, q, Ctrl+C or ↵
closes: on All agents or Other; on unknown, which the router refuses to route;
away from this machine's Cortex; before agentop has read that Cortex's pipeline; while
a switch is still in flight; under on_error: observe, in the words agentop server
uses; on a router config this agentop cannot decode, which takes an agentop as new as
the proxy; and with no router on /v1/pipeline, which is either none configured or
one under on_error: off — the proxy does not build an off plugin, so agentop
cannot tell the two apart, and the panel names both fixes. The pane lists only agents
it has seen, so an agent that has not run yet is routed with agentop server use <name> --agent <agent> instead.
Settings
agentop remembers the events-table column selection, the sort order, and the usage
pane's view in ~/.cortex/agentop-config.yaml. Columns and the sort are saved when the
column picker closes with Esc/Enter/c (q quits without saving). There is no
explicit save step.
A / search is not saved: it lasts until you clear it or leave the connection — except on
the namespaces and pods pickers and the key help, whose searches last until agentop exits. Older
agentops filtered with / and saved the filter as filter:; this one ignores that key
and drops it the next time it saves.
--prefs PATH reads and writes somewhere else. This is not the Cortex proxy
config — that is ~/.cortex/config.yaml, and --config on agentop service and
agentop configure claude-code.
# agentop user settings. Written by agentop; safe to hand-edit or delete.
# Columns not listed under events.columns keep their default — only deviations are recorded.
events:
columns:
- name: COST
visible: false
- name: TOKENS
visible: false
# Omit sortColumn (or name a column this build does not have) for arrival order.
sortColumn: DURATION
sortDesc: true
Schema
| Key | Type | Default | Meaning |
|---|---|---|---|
events.columns[].name |
string | required | column id, from the table below |
events.columns[].visible |
bool | required | show that column — an entry without it reads as false |
events.sortColumn |
string | unset | sort by this column; unset means arrival order. # is not sortable, being arrival order already |
events.sortDesc |
bool | false |
sort descending; ignored unless sortColumn names a sortable column |
usage.metric |
string | tokens |
usage-pane metric: tokens, requests, errors, latency or cost |
usage.window |
string | 10m0s |
usage-pane window: 10m0s, 1h0m0s or 6h0m0s |
timeline.window |
string | 5m |
timeline-pane window: 5m, 1h, 24h or all. A session shorter than it shows all |
usage.group |
string | none |
usage-pane breakdown. [b] cycles none, status, method, plugin, host; a hand-edited file may also use model, endpoint, session or agent |
theme |
string | auto |
palette: light, dark or auto. AGENTOP_THEME overrides it. auto reads COLORFGBG, then asks the terminal, and takes dark when the terminal does not answer |
zebra |
string | on |
the stripe on every second table row: on or off. AGENTOP_ZEBRA overrides it. When the terminal reports its background, the stripe is a faint shade of that background; when it does not (Windows, tmux, screen), the palette's near-black or near-white, which is a heavy band on a tinted background. Turn it off there |
List a column only to change it — the twelve are all visible until you hide one, and
an unrecognised name or sort column is ignored. Inside an entry, always write
visible: explicitly: it is optional to the parser but reads as false, so
- name: COST on its own hides COST rather than showing it.
The three usage.* keys are the view [m], [w] and [b] choose, saved as you
change them, so reopening the pane after a restart lands on the view you left. They
are stored by name rather than by position, and a name this build does not have —
a typo, or a value from a newer agentop — falls back to that field's default, so it
costs you the setting and never a broken pane. The four extra groupings above are
recognised, not defaulted: [b] does not cycle to them, but the pane renders them
and they survive a restart.
Column ids, in display order — the same headers the picker shows:
| Id | Shows |
|---|---|
# |
exchange number: one per request and its response — quote it as "#" in YAML, or it reads as a comment |
TIME |
wall-clock time the request was recorded |
DIR |
in = toward your agent, out = toward an upstream |
ACTION |
what took effect: deny, modify, observe, allow, or tunnel |
PLUGIN |
which plugin acted; blank when none did |
METHOD |
protocol operation: model name, MCP or A2A method |
STATUS |
HTTP status of the response: blank while it is on its way, lost when none came for 10 minutes |
DURATION |
how long the exchange took |
BYTES |
body bytes: ↑ request sent, ↓ response received; blank when the proxy counted nothing |
TOKENS |
prompt→output tokens, and what the context operators saved |
COST |
the exchange's estimated cost, and what the context operators saved |
HOST |
host the message was sent to |
A narrow terminal also hides columns to fit, with a → N more columns note in the
footer; that is not saved, and widening the window brings them back.
Each setting comes from this file, or the built-in default when the file does not set it. A missing file is normal and silent. An unreadable or malformed one is reported on stderr and ignored in full — never partially applied, and never fatal.
Nothing else feeds a setting: there is no environment variable (no AGENTOP_*, and
XDG_CONFIG_HOME is not consulted) and no flag for an individual setting. --prefs
chooses which file, never what is in it — so to try a layout without disturbing
your own, point it at a throwaway file. Otherwise change the setting in the TUI,
which saves it, or edit the YAML.
Where a session opens
Opening a session puts the cursor on the end you last jumped to with g or G:
the newest event by default, or the oldest if g was the last end you asked for.
Those two keys already mean "take me to an end", so they double as the preference
and it persists with your other view settings. An arrow key that happens to reach
row 0 does not change it — scrolling up to read is navigation, not a preference.
Only the opening chooses an end. Every later rebuild — the two-second poll, a search, a column toggle — leaves the cursor where you put it, and the timeline follows new events only while you are on the newest row. Under a column sort the preference does not apply at all: there "an end" is the largest or smallest value rather than the oldest or newest event, so the cursor stays pinned to the event you were reading instead.
Commands
Which harnesses are wired into Cortex (agentop configure status)
Each harness has its own agentop configure <harness> command. The guides for Bob,
OpenCode and Pi are listed in Per-agent configure.
To see all of them at once — without running five agentop configure <harness> status
commands and comparing five different output shapes — run it with no harness name:
$ agentop configure status
HARNESS STATUS DETAIL
claude-code enabled ~/.claude/settings.json
bob uncertain editor: ~/Library/.../IBM Bob/User does not exist, so IBM Bob has not run here; shell: CORTEX_BOBSHELL is unset in this shell
opencode uncertain opencode not found on PATH or in ~/.opencode/bin
codex not enabled no Cortex values in ~/.codex/.env
pi not enabled extension: missing; shell: no pi function in ~/.zshrc
For the detail on one of them: agentop configure <harness> status
Four verdicts, not two, because a boolean would be a lie for several of these:
| STATUS | Means |
|---|---|
enabled |
Fully routed through Cortex, by that harness's own definition of fully. |
not enabled |
agentop looked and the harness is not routed — a place to look, and nothing in it. |
partly enabled |
Some of it is in place: N of M keys set, or a value pointing at a loopback proxy that is not this machine's Cortex. enable has something left to do. |
uncertain |
agentop could not establish an answer — a file it cannot read or parse, a key defined twice, or no configuration to read at all (bob with no settings directory, opencode with no binary). |
The distinction that matters is uncertain against not enabled: the first is "I
could not tell", the second is a finding. The table takes no flags — the per-harness
overrides (--settings, --env, --config, --opencode) do not compose into one
flag set, and anyone who needs a non-default path wants one harness's status, which
already takes it. Exit status is 0 whatever the rows say.
Running one command through Cortex (agentop exec)
agentop exec -- <command> scopes Cortex routing to a single child process:
the nine proxy/CA variables in its environment, nothing written anywhere.
agentop exec -- curl -sv https://api.anthropic.com/v1/messages
agentop exec -- claude --dangerously-skip-permissions
agentop exec --print # the nine variables as export lines, runs nothing
It exits with the child's status, relays signals aimed at agentop to the child,
and requires an enabled TLS bridge. The full contract — which variable gets
which CA file and why, --print's rules, what happens before Cortex's first
start — is in any-agent.md.
Choosing an inference server (agentop server)
With several inference servers — LiteLLM gateways or local model servers — each
with its own URL and key, agentop server
chooses which one an agent's new sessions use, through the
inference-router plugin. A
session stays on the server it started on, including one already running when its
agent is first routed, until you move it with agentop server move or S on the
sessions pane. Routing is opt-in per agent: until an agent is given
a server, its traffic goes where the agent sends it. Once it is given one, its
inference goes to that server wherever the agent addressed it — Anthropic,
OpenCode Zen, Bob's gateway, or another server — so the agent needs no setting of
its own beyond going through Cortex.
agentop server add ete https://ete-litellm.example.com --main opus --helper haiku # asks for the key; it does not echo
agentop server add glm https://glm-litellm.example.com --main glm --helper nemotron
agentop server use glm --agent opencode # new opencode sessions → glm
agentop server use ete --key-of glm # new sessions that send glm's key → ete
agentop server reset --key-of glm # glm's key goes to glm again
agentop server move <session-id> glm # move one running session → glm
agentop server # the servers, their models, their agents
agentop server rename ete litellm-external # a new name; its agents and running sessions follow
agentop server reset --agent opencode # stop routing opencode
agentop server remove glm # refused while an agent uses it; the last takes the router out
A request that sends the key of a configured server goes to that server.
use <name> --key-of <server> writes key_routes.<server>: <name> in the
router's config, so new sessions that send <server>'s key go to <name>.
key_routes: is one hop only. An agent's server, from use --agent, wins over
it. reset --key-of <server>, or use <server> --key-of <server>, removes the
entry. A session already running stays where it is. agentop never shows a key; it
names a key by the name of its server. See
key_routes.
In the TUI, S on the agents pane does what use and reset do, for an agent
the pane lists; see Choosing an agent's server.
On the sessions pane, S moves the highlighted session to a server (or to its own
provider, its own choice (not routed)). The picker shows a muted line with the cost:
the session's context is re-sent uncached on its first turn at the new server. It asks
for no confirmation.
When the session sent the key of a configured server, ↵ on a server opens a second
step, Move to: <server>, with two rows:
- This session only moves the session, as the one-step picker does. The cursor
starts here, so
↵ ↵does what↵does with one step. - This session and new sessions that send 's key also writes
key_routes.<key's server>: <target>, in the same write. When the target is the key's server, it removes that entry. It moves no other running session. Its note, on the line under the row, says how many other running sessions that sent the key are not on the target and stay where they are, for example(1 other running session with this key stays where it is). When the agent has anagents:entry, the note says instead that the agent ignoreskey_routes:, for example(claude-code ignores this: the Agents pane sends it to ete).
Esc or q goes back to the server list; Ctrl+C closes the picker and writes
nothing. The flash after the second row adds what it changed, for example
New sessions that send team-b's key → team-a. With no key of a configured server,
and on the its own choice row, the picker has one step. A server move from the shell also
prunes the config's sessions: entries for sessions that are neither live nor
archived; the TUI's move does not.
The listing after use reads:
ete ete-litellm.example.com main opus → aws/claude-opus-5-5 · helper haiku → aws/claude-haiku-4-5
glm glm-litellm.example.com main glm → rits/zai-org/glm-5-3 · helper nemotron → rits/nvidia/nemotron-3 opencode
A server whose key is routed to another server shows its key → <server> in its
agents cell: for example its key → ete on the row of glm after
agentop server use ete --key-of glm.
Models. A routed request goes with the model the agent asked for, so an agent
keeps choosing its own models wherever the server serves them. Only when the
server refuses the name is the
request sent again, once and before the agent sees the refusal, with one of the
server's own models: the one --main names for a request with tools, the agent's
main work, and the one --helper names for a request without, such as a title.
Each is a word, not a full name: the newest model on the server's list whose name
contains it, so a newer model the server adds is used without an edit. The
refusal is believed for an hour, and a session keeps the model it was given.
-
add <name> <url> --main <word> --helper <word>reads the key at a prompt that does not echo, or from stdin with--key-stdin, which is refused when stdin is a terminal, where the key would echo as typed. It is never an argument, so it never reaches shell history. It then reads the server's model list with that key and refuses a word that names none of its models, listing them, so a wrong URL or key is caught here; it prints what each word names now. A name that exists is replaced only after a yes (--yesskips the question), which is how a key is rotated; with no terminal to ask on, nothing is written. Two servers can have one URL, for example two teams' keys for one gateway. agentop names a session's server from the server name that the proxy records for the session. A proxy older than this change does not record that name. For such a proxy, agentop names the server from the host, so with two servers on one host it shows the first name in alphabetical order. The firstaddcreates the plugin's entry, last in the outbound pipeline. A key or a word containing$is refused: the config loader would read it as an environment variable.--api <protocol>=<path>(repeatable) names a protocol the server serves and the path it serves it at:anthropic-messages,chat-completionsorresponses. A second--apifor one protocol replaces the first.--apiskips the probe (see below).--auth-header <name>names the header that carries the key:authorizationsendsBearer <key>, any other name sends the raw key. A given header is fixed: the model list and the probe do not try the other header.--header <name>=<value>(repeatable) sets a fixed header on every request to the server. A value with$is refused, as a key is: writeheaders: {<name>: ${NAME}}by hand. The key headers and the hop-by-hop headers are refused.
agentop servershows these under the server: itsapi, its auth header, and the header names, never their values.The URL can have a path, such as
https://h.example.com/inference. The router puts this prefix before each path it builds (seeurl). The model list is read from/v1/models, or from LiteLLM's/v1/model/infowhen/v1/modelsgives 403 or 404, after the prefix.The probe. With no
--api,addfinds which protocols the server serves. It sends one small request for each candidate path, with the main model, the textping, andmax_tokens: 1foranthropic-messages, no output limit forchat-completions, andmax_output_tokens: 16forresponses:Protocol Candidate paths, in order anthropic-messages/v1/messages,/messages,/anthropic/v1/messageschat-completions/v1/chat/completions,/chat/completionsresponses/v1/responses,/responses- A path is served only when the reply is 2xx and its body has the protocol's shape. A 200 with an error body is not served.
addwrites the first served path of each protocol toapi, and printsapi <protocol> → <path>.- On 401 or 403, the probe sends the request once more with the other auth
header (
authorizationorx-api-key), unless the header is fixed. addwritesauth_headeronly when a protocol needed a header that is not its usual one, and printsauth_header → <name>. The usual header isx-api-keyforanthropic-messagesandauthorizationfor the other two.- When no path serves,
addexits 1 and writes nothing. When every path gave the same reply, the message shows it: then the model or the key is wrong, not the path.
The probe runs only in
add: to probe again, runaddagain.A server that needs its own headers.
addhas no defaults for a vendor. It does not look at the host. When a gateway needs a given auth header or a fixed header, give it with--auth-headerand--header. Give them on the firstadd, because the model list and the probe send them too. Without them, the gateway can refuse each request. Thenaddstops at the model list:agentop server add: could not read bob's model list: the server answered 403, 403, 403, 403 to its model list. Check its URL and key.This message names the URL and the key, but a missing header gives it too. Before you change the key, look up which headers the gateway needs.
IBM Bob. Bob's gateway needs two settings:
Setting Flag Why auth_header: x-api-key--auth-header x-api-keyBob takes its API key as x-api-key. It refuses the key asAuthorization: Bearerwith 401invalid jwt string.User-Agent: bob-shell--header User-Agent=bob-shellBob's edge refuses a request whose User-Agent does not start with bob-shell. It sends back an HTML 403 page, not a Bob error. The model list request is refused too.Use a static Bob API key from Bob's settings. A Bob login token does not work: it is a JWT that expires after 12 hours.
agentop server add bob https://api.us-east.bob.ibm.com/inference \ --main premium-ide --helper fast \ --auth-header x-api-key --header User-Agent=bob-shell agentop server use bob --agent claude-codeWhen you give
--auth-header, the probe does not tryAuthorization, andadddoes not print anauth_header →line. Nobody has run the probe on a live Bob gateway. It is expected to findchat-completionsat/v1/chat/completions. The expected entry is in the router's doc. -
use <name> --agent <agent>routes the agent's new sessions to the server, including an agent that has not run yet.reset --agent <agent>stops routing it. Either way a session already running stays where it is: its pin holds it, kept in~/.cortex/plugin-state.jsonso a proxy restart forgets none.use <name> --key-of <server>routes the new sessions that send the key of<server>to<name>.reset --key-of <server>removes that entry.--agentand--key-ofare exclusive, and each name must be a configured server.move <session-id> <name>moves one running session;ownsends it back to its agent's own provider. -
remove <name>refuses while an agent is routed to the server, or asessions:entry moved a session to it, and names the commands that take them off it. It also refuses while akey_routes:entry names the server on either side, and names the entry andagentop server reset --key-of <server>. A session that started on a removed server gets a 503 asking for a new session until the server is added back or the session is moved. So when sessions the proxy is running last sent their inference to the server,removewarns how many before it goes ahead. It leaves out the default andpending:buckets, which the router never pins. -
Removing the last server takes the router's entry out with it, since the router needs a server:
addthenremoveleaves the config as it was. With no router, nothing holds a running session where it was, so the sessions the proxy is running that last sent their inference there go where their agent sends them from their next request, partway through their conversation, rather than getting the 503. When there are any, or the proxy's sessions cannot be read,removesays so and asks first (--yesskips the question). Their pins stay in the plugin store for 30 days, so adding the server back takes them back to it. The router'ssessions:entries go with its entry,move … ownones included, so a session moved off the server that has sent nothing since goes back to it too. If the router's entry changes whileremovewaits, it writes nothing and says to run it again. -
rename <name> <new-name>gives a server a new name in one write: the server's key in the file is renamed in place, so its URL, key (a${NAME}reference included), models, comments and place in the file stay as they were, and everyagents:,sessions:andkey_routes:entry naming it is rewritten to the new name. It refuses a name another server has (remove that one first) andown, and with the old name again changes nothing. -
Running sessions move with a rename. The router pins a running session to its server by name and cannot rename its pins, so
renamewrites, in the same write, thesessions:entryserver movewould for each running session the router routed to the old name, and says how many. The entry beats the pin, and the pin follows it on the session's next request. Like any move, that request drops the session's earlier reasoning blocks, and may miss the server's cache. A session whosesessions:entry named the old name follows by that entry's rewrite, whether or not the proxy holds it. A session the proxy no longer holds in memory, idle or not resumed since a restart, is not seen: with no entry, if it is resumed it gets the removed server's 503, andagentop server move <session-id> <new-name>moves it. A session that only sent to the server's host, with no server recorded, gets no entry: the router did not route it, and an entry would. The entries stay in the file; a shellserver moveprunes those whose session is gone. If the router's entry changes whilerenameruns, it writes nothing and says to run it again. -
agentop serverlists each server's host (its whole URL when it is plainhttp), what its main and helper words name on its list now, read with its own key, the agents routed to it and, for a server whose key is routed to another server,its key → <server>. A server whose list cannot be read shows its words and why. When the router's entry hason_error: observe, which records what it would route and routes nothing, oron_error: off, which stops it running, the listing says so first, anduseandaddsay so too.
The router routes only requests it can read: a plain http request sent through
the proxy, or an https one the TLS bridge decrypts, which needs the bridge on
and the port the agent connects to in tls_bridge.ports, 443 and 8443 unless set.
An agent whose provider is https on another port, such as :4000, reaches the
proxy as an opaque CONNECT tunnel and is never routed.
Every change is written to ~/.cortex/config.yaml, keeping its comments except
those on the lines the change replaces or removes, every line of a removed block
among them, and returns once the proxy has reloaded it; nothing restarts. If the
proxy refuses the reload, the command puts the file back as it was, prints the
proxy's error and exits 1, and the proxy keeps the configuration it had. If the
proxy stops answering before it reports the reload, the command puts the file back
the same way, says the proxy stopped answering, and exits 1. A file someone edited
while the proxy was reloading is not put back but left as found, with an error
saying so. If the proxy reports neither a reload nor a refusal within 30 seconds,
the command exits 1 and leaves the file as written. With no proxy running the file is still written, and the change applies at
the next start. Nothing is written unless the result loads as a Cortex config and
passes the router's own rules; what only the running proxy can check, such as
whether its build includes the router, is what a refused reload reports. A change
that changes nothing writes nothing. --config PATH points every form at another
config, with the stats address read from it: that is how to try this against a
second Cortex without touching the one every session uses. Flags go after the
action. Exit codes: 0 done, or nothing to do; 1 refused or failed; 2 a usage error,
a malformed name, agent or URL included; 3 a replacement, or the router's
removal with the last server, declined.
Local model servers
Ollama, vLLM and llama.cpp's llama-server are added like any other server. None
of them checks the key unless started with one, but add needs one, so give any word.
Setting the server itself up — installing it, picking a model, the context
length — is walked in Local model with
Ollama. An agent keeps asking for its own
model names, which a local server does not have;
the server's refusal is answered with the --main or --helper model, as a
LiteLLM refusal is:
echo ollama | agentop server add ollama http://localhost:11434 \
--main granite4.2:8b --helper granite4.2:8b --key-stdin
agentop server use ollama --agent bob
The refusals recognised are Ollama 0.40.4's and 0.7.0's, vLLM 0.31.0's and
llama.cpp b11429's serving several models (--models-dir); the two Ollama
versions word theirs differently, and both readings are matched. llama.cpp serving
one model (-m) and LM Studio with a model loaded answer any name with that model,
so their --main and
--helper never come into play; LM Studio with nothing loaded refuses in words the
router does not read. A prompt larger than the server's window is trimmed by Ollama
rather than refused, so set its context length above the agent's prompts: Claude
Code's opening turn can pass 64k tokens, Bob's reach about 21k. On a Mac with
less than 64 GB, see Choose a model.
Importing agent history (agentop import)
agentop import reads the transcripts that an agent keeps on disk, and adds
them to Cortex's session history and cost ledger. Use it for the sessions that
ran before you installed Cortex, or that did not go through it.
agentop import # every supported agent
agentop import --agent claude-code --since 30d
agentop import --agent bob # Bob's tasks, from ~/.bob/db/bob.db
agentop import --agent codex # Codex's rollouts, from ~/.codex/sessions
agentop import --agent opencode # OpenCode, from ~/.local/share/opencode/opencode.db
agentop import --agent pi # Pi's sessions, from ~/.pi/agent/sessions
agentop import --since 2026-10-01 --dry-run # count only, write nothing
| Flag | Meaning |
|---|---|
--agent |
claude-code, bob, codex, opencode or pi. bob and opencode need the sqlite3 program on PATH |
--since |
skip a transcript file last changed before this time: YYYY-MM-DD (local midnight) or <N>d (N days ago) |
--dry-run |
count what an import would do, and write nothing |
--endpoint |
the session API, as for agentop cost |
The proxy does the work in
POST /v1/import.
agentop does not open the archive or the ledger. The route exists only on a
local install: the archive is on and the session API is loopback-only.
Otherwise agentop says that the proxy has no import route, and exits 1. Only one
import runs at a time. A second one prints agentop import: an import is already running and exits 1.
On a terminal, agentop shows a progress bar on stderr while the proxy works:
importing claude-code [█████████░░░░░░░░░░░] 45% 837/1851 sessions
The bar counts sessions, skipped sessions too. Skipped sessions are fast, so the bar moves fast at first. With an older proxy, agentop shows a spinner.
The output is one line for each agent:
claude-code: 12 imported, 3 replaced, 40 skipped (live), 7 skipped (current), 1 skipped (expired), 2 lines not recognized
--dry-run puts dry run: before each line. A stopped: line follows when the
archive got full, and an error: line when the agent failed. The exit status is
1 when an agent has an error.
What it does not change. A session that Cortex captured live is skipped, and
the import never changes it. An imported copy that is as new as its transcript
is skipped. A newer transcript replaces the imported copy, and only its new
turns are counted as cost. A session that you erased with x comes back
as an imported session while its transcript is still on disk. Its cost is not
counted again, because the erase kept the ledger rows.
An imported session has (*) before its title in the sessions pane. When the
terminal is too narrow for TITLE, (*) is before its id.
Its events show n/a for status, duration, bytes, host and plugin, because the
proxy did not see them. Tokens and cost show values. A Claude Code, Codex,
OpenCode or Pi turn is priced at today's rates. A Bob turn shows Bob's own cost.
Installing a bundled script plugin (agentop script)
Cortex ships some script plugins
inside agentop. agentop script installs one in a single step:
agentop script list every bundled plugin and its state
agentop script install <name> copy it and add its slot
agentop script remove <name> take both back out
installcopies the plugin's folder to~/.cortex/plugins/<name>/and adds ascriptslot for it to~/.cortex/config.yaml. It then waits for Cortex to load the slot and checks every script in it started. If one did not, it takes back what it added and says why.- Run again, it updates a copy from an earlier release and leaves a current
one alone. A copy you edited is refused:
removeit first. removerefuses a folder holding a fileinstalldid not write.list --jsonis for other programs, such as moca. Its fields arename,description,state,failClosed,scriptsand, with Cortex running,loadedandnotStarted.
--config PATH names another Cortex config, as for agentop server.
Finding unused tools (agentop tools scan)
agentop tools scan reads your agent transcripts and proposes the tools to stop
sending. Without --write, it prints the YAML block. With --write CONFIG, it
changes one line in CONFIG: the remove: list under
engine.components.toolfilter of the context-guru entry. When CONFIG has no
context-guru entry, it changes the remove: list of the tool-prune entry. A
second run with the same result changes nothing. Flags and details:
tool-prune-plugin.md.
What your agents have spent (agentop cost)
agentop cost prints what your agents spent in a window. With no flag, it prints
the total for today. The flags:
--window:today(the default, from local midnight),month(from the 1st),7d(the last seven days, rolling), or a duration such as1hor6h(from the in-memory ring).--by <axis>: one row for each label, costliest first. The axes are agent, project, model, endpoint, currency, session, status, plugin and host.--agent <name>: only this agent, spelled as the Agents pane shows it (for examplebob).--json: the totals as JSON.--endpoint <URL>: ask this proxy. The default is the Cortex on this machine.
The ledger windows (today, month and 7d) serve only the agent, project,
model, endpoint and currency axes. The other axes need a duration window.
today, month and 7d come from the cost ledger. The ledger is on for a local
install and off in Kubernetes. When it is off, the command prints the window that
the proxy holds, not the window that you asked for.
agentop cost --window month --by agent
agentop cost --by model
agentop cost --json
Pricing tells how Cortex calculates a cost.
The pipeline that runs (agentop pipeline get)
agentop pipeline get prints the active plugin pipeline as a table. The table
shows the inbound chain, then the application, then the outbound chain. This is
the same composition as the Pipeline pane (P).
DESCRIPTION is the last column. The table has no EVENTS column and no DEPS column.
--json prints the shape of /v1/pipeline, with requires and requiresAny.
--endpoint <URL> asks this proxy, as for agentop cost.
agentop pipeline get
agentop pipeline get --json
Use it to see the pipeline that runs. The config file alone does not show the defaults. To change the pipeline, see Editing the pipeline.
Editing the pipeline
Press e on the Pipeline pane to edit the runtime pipeline: subtree in
$EDITOR (or vi if unset). On save, agentop shows a diff and asks
apply this change? [y] apply [n] cancel. y writes the change back, then polls the
framework's /reload/status until the reload completes (success or failure).
Where it writes depends on what you are connected to, not on how agentop was started:
| Connected to | e writes |
Reload confirmed via |
|---|---|---|
| a pod, via the picker | kubectl apply --server-side against the per-agent ConfigMap, --field-manager=agentop --force-conflicts=true (taking ownership of data.config.yaml from the operator's webhook on first edit) |
the port-forward's :9093/reload/status |
| the Cortex on this machine | ~/.cortex/config.yaml directly — the file that proxy was started with and already watches |
that proxy's own stats address, stats.address in the same file |
The local path needs neither kubectl nor a ConfigMap: the proxy watches its config file with fsnotify, so writing the file is the apply. agentop writes a temporary sibling and renames it over the target, so the watcher only ever sees a complete file — a half-written one would book a reload failure against an edit you never made.
Local editing is offered whenever the endpoint on screen is this machine's
Cortex: a bare agentop that auto-connected to it, [l] from the picker, or an
explicit --endpoint aimed at its session API. Loopback spellings are
interchangeable, so --endpoint http://localhost:47601 and
http://127.0.0.1:47601 both match a config bound to either. A local Cortex
merely running is not enough — while you are looking at a pod, e edits the
pod.
If neither target applies, e says so and names the remedy instead of starting
an edit it cannot finish.
A symlinked ~/.cortex/config.yaml — pointing at a dotfiles repo, say — is
written through, not over. rename(2) replaces the link itself, so without
resolving it the live config would become a regular file while the tracked copy
silently kept the old pipeline, with nothing in git status to show it.
Resolving also keeps the temporary file a sibling of the real one, which the
atomicity guarantee needs: a rename across filesystems fails EXDEV.
That relies on the proxy watching the resolved file's directory, which the
reloader does — but the reloader ships in cortex, and that installs
separately from agentop. A proxy started before that change still has the old
single watch, so on Linux a symlinked config will not observe the write: the
poll times out and rolls the edit back. Run agentop service restart after
upgrading the proxy. agentop cannot detect the mismatch — nothing the proxy
exposes describes its watcher — so this is a note rather than a check.
A concurrent write aborts the apply. This file has other writers — agentop tools scan --write, the config migration agentop service install runs, a second
agentop session — and $EDITOR can be open for minutes. The apply re-reads the file
first and refuses
if it moved, rather than renaming a whole file built from stale bytes over
somebody else's change. The refusal names the likely culprits; re-open the edit
to work from the current file. This is a compare, not a lock, so a writer
landing in the last moment before the rename still wins — it closes the
realistic window, not every window. The cluster path has no equivalent check on
purpose: it applies with --force-conflicts=true and takes field-manager
ownership, which is what makes editing an operator-owned ConfigMap possible.
A config with no top-level pipeline: key is reported as such; inventing the
block is not the editor's job.
The single edit flow covers four operations:
- Edit a value — change a config field of an existing plugin
- Reorder — move a plugin's lines up or down
- Remove — delete a plugin's entry from
inbound:oroutbound: - Add — append a new plugin entry
All four work because they're all just lines you change inside the pipeline subtree.
e needs a target it can write. That means either a pod chosen through the
picker, or a connection to the Cortex on this machine — including via
--endpoint, as described above. Pointed at anything else (a hand-run
kubectl port-forward, a remote session API), neither is available: there is no
pod identity to resolve a ConfigMap from and no local config file to write, so
pressing e flashes a hint naming the remedy instead of opening an edit it
cannot finish.
Pre-apply validation
After save, agentop runs the same Requires/RequiresAny/RequiresLater
checks the framework runs at reload-time, against the cached
/v1/plugins catalog. Issues land as a red banner above the diff in ~50ms
instead of at hot-reload — which means after the kubelet sync (~60s) in a
cluster, or about a second later locally:
⚠ 1 validation issue — framework reload will reject:
• [outbound] ibac pos 1: Requires "mcp-parser", but it is not in the outbound chain
The prompt becomes "apply anyway? [y] apply [n] cancel" — agentop's check is non-blocking. The framework's own validateRelationships is the source of truth and will fire again at reload regardless.
Validation is silently skipped when the catalog isn't loaded. P loads
it each time it opens the Pipeline pane, so this happens only when that
fetch failed.
Agent-name resolution
Cluster path only — a local edit has no agent and skips all of this.
The per-agent ConfigMap is named authbridge-config-<agent>. agentop
resolves <agent> from the selected pod's app.kubernetes.io/name
label (operator sets this). If the label is absent, agentop
falls back to stripping the last two dash-separated segments of the
pod name (the ReplicaSet hash + pod suffix).
Auto-rollback on reload failure
If the write succeeds but the reload fails (unknown plugin name, malformed
config, validation error), the framework keeps the previous in-memory pipeline
serving requests — but the stored config now holds the bad YAML. agentop detects
this via /reload/status and re-applies the content captured at Fetch time,
reconciling the stored state back to what is actually running.
The error overlay names the target it reconciled:
reload failed: <reason>; rolled back to previous ConfigMap in the cluster, and
…rolled back to previous config file locally. If the rollback itself also
fails, the message says where to look — check kubectl for a pod, the config's
own path for a local edit.
The rollback is best-effort in both, for the same reason and by different
mechanisms. In the cluster, --force-conflicts=true means a third party
(controller, kubectl edit, kustomize) who modified the ConfigMap between Fetch
and the failed reload has their change overwritten. Locally the forward apply is
guarded by the staleness check described above, but the rollback deliberately is
not — it runs because the file changed, so checking would refuse every
rollback. The running pipeline is unaffected either way.
Backgrounding the watch
Pressing Esc while waiting for hot-reload (or during rollback)
moves the watch to the background instead of aborting it. The
overlay closes, the footer flashes
hot-reload watch moved to background; you'll be notified, and you
can resume navigating the TUI. When the watch terminates, the
result lands as a one-line flash:
hot-reload succeededhot-reload failed: <reason>; rolled back to previous ConfigMap— orprevious config filefor a local edithot-reload failed: <reason>; rollback failed: <err>(rare)
Flashes auto-dismiss after a few seconds; if you miss one, query
/reload/status directly — through the port-forward for a pod, or at the
stats.address in ~/.cortex/config.yaml for a local Cortex.
Permissions
agentop shells out to kubectl; kubectl uses your kubeconfig. Editing
requires update on configmaps in the agent's namespace (in
addition to get pods which the picker already needs). RBAC denial
surfaces verbatim in the overlay.
Tempfile lifecycle
agentop writes the editable pipeline subtree to $TMPDIR/agentop-pipeline-*.yaml
on every edit. The tempfile is left in place on every exit path
(success, error, abort) so an interrupted edit is recoverable. On
agentop launch, files older than 24h in this glob are swept
automatically — no manual cleanup needed.
Hot-reload window
The framework reloads via a config-file watcher, so how long the wait is depends on how the edit reaches that file. In a cluster, kubelet syncs ConfigMap edits into the pod's mount within ~60s and the framework then debounces and reloads — typically under 90s wall-clock from apply. Locally there is nothing to sync: the proxy is already watching the file agentop wrote, so a reload normally lands in about a second. The overlay says which of the two you are waiting on. agentop shows a spinner either way.
The poller terminates with one of:
- Success —
/reload/status.last_successadvances past the apply time. - Failure —
reloads_failedincrements past its baseline; the framework'slast_erroris shown. agentop reads the baseline before it writes, so a refusal that lands before the first poll is still seen. When/reload/statusdoes not answer before the write, the first poll sets it. - Unreachable — 5 consecutive transport errors against
/reload/statussurface asreload status endpoint unreachableafter a few seconds rather than waiting the full deadline. The endpoint is the port-forward's:9093for a pod and the local proxy'sstats.addressotherwise, so the message asks the question that fits: a dropped port-forward or crashed framework in the cluster, or simply whether the local proxy is still running. - Timeout — none of the above within the target's deadline: 120s for a
ConfigMap, sized for the kubelet sync, and 30s for a local file, which lands
in about a second. Triggers an auto-rollback so the stored config doesn't
drift from the running pipeline. A ceiling, not a wait — the poll returns the
moment
last_successmoves, so this only bounds how long a failed reload takes to be declared.
The proxy's half of this rule is in proxy-contract.md.
That page also lists the ports, endpoints and command lines that agentop uses in a
local Cortex.
Plugin dependencies
Plugins declare dependencies in their Capabilities():
- Requires: hard dependency. The named plugin MUST be in the same chain at a strictly-lower position; otherwise framework reload fails.
- RequiresAny: soft OR. At least one of the listed plugins must appear upstream; each one that IS present must be earlier.
- RequiresLater: the mirror of
Requiresfor response-phase output — the named plugin must appear at a strictly-higher position, because the response pass walks the chain in reverse.
agentop surfaces these in three places:
- Pipeline pane DEPS column: ✓ when all declared deps satisfied, ✗ when any fail, blank when no deps declared. The footer hint reports the count of plugins with unmet deps.
- Plugin detail pane: per-dependency rows with ✓/✗ and the satisfying upstream's position when applicable.
- Pre-apply validation in the editor: catches missing/misordered Requires before the write goes out (~50ms, against a framework roundtrip of ~60s in a cluster or ~1s locally). See the "Pre-apply validation" subsection above.
The framework's own validateRelationships is the source of truth and runs at every reload. agentop's checks are the fast-feedback layer.
Per-agent configure
agentop configure bob: docs/agents/bob.mdagentop configure opencode: docs/agents/opencode.mdagentop configure pi: docs/agents/pi.md
Trust model
agentop does no authentication — same as the server. Use only against
sidecars reachable via in-cluster networking or a local port-forward.
Session events contain raw user messages, LLM completions, and tool
results; treat the output accordingly.
Internals
How a timeline is fetched
The events table renders no message body, so it does not ask for one. Each fetch
sends ?view=summary, which drops the conversation payloads and keeps everything
the table shows — measured at ~163x smaller, and the
difference between a session that opens in milliseconds and one that takes seconds.
The summary keeps completion and A2A message text, which the table does not show,
because the details search reads them: agentop checks the summary rows it holds,
and the proxy checks only what the summary drops (GET /v1/sessions/{id}/search).
So the search fetches no event. Dropping those fields as well would be ~299x instead
of ~163x, and the proxy would then have to check them too.
The consequence is worth knowing: the first ↵ on a row fetches each half of the
exchange whose bodies are not loaded yet, in full, from
/v1/sessions/{id}/events/{seq}. The detail pane renders the summary
immediately and the bodies appear when they arrive, so there is no loading screen —
but on a slow link the message text lands a moment after the rest. Re-opening the
same row is free; the bodies are kept. If the fetch fails, the pane keeps what it
has and the error goes to the footer.
y yanks the half the cursor is in. While that half's bodies are still in flight —
or after a failed fetch — it says so in the flash rather than handing you a
body-less event that looks complete.
Because a projected event is ~1KB rather than ~200KB, agentop asks for the server's
full 2000-event ceiling instead of the old 500. A normal session therefore arrives
whole, and the ▲ press Enter to load N older events row appears only for genuinely long ones.
Against a proxy that predates ?view=summary this still works — that server
ignores the parameter and returns full events, so the timeline is correct and as
slow as it used to be.
The exact request and response. On a laptop install the session archive keeps
each request exactly as it crossed the proxy, and each response as the origin sent
it. The detail pane fetches that capture too, and shows it under a closed raw
section: ↵ on it opens it. In it:
requestis the body the agent sent, with thinking blocks where the model wrote them, and each image or document as[image image/png 34.1kB].forwardedsays whether a plugin rewrote the body, andforwardedBodyis what went upstream when one did.queryis the request's.- In the RESPONSE section,
responsehas the status, the body (a compressed one as[gzip body 12.0kB]) andtruncatedorincompletewhen either applies.
The captured headers are in a closed headers node beside raw, not in it, so ↵
opens them without the bodies. A request's headers are without credentials. A search
opens headers when it matches there.
Each section has its own raw. Its capture comes with the fetch of that half, and
agentop keeps it. A section has no raw when the archive has no capture for its
half: an older proxy, an event written before capture, or one recorded in the last
second. A search does not open
raw, because it repeats the whole conversation; open it with ↵ to search inside
it. A row opened from a details search that matches only in a capture opens with
that half's raw open. A row opened from a details search shows its first match, also
when the match arrives with the fetch. y writes the half without its capture.
Architecture
apiclient/— HTTP + SSE client. Sole owner of the:9094wire format. Auto-reconnects with exponential backoff (1s → 30s, capped, indefinite).tui/— Bubble Tea model/update/view. All state mutation runs on the Tea event loop; the SSE goroutine produces messages the loop consumes.main.go— flag parsing, signal handling, wirestui.Run.
How CTX is derived
CTX(1M) is a gauge, not a figure: how full the conversation's
context was on its latest turn, against a fixed one-million-token window. The
fill is followed by a shaded ░ track for the rest of the window (███▌░░░),
so the scale shows on every row and a nearly-empty session reads as
empty-out-of-something rather than as a blank cell — and an em dash, which
means no context known, stays distinguishable from the sliver a barely-used
session gets.
A session is three kinds of caller, not one conversation. Claude Code sends your conversation, the subagents it spawns, and its own one-shot completions — title generation, the permission security monitor, the auto-mode classifier — under one session id. Two facts sort them out, and the gauge needs both:
| tool manifest | agentRole |
|
|---|---|---|
| your conversation | present | main |
| a subagent | present | subagent |
| a one-shot | absent | main |
The manifest excludes the one-shots. Measured across 115 responses in three
live sessions they carry no tools and 2–3 messages, while every conversation
turn carried 27–31 tools and 63–1572 messages. They are not small, which is
why size is not the filter: one measured 295k and another 421,220 against a
true context of 998,334. And they declare themselves main, because the CLI
issues them rather than a subagent.
The role excludes the subagents, which Claude Code states on every request. The message count only approximated it — subagent turns reached 177 and 186 messages against main threads at 188 and 288 — and it cannot see a compaction, which restarts your conversation at a low count while leaving the role alone.
Among what is left, the latest turn wins. There is deliberately no recency window: your conversation goes silent while a subagent runs, and that silence is structural, so a last-N-requests window can fill with the subagent's traffic and hand the gauge to it. Both filters are exact, so none of that traffic is a candidate in the first place.
Three things worth knowing. The denominator is fixed at 1M, the largest window on any path the proxy sees, so a model with a smaller window reads lower than it really is.
The figure comes from agentop's own event cache, filled by the live stream or
by drilling into a session. The timeline fetch asks for view=summary, and
that projection drops the slices this rule used to read, so it records their
lengths before dropping them (messageCount / toolCount) and the gauge
reads either shape. Without that a delivered row could not be read at all, and
an idle session showed a dash however long you looked at it. agentRole needs
none of that: it is a scalar the projection copies as-is.
Against a proxy older than those fields, an idle row still shows the dash until traffic arrives or you open one of its events — the one request that returns an event in full. Once a figure is established it is kept, so a projection that says nothing cannot erase it.
Against a proxy that publishes no agentRole, the gauge falls back to the
old rule — tool-carrying requests, the one with the most messages — and pays
what that costs. After a compaction it can stay on the pre-compaction context
for the rest of the session, because the older, longer request still holds the
most messages: measured at 999,623 against a true 400,249, a bar at 98.6% for
a session with 600k of headroom. A stale figure is still preferred to one that
flips to a subagent's. With the role published there is nothing to wait for —
the column follows the compaction on the next turn.
The figure stays after the events that it came from. In a cluster, to clear a
figure that you do not trust, press Esc to go back to the Pods pane and enter
the pod again. A different pod is the only thing that discards the figure.
Re-attaching starts the column from the next event that streams. This reset is
for the cluster picker only. On a laptop and under --endpoint, there is no
Pods pane, so restart agentop.
Documentation
¶
Overview ¶
Command agentop is a shim. It execs `cortex "$@"` and nothing else.
The commands themselves are in github.com/rossoctl/cortex/cmd/agentop/cli, which the cortex binary links: one binary, one version number, one thing to keep current. This file exists so that every `agentop …` already in a script, a doc, a service unit or someone's shell history keeps working unchanged.
It is a shim rather than a second copy of the commands on purpose. A copy would be a second binary again — the thing merging them removed — and a wrapper that re-implemented any part of the CLI would be a second place for the behaviour to drift. So this one resolves a cortex, hands it the argv, and gets out of the way: on Unix with syscall.Exec, so there is one PID throughout and the terminal, the signals and the shell's job all carry over untouched.
WHAT IT CANNOT CHECK: whether the cortex it found understands `agentop` at all. A cortex from before the merge has no such namespace — flag.Parse stops at the word and the proxy starts on its default config, so `agentop doctor` would start a Cortex instead of reporting on one. Detecting that from here would cost a probe process on every invocation, and the pre-merge binary cannot be taught to complain. What holds instead is that nothing installs the two halves apart: install.sh extracts both tarballs into one stage, `agentop setup` copies both to ~/.local/bin, and `agentop update` replaces both. A post-merge cortex handed a stray word warns (cmd/cortex/main.go); a hand-mixed pair is the one case with no signal.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package apiclient talks to AuthBridge's session events HTTP API at :9094 by default.
|
Package apiclient talks to AuthBridge's session events HTTP API at :9094 by default. |
|
Package checklist draws agentop setup's screen: a header, the consent list, one line per step that resolves to ✓, ·, ! or ✗, and the ending.
|
Package checklist draws agentop setup's screen: a header, the consent list, one line per step that resolves to ✓, ·, ! or ✗, and the ending. |
|
Package cli is agentop: the commands that inspect and run Cortex — a terminal UI over AuthBridge's in-memory session store, plus subcommands for running Cortex as a service, pointing Claude Code at it, and costing tool definitions.
|
Package cli is agentop: the commands that inspect and run Cortex — a terminal UI over AuthBridge's in-memory session store, plus subcommands for running Cortex as a service, pointing Claude Code at it, and costing tool definitions. |
|
Package cluster talks to a Kubernetes cluster on behalf of agentop's picker UI.
|
Package cluster talks to a Kubernetes cluster on behalf of agentop's picker UI. |
|
Package edit implements agentop's in-place pipeline editor.
|
Package edit implements agentop's in-place pipeline editor. |
|
internal
|
|
|
shimenv
Package shimenv holds what the agentop shim and the agentop commands have to agree about: the subcommand name that routes between them, and the two environment variables the shim uses to tell the commands how it was reached.
|
Package shimenv holds what the agentop shim and the agentop commands have to agree about: the subcommand name that routes between them, and the two environment variables the shim uses to tell the commands how it was reached. |
|
testhome
Package testhome keeps agentop's tests out of the real user profile.
|
Package testhome keeps agentop's tests out of the real user profile. |
|
Package money renders cost figures in the unit they are denominated in.
|
Package money renders cost figures in the unit they are denominated in. |
|
Package servers is what agentop's `server` subcommand and its TUI share about the inference-router: the entry's name, the check every write passes, how a server is shown, and which server a host belongs to.
|
Package servers is what agentop's `server` subcommand and its TUI share about the inference-router: the entry's name, the check every write passes, how a server is shown, and which server a host belongs to. |
|
Package toolscan derives a tool-prune candidate list from local Claude Code transcripts.
|
Package toolscan derives a tool-prune candidate list from local Claude Code transcripts. |
|
Package tui implements the agentop Bubble Tea interactive terminal UI.
|
Package tui implements the agentop Bubble Tea interactive terminal UI. |
|
find
Package find is agentop's text matcher: the one place that decides what a search query matches and where, for the table copy and the TUI alike.
|
Package find is agentop's text matcher: the one place that decides what a search query matches and where, for the table copy and the TUI alike. |
|
table
Package table provides a simple table component for Bubble Tea applications.
|
Package table provides a simple table component for Bubble Tea applications. |
|
Package updatestatus holds the type of ~/.cortex/update.json, the result of the last `agentop update --auto` run.
|
Package updatestatus holds the type of ~/.cortex/update.json, the result of the last `agentop update --auto` run. |