testagent: Instructions file for Claude Code

AGENTS.md

testagent AGENTS.md is an instructions file for Claude Code, Codex, OpenCode from paultyng/testagent. It costs 2,165 tokens per session, scanned A, original, MIT.

Project instructions for Testagent, a fake command-line coding agent that produces scripted terminal and protocol output without calling a language model.

In plain words
What is it for?
Use it to test tools that drive coding agents, including terminal sessions, hooks, MCP communication, command dispatch, and streamed output.
Why use it?
Deterministic output makes orchestration tests repeatable, so results do not change because of model responses.

Instructions file for Claude CodeCodexOpenCode

Written for Claude Code and Codex and OpenCode: UserPromptSubmit hook event, but also the file is AGENTS.md. Also seen: mentions Claude Code; mentions AGENTS.md; mentions Codex.

This is paultyng/testagent's own configuration. It tells Claude Code, Codex and OpenCode how to work on testagent 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 testagent configures →

Reuse

Borrowing it

Nothing to install: this file belongs to paultyng/testagent. 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/paultyng/testagent/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/paultyng/testagent

Made for: Claude Code, Codex, OpenCode.

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 testagent AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/paultyng/testagent/agents-md/github.svg)](https://agentmods.dev/instructions/paultyng/testagent/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/paultyng/testagent/agents-md"><img src="https://agentmods.dev/badge/instructions/paultyng/testagent/agents-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 testagent AGENTS.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/paultyng/testagent/agents-md"><img src="https://agentmods.dev/badge/instructions/paultyng/testagent/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 2,165 This file is loaded in full into every session.
When invoked 2,165 The same file — it is already loaded in full.
Security scan A 0 findings. 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.02165 $0.02165
Opus 5.5 $0.00866 $0.00866
Sonnet 5.5 $0.00433 $0.00433
Haiku 4.5 $0.00216 $0.00216

Measured 1mo ago against content hash 64a998e412fe, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

testagent AGENTS.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 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.

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.

AGENTS.md · 94 lines

How it starts

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

AGENTS.md

Context for AI agents working on this repo. (Cursor, Claude Code, and others read this file.)

What is testagent?

A fake CLI agent for testing orchestration tooling that drives real coding agents (Claude Code, Codex, Gemini, GitHub Copilot CLI, etc.). Runs as an interactive PTY process; emits the same kinds of terminal artifacts (boxed tool-use blocks, streaming text, in-place updates) and the same protocol traffic (HTTP hooks, MCP JSON-RPC) as a real agent — without calling any LLM.

The product framing is deterministic output for tests, not "no LLM" as a virtue. Wiring a local LLM into a test harness is a valid choice for some workflows; testagent is explicitly not that. Every assertion-relevant byte (slash dispatch, hook payloads, MCP frames, stream-json shapes) is scripted by the user, not generated, so tests stay stable across runs.

v1 ships a drop-in fake for Claude Code: argv compatibility for the flags orchestrators commonly emit, HTTP and command hooks (UserPromptSubmit / PreToolUse / PostToolUse / Stop / SessionStart / SessionEnd / PreCompact / PostCompact), an MCP HTTP client that handshakes and dispatches tools/call, --print --output-format stream-json for non-interactive callers, a slash-command grammar for driving UI primitives interactively (including /clear and /compact which fire the corresponding hook lifecycles without restarting the process), and lipgloss-rendered plausible-shape output.

Future phases

Phase What
3+ Vendor-neutral refactor; per-agent-type subcommands + packages (see Future conventions); adapters for codex, gemini, copilot, plus tier-2 (aider, amp, q, goose, crush); conformance tests against captured real-vendor traffic
release goreleaser cross-OS binaries (darwin/linux/windows × amd64/arm64) + signed releases

Design conventions

  • Schema types are duplicated, not imported. Settings and MCPConfig mirror Claude Code's on-disk shapes and live in cmd/claude/settings.go (vendor-specific, not shared with the engine).
  • Stdlib-first; deps are deliberate. Each non-stdlib dep is justified in the commit message that adds it (mark3labs/mcp-go, lipgloss, bubbletea, bubbles, go-isatty, spf13/cobra).
  • Interactive vs non-interactive split. TTY stdin → bubbletea TUI (internal/engine/tui.go, inline rendering with native terminal scrollback, concurrent input during the thinking spinner). Piped stdin → scanner loop (internal/engine/scanner.go, line-based, inline rendering). --print/-p is a third path (cmd/claude/print.go, one-shot output formatter). The mattn/go-isatty check on os.Stdin is the TUI/scanner gate; e2e tests pipe stdin so they always hit the scanner path.
  • Conventional Commits. One commit per phase. Each phase's commit leaves the tree buildable and tested.
  • Tests: t.Parallel(), table-driven, real httptest/exec-driven integration over mocks where possible (see e2e_test.go). Fixtures in testdata/. Time-dependent helpers (anything that calls time.Sleep / time.NewTimer / tea.Tick outside real network IO) use testing/synctest so virtual time advances without real wall-clock waits — see internal/engine/{spinner,stream}_test.go for the pattern.
  • Debug output goes to stderr. Verbose / debug logging (e.g. --verbose hook traces) is plain text, one event per line, never ANSI-styled — it gets grepped and piped. Stdout stays reserved for stream-json frames and TUI rendering.
  • COMPATIBILITY.md is the contract artifact. It is the per-vendor source of record for which flags, slash commands, and REPL behaviors testagent implements, accepts, or omits. Update it when adding vendor-facing features. Use the update-compatibility skill (one skill, dispatches by vendor — claude, codex, or cursor) to refresh a section after an upstream release or when drift is detected. Per-vendor source URLs, probing recipes, and matrix templates live under the skill's vendors/<name>/ subdirectories. Cursor adapter is in early-stage planning — the template is ready; vendor wiring lands in a future phase.
  • RELEASING.md is the release-policy doc (semver scope, bump table, runbooks). When cutting a release, drive it through the publish-release skill, which executes RELEASING.md step by step and gates on the two human decisions (version number, release-notes copy).

Read the full file on GitHub · 94 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 · 94 lines · 2,165 tokens per session scan A 64a998e412fe

Subscribe to this mod's changes

testagent AGENTS.md is an instructions file published in the GitHub repository paultyng/testagent (7 stars, last pushed 1mo ago), licensed MIT. It adds 2,165 tokens to every session, about $0.0087 per session on Opus 5.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-31.

Related

Other instructions, from other repositories

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 9,715 tokens

next.js AGENTS.md

AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,461 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, cache eligibility and rollout and applying the notice (cutover).

microsoft/vscode · 5,262 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,680 tokens

vscode copilot-instructions.md

Copilot instructions for microsoft/vscode, covering vs code copilot instructions, project overview, root folders, core architecture (src/ folder) and built-in extensions (extensions/ folder).

microsoft/vscode · 2,731 tokens

deepseek-harness AGENTS.md

AGENTS.md instructions for deepseek-ai/deepseek-harness, covering agents.md, pre-stable apis and released session data, repository layout, commands and host sandbox failures.

deepseek-ai/deepseek-harness · 4,261 tokens