Tianshu-harness: Instructions file for Claude Code

CLAUDE.md

Tianshu-harness CLAUDE.md is an instructions file for Claude Code from huiliyi37/Tianshu-harness. It costs 4,771 tokens per session, scanned A, original, Apache-2.0.

A project guide for Tianshu/Rivet, a terminal-based coding agent written in TypeScript. It documents the system’s structure, coding rules, build commands, tests, and known limits.

In plain words
What is it for?
Use it when changing the Rivet command-line tool, its desktop or editor integrations, its agent loop, or its tests and type checks.
Why use it?
It gives the agent and developers one place to check how the project is organised and how changes should be verified. This reduces guesswork when building, testing, or tracing runtime problems.

Instructions file for Claude Code

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

This is huiliyi37/Tianshu-harness's own configuration. It tells Claude Code how to work on Tianshu-harness 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 Tianshu-harness configures →

Reuse

Borrowing it

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

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 Tianshu-harness CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/huiliyi37/tianshu-harness/claude-md/github.svg)](https://agentmods.dev/instructions/huiliyi37/tianshu-harness/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/huiliyi37/tianshu-harness/claude-md"><img src="https://agentmods.dev/badge/instructions/huiliyi37/tianshu-harness/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 Tianshu-harness CLAUDE.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/huiliyi37/tianshu-harness/claude-md"><img src="https://agentmods.dev/badge/instructions/huiliyi37/tianshu-harness/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 4,771 This file is loaded in full into every session.
When invoked 4,771 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.04771 $0.04771
Opus 5 $0.02386 $0.02386
Sonnet 5 $0.00954 $0.00954
Haiku 4.5 $0.00477 $0.00477

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

Security

Grade A, and why

Tianshu-harness 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 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.

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 · 92 lines

How it starts

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

天枢 (Tianshu) / Rivet

Terminal coding agent optimized for DeepSeek V4 prefix cache. Node.js 24+ (engines pins 24.18.0) / TypeScript strict / 纯 ANSI 终端 UI(src/tui/engine/,零 React/Ink 渲染) / node:test。桌面端 desktop/(Tauri + React,闭源)与 VS Code/Cursor 插件 vscode-extension/(开源,随 sync 进公开仓)均经 src/server/ sidecar 驱动同一内核。CLI 命令仍为 rivet。插件打包/发布见 docs/VSCODE-EXTENSION-RELEASE.md

顶层索引与运行时排查:AGENTS.md。架构总览:docs/architecture-overview.md

Build & Test

npm install && npm run build
npm test          # ~1,133 test files / ~13,000 cases, node:test + node:assert/strict (runner: scripts/run-node-tests.ts,分批 spawn,末尾 tests 行只是最后一批)
npm run typecheck # 跨进程闸门:并发会话检查同一份源码时只跑一次,其余复用(秒回 = 命中缓存,不是没跑)
                  # 指纹 = git HEAD + 脏文件内容 hash;逃生口 typecheck:direct 或 RIVET_TYPECHECK_SHARE=0

Architecture

main.ts → AgentLoop (agent/loop.ts)
  ├── RuntimeHookPipeline (agent/runtime-hooks.ts)  ← TUI 2.x 核心
  │     纯分阶段执行器 + 错误隔离(任一 hook 抛错只走 onError,不中断 turn)
  │     5 阶段真实调用点(非概念,已钉在 loop 主路径):
  │       preTurn / afterPerception → turn-perception.ts
  │       postTool                  → tool-execution.ts(每个工具执行后)
  │       runCompaction             → turn-orchestrator.ts(postTool 后、postTurn 前)
  │       postTurn                  → turn-completion.ts
  │       postSession               → loop.ts(经 turn-orchestrator 调度)
  │     hooks 由 createDefaultRuntimeHooks() 条件装配(create-runtime-hooks.ts),
  │       60+ 模块(src/agent/hooks/),按 deps/开关 gated。默认会话实际激活 ~18+:
  │       常驻 8(base 数组无条件):perception, signal-consumer, kick,
  │               vigor×2(afterPerception+postTool), theta, stigmergy, radio
 │       advisoryBus 恒构造(loop.ts) → 这批默认全开:self-verify、edit-tool-advisory、
 │               lossy-observation、spec-verify-gate、typecheck-reminder、todo-reminder、
 │               security-pattern(写后正则查危险模式;config agent.securityGuidance=false
 │               或 RIVET_SECURITY_GUIDANCE=0 关)、
 │               context-pressure(需 token getter)、dedup-guard(需 streamedText getter)
  │       deps-gated(默认多为真):playbook-reflect、anchor-break-shadow、dream/skill-distill、
  │               meridian、telemetry-flush、physarum-file-access、memory-learning、courage/ccr(starSoul)
  │       默认关(opt-in):songline、constellation、hearth-observe、companion、
  │               dispatcher(自动委派)、anchor-break-scout、mcts-planning/blind-exploration(antiAnchoring)
  ├── AgentSession (messages, usage, turn count)
  ├── EvidenceTracker + FileHistory
  ├── Stores: claim-store, stigmergy-store, playbook-store, trace-store
  └── Tool dispatch → API (SSE streaming) → TUI (纯 ANSI, src/tui/engine/) / Desktop (server SSE)

Read the full file on GitHub · 92 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 Changed b9a536c2b4d2
  2. 11d ago First seen · 92 lines · 4,771 tokens per session scan A 06f49538bd99

Subscribe to this mod's changes

Tianshu-harness CLAUDE.md is an instructions file published in the GitHub repository huiliyi37/Tianshu-harness (591 stars, last pushed today), licensed Apache-2.0. It adds 4,771 tokens to every session, about $0.0239 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.

Related

Other instructions, from other repositories

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,296 tokens

codex AGENTS.md

AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.

openai/codex · 5,153 tokens

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 · 6,785 tokens

spec-kit AGENTS.md

AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.

github/spec-kit · 7,104 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,469 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, applying the notice (cutover) and fallback chain (never fail the build).

microsoft/vscode · 5,001 tokens