termly-cli CLAUDE.md

Repository guidance for Claude Code and other AI coding assistants working on Termly CLI, an NPM command-line tool that lets people use coding assistants from mobile devices. It explains the project's environments, remote terminal connections, encrypted data stream, and development commands.

In plain words
What is it for?
Use it when developing Termly CLI, its WebSocket connection to the server, mobile session handling, environment selection, or dependency setup. A WebSocket is a long-lived connection that lets both sides send updates while a session is running.
Why use it?
It gives agents the project context needed to change a tool that connects local terminal sessions to mobile devices. This reduces mistakes involving production, development, and local environments.

Instructions file

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 instructions/termly-dev/termly-cli/claude-md
Clone the repo
git clone --depth 1 https://github.com/termly-dev/termly-cli
Per session 3,437 This file is loaded in full into every session.
When invoked 3,437 The same file — it is already loaded in full.
Security scan C 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.03437 $0.03437
Opus 5 $0.01718 $0.01718
Sonnet 5 $0.00687 $0.00687
Haiku 4.5 $0.00344 $0.00344

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

Security

Grade C, and why

termly-cli CLAUDE.md scanned grade C 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.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

rm -rf ~/.termly
CLAUDE.md · 339 lines

How it starts

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

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Project Overview

Termly CLI is a universal NPM utility that enables remote terminal access to AI coding assistants (Claude Code, Aider, GitHub Copilot, Gemini, Grok, Cody, and 10+ more) from mobile devices. It works by:

  1. Spawning AI tools in a PTY (pseudo-terminal) on the developer's computer
  2. Streaming terminal I/O through WebSocket to a server with end-to-end encryption
  3. Supporting session resume with circular buffering and sequence numbers
  4. Managing multiple independent sessions simultaneously

Key constraint: Each CLI session supports exactly ONE mobile device connection.

Multi-Environment Architecture

The CLI supports three environments with hardcoded server URLs:

  • Production (@termly-dev/cli): termly command → wss://api.termly.dev
  • Development (@termly-dev/cli-dev): termly-dev command → wss://dev-api.termly.dev
  • Local: TERMLY_ENV=localws://localhost:3000

Environments are detected by:

  1. TERMLY_ENV=local environment variable (highest priority)
  2. Binary name (cli-dev.js = dev, cli.js = production)
  3. Default to production

Critical: Users CANNOT change server URLs. They are immutable per environment.

Development Commands

# Install dependencies
npm install

# Test production package
node bin/cli.js [command]
node bin/cli.js config  # Should show "Production" environment

# Test development package
node bin/cli-dev.js [command]
node bin/cli-dev.js config  # Should show "Development" environment

# Test local environment
TERMLY_ENV=local node bin/cli.js config  # Should show "Local Development"

# Link for global testing
npm link  # Creates 'termly' command

# Debug mode (enables verbose logging)
DEBUG=1 node bin/cli.js start --debug
node bin/cli.js start --debug

# View logs
tail -f ~/.termly/logs/cli.log

# Clean up test sessions
rm -rf ~/.termly

Publishing

Read the full file on GitHub · 339 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. yesterday First seen · 339 lines · 3,437 tokens per session scan C e8500bac1b4b

Subscribe to this mod's changes

termly-cli CLAUDE.md is an instructions file published in the GitHub repository termly-dev/termly-cli (298 stars, last pushed 1mo ago), licensed MIT. It adds 3,437 tokens to every session, about $0.0172 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.