thinkrail: Instructions file for Codex

AGENTS.md

thinkrail AGENTS.md is an instructions file for Codex, OpenCode from JetBrains/thinkrail. It costs 2,153 tokens per session, scanned A, original, Apache-2.0.

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 ✓ vendor

Written for Codex and OpenCode: the file is AGENTS.md.

This is JetBrains/thinkrail's own configuration. It tells Codex and OpenCode how to work on thinkrail 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 thinkrail configures →

About the project

JetBrains/thinkrail is a desktop and mobile client that embeds the pi coding agent inside an interface for editing code and managing development workspaces. Developers use it to work on Git repositories through separate worktrees, a Monaco editor, terminals, Git views, specifications, and concurrent agent sessions. The catalogue entries are skills and instructions for its agent-based development workflow.

JetBrains/thinkrail · 7,763 stars · on GitHub · thinkrail.ai

Reuse

Borrowing it

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

Made for: 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 thinkrail AGENTS.md

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

Your own site · 80×15
<a href="https://agentmods.dev/instructions/jetbrains/thinkrail/agents-md"><img src="https://agentmods.dev/badge/instructions/jetbrains/thinkrail/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 2,153 This file is loaded in full into every session.
When invoked 2,153 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.02153 $0.02153
Opus 5.5 $0.00861 $0.00861
Sonnet 5.5 $0.00431 $0.00431
Haiku 4.5 $0.00215 $0.00215

Measured 14d ago against content hash b56675347cb8, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 14d 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 · 146 lines

How it starts

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

ThinkRail

The agentic IDE that gets better every time you use it, built around 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.

Read context proportionally

  • Use goal-and-requirements.md for the product's goal, principles, capabilities, and non-goals.
  • Use architecture.md for system topology, cross-module decisions, and repo-wide invariants.
  • For a pi upgrade or a host workaround around pi, read pi-compatibility.md: verify every applicable removal gate against the installed SDK, update the registry, and report what was removed or retained.
  • Read the owning SPEC.md when work is governed by or may alter a module boundary, contract, invariant, documented behavior, or architecture decision.
  • Localized work does not require unrelated specs or a full repository map.

Module structure and boundaries

Clear, fractal module boundaries are a top-priority requirement:

  • Every package and meaningful directory-level sub-module has a SPEC.md stating its responsibility, public surface, allowed dependencies, and forbidden reaches.
  • A sub-module exposes an index.ts barrel as its only public surface; siblings import through the barrel, never internals. Per-file imports remain only where a barrel would defeat code-splitting or a library convention, such as apps/web/src/panels and packages/ui.
  • Dependency edges between sibling sub-modules live in the parent module's SPEC.md, not each leaf.
  • A change that moves or blurs a boundary updates the owning spec first. Cover public surfaces and boundary rules with tests where practical, but do not manufacture coverage for a localized change.

Engine and architecture

  • Run pi in-process through @earendil-works/pi-coding-agent (createAgentSession), never as a subprocess and never through a second agent runtime. Fatal provider/agent faults can take down the host; that lack of crash isolation is accepted.
  • The three rings are engine host (packages/server + packages/shared), typed wire (packages/contracts), and independently shippable UI (apps/web). apps/cli and apps/desktop are thin launchers over the same host.
  • Use only the @earendil-works/* package scope. @mariozechner/* is deprecated.

Read the full file on GitHub · 146 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. 14d ago Changed · +5 lines · +102 tokens per session b56675347cb8
  2. 15d ago Changed · +2 lines · +43 tokens per session 534ac1d86809
  3. 16d ago Changed · +1 lines · +13 tokens per session 3af3ff80eef2
  4. 23d ago Changed · +2 lines · +44 tokens per session d061964f5c18
  5. 26d ago Changed · +1 lines · +33 tokens per session ddc58a2a3e8f
  6. 29d ago Changed · +7 lines · +129 tokens per session f3fd89e861d7
  7. 1mo ago Changed · +1 lines · +32 tokens per session 22be7c133417
  8. 1mo ago Changed · +1 lines · +6 tokens per session 542882acebb9
  9. 1mo ago Changed · +5 tokens per session cbafbd8a9e78
  10. 1mo ago First seen · 126 lines · 1,746 tokens per session scan A 02757f133eb6

Subscribe to this mod's changes

thinkrail AGENTS.md is an instructions file published in the GitHub repository JetBrains/thinkrail (7,763 stars, last pushed yesterday), licensed Apache-2.0. It adds 2,153 tokens to every session, about $0.0086 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-30.

Related

thinkrail AGENTS.md compared with instructions from other repositories

thinkrail AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
thinkrail AGENTS.mdJetBrains/thinkrailInstructions file7.8kyesterdayApache-2.0A2,153Codex, OpenCode
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143ktodayMITA7,461Codex, OpenCode
langchain AGENTS.mdlangchain-ai/langchainInstructions file149kyesterdayMITA4,680Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA5,516GitHub Copilot
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA3,093GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file274k2d agoMITA4,313Codex, OpenCode