self-update

A command that updates the ctx command-line program from its GitHub releases, either to the newest release or to a specified version. It verifies the downloaded file before replacing the installed program.

In plain words
What is it for?
Use it to install the latest ctx release, pin ctx to an exact version, check whether an update is available, or request machine-readable output with JSON.
Why use it?
It removes the need to download and replace the program manually, while aborting safely if the file’s checksum does not match or no newer version exists.

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/agentis-tools/ctx/self-update
Clone the repo
git clone --depth 1 https://github.com/agentis-tools/ctx
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,482 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00000 $0.01482
Opus 5 $0.00000 $0.00741
Sonnet 5 $0.00000 $0.00296
Haiku 4.5 $0.00000 $0.00148

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

Security

Grade A, and why

self-update scanned grade A with 0 findings 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 2d ago.

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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

docs/commands/self-update.md · 125 lines

How it starts

The opening of the file, as written. The whole thing — 125 lines — stays where its author put it; the contents beside it link to each section on GitHub.

ctx self-update

Update the ctx binary from GitHub releases — explicitly, never automatically.

Synopsis

ctx self-update [--version <X.Y.Z>] [--json]
ctx --version --check

Description

ctx self-update queries the GitHub Releases API for agentis-tools/ctx, downloads the artifact for the current platform, verifies it, and atomically replaces the running executable:

  1. Fetch the latest release (or the release pinned with --version X.Y.Z).
  2. Pick the artifact matching this binary's compile-time target (ctx-v<version>-<target>.tar.gz, .zip on Windows).
  3. Download the release's aggregated SHA256SUMS file and the artifact, and verify the artifact's sha256 against it. On mismatch the update aborts with exit code 2 and the installed binary is untouched.
  4. Extract the ctx binary, write it to a temp file in the same directory as the current executable, set executable permissions, and rename it over the current binary (atomic on the same filesystem).

If nothing newer exists, it prints ctx <version> is already up to date and exits 0. On success it prints the transition:

ctx 0.2.1 → 0.3.0

--version X.Y.Z installs that exact release — including downgrades — instead of the latest.

Before any network work, ctx checks whether the executable belongs to a package manager and verifies that a direct-download install location is writable. Cargo, Homebrew, Arch, Debian, RPM, and Scoop installations are never overwritten: ctx exits 2 and prints the appropriate package-manager update command. Path detection covers Cargo, Homebrew, and Scoop layouts; on Linux, read-only queries to the local pacman, dpkg, and RPM package databases identify owned files.

Use ctx self-update only for direct GitHub binary installations. Upgrade managed installations with cargo install agentis-ctx, brew upgrade ctx, yay -Syu ctx-bin, scoop update ctx, or by installing a newer .deb/.rpm through the corresponding system package manager.

Read the full file on GitHub · 125 lines

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. 2d ago First seen · 125 lines · 0 tokens per session scan A c3222d27e47e

Subscribe to this mod's changes

self-update is a command published in the GitHub repository agentis-tools/ctx (11 stars, last pushed 15d ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 1,482 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.