thinkrail AGENTS.md

Project instructions for ThinkRail, a desktop and mobile app that hosts the pi coding agent and provides it with a user interface.

In plain words
What is it for?
Use it when designing or changing ThinkRail's architecture, package structure, imports, or boundaries between the server, web app, agent, and other modules.
Why use it?
It sets firm boundaries between modules so the app's packages and directories remain independently understandable and do not depend on each other's internal files.

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/jetbrains/thinkrail/agents-md
Clone the repo
git clone --depth 1 https://github.com/JetBrains/thinkrail

Made for: Codex, OpenCode.

Per session 4,503 This file is loaded in full into every session.
When invoked 4,503 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.04503 $0.04503
Opus 5 $0.02252 $0.02252
Sonnet 5 $0.00901 $0.00901
Haiku 4.5 $0.00450 $0.00450

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

Security

Grade A, and why

thinkrail 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 · 238 lines

How it starts

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

ThinkRail

A ThinkRail-branded desktop-and-mobile client for the pi coding agent. The app is a thin host that runs pi and bridges it to a rich UI; pi owns models, skills, compaction, cost, and session state.

Canonical specs (read these first):

  • goal-and-requirements.md — product goal + V1/V2 scope
  • architecture.md — top-level architecture, decisions, invariants

Module structure & boundaries (top-priority requirement)

The app is built as a set of clearly bounded modules. This is a primary design requirement, not a nice-to-have — treat it with the same weight as the non-negotiable invariants below.

  • Modules are fractal. The boundary rule applies at every level: each package is a module, and the directories inside a package (packages/server/src/agent/, apps/web/src/transport/, …) are modules too. A sub-module is a directory with an index.ts barrel as its only public surface; siblings import it through that barrel, never its internals. (Exception: where a barrel would defeat code-splitting or a library's per-file convention — e.g. apps/web/src/panels and components/ui, which lazy-load Monaco/shiki/xterm — imports stay per-file and the boundary is held by spec + convention.)
  • Every module has a SPEC.md that states its boundary explicitly: what it owns, what it exposes as its public surface, and what it must not reach into (allowed deps and forbidden deps). The dependency edges between sibling sub-modules live in the parent module's SPEC.md (a dependency graph), not in each leaf — leaves declare only their own external deps + forbidden reaches.
  • Boundaries should be covered by tests where practical — a module's public surface and its boundary rules are worth exercising with tests, not just relying on convention. This is a goal, not a hard gate: aim for coverage, but don't block on guaranteeing it everywhere.
  • The spec leads the code. A change that moves or blurs a boundary updates the module's SPEC.md first, then the code and the tests that pin it.

Read the full file on GitHub · 238 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 · 238 lines · 4,503 tokens per session scan A 868e430dd04d

Subscribe to this mod's changes

thinkrail AGENTS.md is an instructions file published in the GitHub repository JetBrains/thinkrail (340 stars, last pushed 2d ago), licensed Apache-2.0. It adds 4,503 tokens to every session, about $0.0225 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.