Tianshu Harness
A terminal runtime for coding agents that keeps goals from drifting, ties completion to evidence, and closes the verification loop.
- Source repo
- huiliyi37/Tianshu-harness
- Stars
- ★ 1.4k
- Last updated
- 5d ago
- FARS reviewed
- Sep 10, 2026
- License
- Apache-2.0
- Primary language
- TypeScript
- FA score
- 67/100 · Some gaps
At a glance
- How it runs
- Works with
- Universal · cross-platformOpenAI APICodex · Claude API (Partial support)
- Cost
- Free software; you pay for model usage
- Setup effort
- Low · running in minutes
- You'll need
- Typical use
- Developers whose long sessions drift: set a multi-turn goal with
/goalplus a budget and let the runtime check completion instead of trusting the model to remember the original ask. - Not a fit if
- Environments pinned to Node 22/23/25 that cannot upgrade the runtime
- Users who need English-first documentation and UI throughout
- Website
- tianshuharness.com ↗ set on GitHub
- Maintenance
- Commits in the last 30 dayslast commit 2026-11-26+0.9 ★/day over 7 days
- Source review
- 67/100 · Some gaps
What does this agent do, and when should you use it?
Tianshu is a TypeScript runtime for coding agents: a terminal TUI, a desktop app and a VS Code extension share one kernel. The CLI command is tianshu, with rivet as a compatibility alias; data still lives under ~/.rivet. Its target is not the model's capability ceiling but its runtime behaviour in real engineering sessions — giving in when challenged, following instructions literally, letting a local signal override the global goal, or looping on tools without progress. It inserts a Cognitive Virtual Machine (CVM) between the model and the world: each task gets a TaskContract recording goal, scope, constraints and success criteria, so goals, state, evidence, permissions and termination conditions live outside the chat history. A RuntimeHookPipeline of 75 hook modules spans five turn phases (preTurn, afterPerception, postTool, postTurn, postSession) for convergence, idle-loop detection and evidence tracking, while a deliver_task gate returns RED / YELLOW / GREEN against evidence. Context is prefix-cache-first, with published measurements on DeepSeek V4, and the tool ships 25 provider presets plus any OpenAI-compatible endpoint.
After launch you get a 〉 prompt; the agent searches, reads files, edits code and runs tests itself. Every task carries its own TaskContract, and the runtime — not the model's recollection — holds the goal and constraints. During each turn RuntimeHookPipeline assembles hooks across five phases, and Sensorium computes momentum, pressure, verification coverage, complexity, familiarity and stability from monitoring signals already available, detecting convergence and doom loops without extra LLM calls. At delivery, deliver_task performs only ownership-scoped safe commits: ownership, cross-session conflicts and version consistency are checked and can block; the result is GREEN / YELLOW / RED based on evidence. Targeted verification is a separate run_tests call with an explicit scope (empty arguments return a scope preview); independent review is review_changes or /review with a fixed snapshot, a read-only reviewer and persisted findings — the delivery receipt is explicitly not a quality endorsement. On the context side the prefix is frozen, only deltas are appended, and compaction happens only at user-turn boundaries; /debug cache diagnoses hit rate and fragmentation. Outputs include a delivery report, the /cockpit eight-panel runtime dashboard, and a per-turn sensorium.jsonl (tianshu logs prints the path, recomputable with jq). Headless mode offers tianshu -p for a single prompt, --stream-json for an NDJSON event stream, and --goal with --budget for goal-driven autonomous continuation. Multi-agent orchestration covers /scout, /team, /council and /galaxy, alongside Plan Mode, /handoff, double-Esc rewind, LSP integration, MCP and Skills.
- Developers whose long sessions drift: set a multi-turn goal with
/goalplus a budget and let the runtime check completion instead of trusting the model to remember the original ask. - Teams running unattended jobs in CI or scripts:
tianshu --stream-json -p "refactor this module"yields an NDJSON event stream with built-in redaction. - Engineers burned by agents claiming "should be fixed now": rely on the
deliver_taskgate plus scopedrun_testsverification so completion status rests on evidence. - Teams that need approval boundaries: the default
autopermission tier runs low-risk actions directly and pauses on high-risk ones, while/yesauto-enables a sandbox write boundary with rollback. - Shared codebases across sessions:
/handoffproduces a structured handover document, double-Escrewinds to any earlier point, and.rivet/knowledge/memory.jsonlkeeps cross-session project memory. - Desktop-oriented users: download the
.dmg,-setup.exeor.AppImagebuild for an integrated terminal, phone-based approval, WSL runtime connection and self-updating. - DeepSeek users: the published cache and behaviour evidence centres on DeepSeek V4, with 99.3–99.6% prefix-cache hit rates on the same weights.
Key setup facts
Pulled from the install and usage notes below. The project README has the current values.
- Install / run
npm install -g tianshu-harness
- Runtime
- Node.js 24
- Install notes cover
- Windows · macOS · Linux
How do you install or deploy this agent?
The CLI requires Node.js 24.x ≥ 24.22.1 or 26.x ≥ 26.12.1. Confirm first:
node -v # requires v24.22.1+ or v26.12.1+Then install globally and start:
npm install -g tianshu-harness
tianshuAlternatively use the one-line script (macOS / Linux):
bash <(curl -fsSL https://raw.githubusercontent.com/huiliyi37/Tianshu-harness/main/scripts/install-tui.sh)On Windows PowerShell:
powershell -ExecutionPolicy Bypass -Command "irm https://raw.githubusercontent.com/huiliyi37/Tianshu-harness/main/scripts/install-tui.ps1 | iex"Migrating from the older tianshu-tui package fails with EEXIST due to a rivet command link conflict; remove the old package first:
npm uninstall -g tianshu-tuiThe desktop app needs no Node — download .dmg (macOS 11+, Apple Silicon / Intel), -setup.exe (Windows 10 1809+ / 11) or .AppImage (Linux x86_64 / aarch64; requires glibc 2.35+, libwebkit2gtk-4.1 and libgtk-3) from Releases. macOS builds are not notarised by Apple; if the app reports it is damaged, run:
xattr -cr /Applications/Tianshu.appThe first launch opens the /connect wizard to pick a provider and paste an API key.
How do you use this agent?
Once the /connect wizard is done, start with a read-only orientation before giving multi-step work:
〉 Read this project and tell me its structure, where the entry point is, and one thing most worth improving
〉 Fix the first failing test in this project and explain the root causeThe default permission tier is auto; switch it with:
/permission supervise
/permission auto
/yesHeadless and goal-driven runs:
tianshu -p "explain src/agent/loop.ts"
tianshu --stream-json -p "refactor this module"
tianshu --goal "fix all type errors" --budget 50Afterwards review the delivery report, the /cockpit dashboard and the per-turn log:
tianshu logsModels and star domains can be switched mid-session:
/model
/domain auto
/domain listWorking on the source (this repo is a synchronised projection of the main development repo; the desktop app and some advanced implementations are not included):
npm install
npm run typecheck
npm test
npm run build
node dist/cli/entry.jsSafety boundaries, hardening & integrations
Operational blast radius, source-verified safety controls, and first-run hardening steps before connecting this agent to real workspaces.
Declared capability surface (blast radius)
Can run terminal commands; pair with approval gates or container/OS sandboxing.
Modifies local files; work on a clean Git branch or dedicated worktree.
Makes outbound requests; verify telemetry settings and model data routing on private repos.
Inherits capabilities of connected MCP servers; audit third-party servers before enabling.
What are this agent's strengths and limitations?
- Completion is operationalised rather than asserted: the
deliver_taskgate returns RED / YELLOW / GREEN against evidence, discloses verification gaps honestly, and separates commit, verification and review. - Context cost is genuinely managed: frozen prefix, appended deltas, compaction only at user-turn boundaries, with published figures of 99.3–99.6% cache hit over five real long sessions and ¥879.97 → ¥19.96 in input cost.
- Supervision is decoupled from the model: 75 hooks across five turn phases plus
Sensorium, which reuses existing monitoring signals per turn instead of calling an LLM, so oversight adds no inference cost. - Delivery is broad without splitting the kernel: a zero-dependency pure-ANSI terminal TUI, a desktop app that bundles its own runtime, and a VS Code extension all share one core.
- Permission design is layered:
validatePathblocks..traversal, untrusted projects do not load hooks/MCP/memory, sensitive files are excluded, SSRF protection resolves DNS per hop, and a Git checkpoint precedes the first edit of each turn. - Not locked to one vendor: 25 provider presets plus any OpenAI-compatible endpoint, switchable in-session with
/model.
- The Node.js floor is a hard gate: from v3.36.0 only 24.22.1+ and 26.12.1+ are accepted, Node 22 / 23 / 25 / 27 are refused at startup, and
/updatemay install a package the new CLI still cannot boot. - Behavioural evidence is a small pilot: five tasks, one model (DeepSeek-V4-Flash), LLM review, and the README itself notes belief effects fade at the confirmation and execution stages.
- Cache measurements are DeepSeek-only; the README concedes the published data covers just that provider, so gains elsewhere need your own verification.
- This repo is a synchronised projection of the main development repo — the desktop app and some advanced implementations are absent, limiting how far you can modify them.
- Chinese-first: the primary README and the CVM theory/evidence documents are Chinese, and the latter two are CC BY-NC-ND 4.0 — no adaptation or commercial reuse.
- Desktop caveats: macOS builds are unnotarised, and Linux Wayland is untested (an X11 session is recommended).
How does this agent compare with similar options?
Key facts side by side with the most closely related agents.
| Agent | Source review | Form / cost | Stars | Updated | Language | Full support on |
|---|---|---|---|---|---|---|
| Tianshu Harness This agent | 67 · Some gaps | CLIFree + model costs | ★ 1.4k | 5d ago | TypeScript | OpenAI API |
| Deep Copilot | 60 · Some gaps | IDE extensionFree + model costs | ★ 79 | 6mo ago | JavaScript | — |
| AI Free | 47 · Major gaps | Desktop appFree | ★ 231 | 6d ago | JavaScript | ChatGPT · OpenAI API · Claude API |
| Reasonix | 75 · Good | CLIFree + model costs | ★ 36k | 19d ago | Go | OpenAI API |
How does FollowAgents rate this agent?
Why each dimension lost points
SECURITY.md and the README enumerate path boundary validation, sensitive-file denial, destructive-command confirmation gates, plugin ignore-scripts enforcement, SSRF protection, and an explicit trust-boundary statement ('repo content is data, not instructions'); keys go to a 0600 secrets.. However, only documentation plus package./CI were provided in evidence — no validatePath implementation was visible — so documented-but-unexecuted claims score 2, not 3. Data-flow transparency (auto-redaction, event streams) and rollback (checkpoints, git diff review) are documented but likewise unverified in code.
Documentation is internally consistent (zen promotion and cache-break behavior cross-explain), Node >=24 is pinned with installer checks and upgrade hints, and CI includes a real Windows smoke test. Deduction: all of this rests on static declarations; failure paths are described but not demonstrated, so no criterion reaches 3.
Targets individual developers and cost-sensitive long sessions across TUI/GUI/CLI/headless/VS Code surfaces — audience and scenarios are well covered (3). Known boundaries (Wayland untested, no Linux voice input) are recorded (2). The zen triage heuristic ('single line ≤80 chars = trivial') is a prompt-class trigger with acknowledged-but-partially-analyzed misfire risk; deducted to 1.
Clear information architecture, four install paths, full Apache-2.0 text in-repo, explicit rename handling (Rivet→Tianshu, binary still 'rivet'), and a known-limitations section. Deductions: no CHANGELOG file appears in evidence (only a badge and release link), and maintainer identity is unverified with only a 72-hour SLA statement in SECURITY.md — versioning_changelog scores 1.
Output modes (text/JSON/NDJSON with auto-redaction) suit scripted use; the cache hit-rate and bill-reduction claims (¥880→¥20) state concrete marginal value and cost benefit with pointers to reproduction commands. But no quantitative claim was reproduced in this static review — 1 deducted from each, scoring 2.
Key claims link to named documents (CVM A/B report, observability harness, engineering metrics with reproduction commands), giving good traceability (2). However, the A/B results, 16,471 tests, and 95–99% hit rate are single-source self-reports with no corroboration in this evidence set; the test samples shown cover only peripheral VS Code extension logic (1). The README mixes factual metrics with manifesto-style narrative (star-domain 'emergence', stele texts) with only partial separation — 1.
- All security controls (path validation, sensitive-file denial, SSRF protection, plugin isolation) are documentation-only in this evidence set; no implementation code was reviewed. Do not assume they are effective based on the README alone.
- The 95–99% cache hit rate, ¥880→¥20 bill reduction, 16,471 tests, and CVM A/B results are single-source self-reports not independently reproduced in this static review; verify via the provided reproduction commands before relying on them.
- The installer uses a curl|bash pattern defaulting to the npmmirror registry with an unverified publisher; inspect the script before running, or prefer a manual npm install.
- The README blends metrics with manifesto-style narrative (star domains, genesis stele); judge technical capability only on reproducible data, not rhetoric.
- The postinstall hook executes repo scripts (native sqlite fetch, etc.); evaluate supply-chain risk before installing in sensitive environments.
FAQ
Is it free, and what will it actually cost?
How do deliver_task, run_tests and review_changes differ?
deliver_task only performs ownership-scoped safe commits (ownership, cross-session conflicts, version consistency) and returns RED / YELLOW / GREEN from evidence — the receipt is explicitly not a quality endorsement. Targeted verification requires an explicit run_tests call with a scope (empty arguments return a scope preview), and independent review goes through review_changes or /review with a fixed snapshot, a read-only reviewer and persisted findings.Can it damage my project without me knowing?
auto tier runs low-risk actions and prompts on high-risk ones; /yes skips approval but automatically enables a sandbox write boundary with rollback. Underlying protections stay active either way: validatePath confines writes to the workspace, .env and credentials.* are excluded, rm -rf, force push, DROP / TRUNCATE require explicit confirmation, and a Git checkpoint is created before the first edit each turn.Can I audit what the runtime decided?
tianshu logs prints the log paths; sensorium.jsonl records per-turn state perception and CVM judgements and is recomputable with jq, as are the cost and cache figures. The /cockpit dashboard adds eight runtime panels including cache hit and cost, plus risk and idle-loop views.Does it work with models other than DeepSeek?
/model, and accepts any OpenAI-compatible endpoint (Ollama, vLLM, one-api relays, etc.). Note the connection method differs per provider: Codex via ChatGPT subscription OAuth, Claude via a cc-switch proxy, Gemini over its native protocol.Thanks — we use this to improve the page.
Subscribe to the FollowAgents RSS feed, or save this agent to your browser shortlist to compare on your next visit.