code-cli AGENTS.md

A project instruction file describing how the Autohand code tool should contribute to a TypeScript command-line application. It documents the repository layout, required React and Ink versions, package manager, build tool, tests, and agent runtime structure.

In plain words
What is it for?
Use it when developing or reviewing the Autohand CLI, especially work involving its Ink terminal interface, agent runtime layers, TypeScript code, Vitest tests, or tsup builds.
Why use it?
It gives coding agents project-specific rules and architecture context before they change code. This reduces the chance of incompatible versions, misplaced logic, or contributions that do not follow the repository's conventions.

Instructions file for CodexOpenCode

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/autohandai/code-cli/agents-md
Clone the repo
git clone --depth 1 https://github.com/autohandai/code-cli

Made for: Codex, OpenCode.

Per session 1,679 This file is loaded in full into every session.
When invoked 1,679 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.01679 $0.01679
Opus 5 $0.00839 $0.00839
Sonnet 5 $0.00336 $0.00336
Haiku 4.5 $0.00168 $0.00168

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

Security

Grade A, and why

code-cli 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 2d 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 · 277 lines

How it starts

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

AGENTS.md

This file helps Autohand understand how to work with this project.

You are a critical, staff-level software engineer writing production-grade TypeScript for CLI tools. Your work must be built with reliability, maintainability, and scale in mind.

1M users depend on this software. Code quality, test coverage, and runtime stability are mandatory.

We use Ink for TUI. Required version: >=7.0.0 React version: >=19 These versions must never be downgraded.

Ink docs: https://www.npmjs.com/package/ink https://github.com/vadimdemedes/ink/tree/master/examples


Project Overview

  • Language: TypeScript
  • Framework: React + Ink
  • Package Manager: bun
  • Test Framework: Vitest
  • Build Tool: tsup

Current Repository Architecture

src/core/agent runtime split (current)

The interactive runtime is now split across src/core/agent into focused layers:

  • src/core/agent.tsAutohandAgent public surface and top-level execution entrypoint.
  • src/core/agent/AgentLifecycleRunner.ts — run mode orchestration (interactive, command mode, initialization, cleanup, signal handling).
  • src/core/agent/InputTurnCoordinator.ts — input capture, queueing, ESC/Ctrl+C handling.
  • src/core/agent/AgentDependencyComposer.ts — dependency wiring (initializeAgentDependencies) and runtime host setup.
  • src/core/agent/AgentContextRuntime.ts — session bootstrap and context snapshot construction.
  • src/core/agent/SystemPromptBuilder.ts — system prompt assembly and prompt-shaping.
  • src/core/agent/ReactLoopRunner.ts — tool-call driven execution loop and response orchestration.
  • src/core/agent/InstructionRunner.ts — single-instruction orchestration and completion flow.
  • src/core/agent/AgentCommandRuntime.ts — slash command handling and execution.
  • src/core/agent/AgentProjectOperations.ts — project-level operations (diff/commit/bootstrap quality hooks).
  • src/core/agent/AgentUIRuntime.ts — composer/TTY/prompt UI state updates and status messaging.
  • src/core/agent/AgentSessionAccounting.ts + src/core/agent/AgentToolOutputRuntime.ts — tool accounting, logging, and output shaping.
  • src/core/agent/ProviderConfigManager.ts / WorkspaceFileCollector.ts / AgentProjectOperations.ts — feature-specific adapters and support services.

Read the full file on GitHub · 277 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. 2d ago First seen · 277 lines · 1,679 tokens per session scan A e560a112c40e

Subscribe to this mod's changes

code-cli AGENTS.md is an instructions file published in the GitHub repository autohandai/code-cli (181 stars, last pushed 5d ago), licensed Apache-2.0. It adds 1,679 tokens to every session, about $0.0084 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.