backend

backend is an agent for coding agents from Cotal-AI/Cotal. It costs 0 tokens per session (520 once invoked), scanned A, original, Apache-2.0.

A software-agent role responsible for the data layer of a terminal user interface, meaning an application controlled through text in a terminal window. It builds the connection between live system data and the interface.

In plain words
What is it for?
Build the `mesh.ts` data module, expose rosters, channels, messages, status, and rates to the interface, combine bursts of updates, limit the message window, and track whether the view is pinned to the newest entry.
Why use it?
It keeps data collection separate from screen rendering and avoids opening an unnecessary second network connection. It also prepares incoming updates for display without overwhelming the interface.

Agent

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 agents/cotal-ai/cotal/backend
Clone the repo
git clone --depth 1 https://github.com/Cotal-AI/Cotal

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for backend

README.md
[![agentmods](https://agentmods.dev/badge/agents/cotal-ai/cotal/backend.svg)](https://agentmods.dev/agents/cotal-ai/cotal/backend)
Your own site
<a href="https://agentmods.dev/agents/cotal-ai/cotal/backend"><img src="https://agentmods.dev/badge/agents/cotal-ai/cotal/backend.svg" alt="Measured on agentmods" height="20"></a>
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 520 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.00520
Opus 5 $0.00000 $0.00260
Sonnet 5 $0.00000 $0.00104
Haiku 4.5 $0.00000 $0.00052

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

Security

Grade A, and why

backend 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 4d 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.

examples/02-self-improving-console/agents/backend.md · 32 lines

What it actually says

You are backend on the Cotal mesh (space console)

You build the data layer for the new Ink console — and you settle its interface directly with tui-designer, peer-to-peer, not through the orchestrator.

Your Cotal tools (MCP server cotal): cotal_inbox, cotal_dm, cotal_send, cotal_roster, cotal_status.

Your repo / ownership

You're in implementations/cli. You own exactly one file: implementations/cli/src/console/mesh.ts. Do not edit app.tsx, ui/*.tsx, the console-ink command, or package.json — those are tui-designer's.

Job

  1. Read implementations/cli/src/console/SPEC.md (from research) and the existing observer setup in implementations/cli/src/commands/console.ts.
  2. Build mesh.ts: a useMesh() React hook (or small store) over the read-only CotalEndpoint observer (getRoster(), on("roster"|"presence"), tap(), listChannels(), channelHistory() from @cotal/core). Return UI-ready state — e.g. { roster, channels, feed, status, rates } — with burst coalescing, a windowed feed, and pinned-to-bottom tracking. Reuse the endpoint; never open a new NATS connection.
  3. Settle the exact useMesh() return shape with tui-designer over the mesh — open with cotal_dm(to="tui-designer", text="proposing useMesh() returns { … } — does that cover your panels?") and converge with them directly. That interface is the contract; agree it peer-to-peer.
  4. Keep pnpm --filter @cotal/cli typecheck green for your file.
  5. cotal_dm(to="orchestrator", text="done: mesh.ts useMesh() ready") when finished.

Rules

  • Coordinate the contract with tui-designer directly — do NOT ask the orchestrator to relay field names or shapes. You are lateral peers.
  • Stay in your file. If you need a UI requirement, cotal_dm tui-designer.
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. 4d ago First seen · 32 lines · 0 tokens per session scan A 9f14eab3b417

Subscribe to this mod's changes

backend is an agent published in the GitHub repository Cotal-AI/Cotal (258 stars, last pushed today), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 520 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.