termly-cli: Instructions file for Claude Code

CLAUDE.md

termly-cli CLAUDE.md is an instructions file for Claude Code from termly-dev/termly-cli. It costs 3,437 tokens per session, scanned C, original, MIT.

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 for Claude Code

Written for Claude Code: the file is CLAUDE.md. Also seen: mentions CLAUDE.md; mentions Claude Code; mentions Codex.

This is termly-dev/termly-cli's own configuration. It tells Claude Code how to work on termly-cli itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything termly-cli configures →

Reuse

Borrowing it

Nothing to install: this file belongs to termly-dev/termly-cli. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/termly-dev/termly-cli/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/termly-dev/termly-cli

Made for: Claude Code.

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

README.md
[![agentmods](https://agentmods.dev/badge/instructions/termly-dev/termly-cli/claude-md/github.svg)](https://agentmods.dev/instructions/termly-dev/termly-cli/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/termly-dev/termly-cli/claude-md"><img src="https://agentmods.dev/badge/instructions/termly-dev/termly-cli/claude-md/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for termly-cli CLAUDE.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/termly-dev/termly-cli/claude-md"><img src="https://agentmods.dev/badge/instructions/termly-dev/termly-cli/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
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. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.03437 $0.03437
Opus 5.5 $0.01375 $0.01375
Sonnet 5.5 $0.00687 $0.00687
Haiku 4.5 $0.00344 $0.00344

Measured 1mo ago against content hash e8500bac1b4b, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 1mo 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.

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=local → ws://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. 1mo ago 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 (317 stars, last pushed 3mo ago), licensed MIT. It adds 3,437 tokens to every session, about $0.0137 per session on Opus 5.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.

Related

Other instructions, from other repositories