cortex-login

A command that connects a machine to Cortex Cloud using browser-based OAuth device login. OAuth lets you approve access in a browser without typing the cloud password into the terminal.

In plain words
What is it for?
Use it to sign this machine into Cortex Cloud by opening an approval link, entering a short code, and waiting for authorization.
Why use it?
It avoids storing or entering a password in the terminal and saves the resulting device token locally with restricted file permissions.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/alphaaiservice/cortex/cortex-login
Clone the repo
git clone --depth 1 https://github.com/alphaaiservice/cortex
Per session 28 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 428 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00028 $0.00428
Opus 5 $0.00014 $0.00214
Sonnet 5 $0.00006 $0.00086
Haiku 4.5 $0.00003 $0.00043

Measured yesterday against content hash fd6f52345332, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade B, and why

cortex-login scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

`~/.cortex/credentials.json` with `chmod 600`.
commands/cortex-login.md · 39 lines

What it actually says

/cortex-login — Connect to Cortex Cloud

Logs this machine into Cortex Cloud using the OAuth 2.0 Device Authorization Grant (RFC 8628) — the same "open a URL, type a code" flow as gh auth login or aws sso. No password is ever typed in the terminal.

$ARGUMENTS (optional) overrides the Cortex Cloud base URL (default https://cloud.cortex.alphaai.com). You can also set CORTEX_CLOUD_URL.

What happens

  1. The plugin calls POST /auth/device and shows you a short user code and a verification URL (…/activate).
  2. You open that URL in your browser, sign in to the dashboard, and enter the code.
  3. The plugin polls POST /auth/token (honoring the server's interval and slow_down) until you approve, then writes the device token to ~/.cortex/credentials.json with chmod 600.

The raw token only ever lives on your disk — Cortex Cloud stores just its sha256 hash. Telemetry and premium features stay off until you connect; nothing here is required to use the plugin locally.

Run it

Execute the device-grant flow (this will print a code and wait for approval):

bash "${CLAUDE_PLUGIN_ROOT}/scripts/cortex-login.sh" $ARGUMENTS

When it prints the code, tell the user — clearly — to open the verification URL and enter the user code, then wait. On success report that the machine is connected; on timeout or an expired/denied code, tell them to run /cortex-login again. Use /cortex-status to check the connection later and /cortex-logout to disconnect.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 39 lines · 28 tokens per session scan B fd6f52345332

Subscribe to this mod's changes

cortex-login is a command published in the GitHub repository alphaaiservice/cortex (1 stars, last pushed 25d ago), licensed MIT. It adds 28 tokens to every session and 428 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it B with 1 finding (asks for root). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.