cui CLAUDE.md

cui CLAUDE.md is an instructions file for coding agents from wbopan/cui. It costs 700 tokens per session, scanned A, original, Apache-2.0.

Testing instructions for CUI services, including test organization, testing preferences, and a mock Claude command-line program. Tests check individual units as well as larger interactions between services.

In plain words
What is it for?
It helps structure unit and integration tests, use the bundled Claude CLI mock, keep test logs quiet, and test services with real implementations where appropriate.
Why use it?
It gives contributors a consistent way to test the system and avoid relying on inconsistent external Claude CLI behavior.

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/wbopan/cui/claude-md
Clone the repo
git clone --depth 1 https://github.com/wbopan/cui

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 cui CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/wbopan/cui/claude-md.svg)](https://agentmods.dev/instructions/wbopan/cui/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/wbopan/cui/claude-md"><img src="https://agentmods.dev/badge/instructions/wbopan/cui/claude-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 700 This file is loaded in full into every session.
When invoked 700 The same file — it is already loaded in full.
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.00700 $0.00700
Opus 5 $0.00350 $0.00350
Sonnet 5 $0.00140 $0.00140
Haiku 4.5 $0.00070 $0.00070

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

Security

Grade A, and why

cui CLAUDE.md 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.

CLAUDE.md · 98 lines

How it starts

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

Testing Architecture

This directory contains comprehensive test coverage for CUI services.

Testing Philosophy

  • Prefer real implementations over mocks when testing (per project guidelines)
  • Comprehensive unit test coverage for all services (90%+ target)
  • Mock Claude CLI using tests/__mocks__/claude script for consistent testing
  • Silent logging in tests (LOG_LEVEL=silent) to reduce noise

Test Structure

tests/
├── __mocks__
│   └── claude
├── integration
│   ├── conversation-status-integration.test.ts
│   ├── real-claude-integration.test.ts
│   └── streaming-integration.test.ts
├── setup.ts
├── unit
│   ├── cui-server.test.ts
│   ├── claude-history-reader.test.ts
│   ├── claude-process-long-running.test.ts
│   ├── claude-process-manager.test.ts
│   ├── cli
│   │   ├── get.test.ts
│   │   ├── list.test.ts
│   │   ├── serve.test.ts
│   │   ├── status-simple.test.ts
│   │   ├── status-working.test.ts
│   │   └── status.test.ts
│   ├── conversation-status-tracker.test.ts
│   ├── json-lines-parser.test.ts
│   └── stream-manager.test.ts
└── utils
    └── test-helpers.ts

Mock Claude CLI

The project includes a mock Claude CLI (tests/__mocks__/claude) that:

  • Simulates real Claude CLI behavior for testing
  • Outputs valid JSONL stream format
  • Supports various command line arguments
  • Enables testing without requiring actual Claude CLI installation

Testing Patterns

// Integration test pattern with mock Claude CLI
function getMockClaudeExecutablePath(): string {
  return path.join(process.cwd(), 'tests', '__mocks__', 'claude');
}

// Server setup with random port to avoid conflicts
const serverPort = 9000 + Math.floor(Math.random() * 1000);
const server = new CUIServer({ port: serverPort });

// Override ProcessManager with mock path
const mockClaudePath = getMockClaudeExecutablePath();
const { ClaudeProcessManager } = await import('@/services/claude-process-manager');
(server as any).processManager = new ClaudeProcessManager(mockClaudePath);

Read the full file on GitHub · 98 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. 4d ago First seen · 98 lines · 700 tokens per session scan A efebdb7cd0da

Subscribe to this mod's changes

cui CLAUDE.md is an instructions file published in the GitHub repository wbopan/cui (1,144 stars, last pushed 5mo ago), licensed Apache-2.0. It adds 700 tokens to every session, about $0.0035 per session on Opus 5. 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.