Throughline: Instructions file for Claude Code

AGENTS.md

Throughline AGENTS.md is an instructions file for Claude Code, Codex, OpenCode from kitepon/Throughline. It costs 28,145 tokens per session, scanned B, original, MIT.

A set of instructions for agents working in the Throughline repository. Throughline is a standalone tool that handles installation, saved state, database schema changes, diagnosis, recovery, updates, and release decisions.

In plain words
What is it for?
Use it before modifying Throughline source code, tests, hooks, commands, database handoffs, or support for other coding hosts. It also points to the relevant design documents for specialized work.
Why use it?
It tells agents which files and documents to read first and which parts of the product Throughline owns. This prevents changes that replace or bypass its existing Claude Code behavior and data contracts.

Instructions file for Claude CodeCodexOpenCode

Written for Claude Code and Codex and OpenCode: SessionStart hook event, but also the file is AGENTS.md. Also seen: reads .claude/ paths; mentions subagents; mentions Claude Code.

This is kitepon/Throughline's own configuration. It tells Claude Code, Codex and OpenCode how to work on Throughline 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 Throughline configures →

Reuse

Borrowing it

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

Made for: Claude Code, 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 Throughline AGENTS.md

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

Your own site · 80×15
<a href="https://agentmods.dev/instructions/kitepon/throughline/agents-md"><img src="https://agentmods.dev/badge/instructions/kitepon/throughline/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 28,145 This file is loaded in full into every session.
When invoked 28,145 The same file — it is already loaded in full.
Security scan B 1 finding. 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.28145 $0.28145
Opus 5.5 $0.11258 $0.11258
Sonnet 5.5 $0.05629 $0.05629
Haiku 4.5 $0.02814 $0.02814

Measured 3d ago against content hash e8585963ff5b, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade B, and why

Throughline AGENTS.md scanned grade B with 1 finding 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 3d 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.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

| [src/cli/install.mjs](src/cli/install.mjs) | `install` / `uninstall`(デフォルト global、`--project` で Claude ローカル)。global install は `~/.claude/settings.json` と slash commands に加えて `~/.codex/hooks.json` の UserPromptSubmit / P
AGENTS.md · 502 lines

How it starts

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

AGENTS.md

このファイルは AI エージェント(Claude Code、Codex、Grok、Cursor など)がこのリポジトリで作業する際のガイダンスです。

プロジェクト概要

Throughline は Claude Code の hooks プラグインで、会話ターンを 3 層 (L1/L2/L3) に分解して SQLite に保存し、/clear 後も記憶を復元します。加えてマルチセッション対応のトークンモニター CLI も同梱しています。

Throughline は単独で install、設定、状態保存とschema migration、診断、復旧、更新、 release判定まで完結する。dotagentsは工場への配線と統合契約を担当するが、Throughlineの 状態や製品寿命を所有・制御しない。runtime-error collectionはThroughline自身の runtime-errors enable|disable --jsonと製品所有configが管理し、工場側は公開JSON契約だけを使う。 runtime errorを外へ送るのは、利用者がruntime-errors report-enableで明示して有効にした端末だけで、既定では通信しない(ADR 0025)。 Codex固定エラーの最新一回はADR 0025の私有補足を既message_templateへ投影する。旧指紋/件数を変えず、利用者影響unknown/diagnostic_onlyを明示する。

版番号の正本は package.json、公開版はnpm、schemaの正本は src/db.mjs の CURRENT_VERSION とする。Claude Code、Codex、Grok、Cursorをfirst-class hostとして扱う。現行host契約はREADMEとADR 0021/0022/0023、release gateはdocs/04_public_release_plan.mdを正とする。版ごとの変更・公開commit・CI・npm・tag・smoke履歴はCHANGELOG.mdとdocs/archive/, evidence/に置き、この常時読込正本へ複製しない。

設計の核 (v0.4.0 以降 + ADR 0014 二相化、docs/02_clear_auto_handoff_plan.md)

  • /clear 後も SQLite はそのまま残る。前任セッションの全レコードを新 session_id に張り替える(記憶張り替え方式)
  • 二相ハンドオフ (ADR 0014): Claude Code は同一 project に短時間で複数の SessionStart を発火させることがあり、一部は transcript を生成しない幽霊セッションになる。SessionStart 時点では実体と幽霊を判別できない(本物の transcript も hook より数百 ms 遅れて作られる)ため、SessionStart は pending_handoffs への intent 登録のみを行い、merge + 注入は最初の UserPromptSubmit(= 実体の証明。幽霊はプロンプトを発火しない)で実行する。2026-07-17 に幽霊がバトンを先取りして実セッションが記憶ゼロで始まる incident が同日 2 回発生した(実測・機序は ADR 0014)
  • 引き継ぎ発火条件は 2 経路 (baton path 優先):
    1. baton path: 旧セッションで /tl を実行すると UserPromptSubmit hook が handoff_batons テーブルにそのセッションの session_id を書き込み、次の新規セッションが初回プロンプト時に消費して merge。適格性はセッション誕生時刻基準で 0 ≤ (誕生 − baton書込) ≤ TTL 1h。負 age(誕生後に書かれた baton)は消さずに残す=走行中セッションが横取りしない。source 値関係なく発火する確定指名方法
    2. auto path: baton が無く SessionStart で source='clear' を受け取ったとき、env THROUGHLINE_DISABLE_AUTO_HANDOFF が '1' でなければ findLatestClaudePredecessor(transcript 実在フィルタ付き — 幽霊 twin を前任に選ばない)で前任を SessionStart 時点で解決・凍結し、初回プロンプト時に merge + 注入。組み込み /clear は実測したどのクライアントでも UserPromptSubmit に届かない。VS Code は source='clear' を送るため auto path、Desktop は送らないため /tl を先に使う(経緯と実測は archive docs/12、upstream: anthropics/claude-code#76704)
    3. baton 消費が auto 判定より先発なので両者は構造上同時成立しない
  • 注入内容 (ADR 0016, 2026-07-18〜): push は「現在地」だけ — ヘッダ + 現在地アンカー + 案内セクション(無条件表示)+ L2 を新しい順に丸ごと入るターンだけ全文(ターン原子・固定 N なし)。L1 は注入しない。窓 (20 ターン) の残りは throughline recall --l2、それより古い全ターンは recall --l1(要約 or 未要約明示)、一点掘りは throughline detail <時刻> の pull 三段構成。範囲・境界 (ISO ms strict less-than)・件数・session は全部注入時に案内コマンドへ焼き込み、recall 側は窓を再計算しない。memo / thinking は注入しない
  • 注入予算 (ADR 0014): hook stdout は約 10k 字超で <persisted-output>(path + 先頭 2KB preview)に file 化されモデル可視が劣化する(実測 9,501 字 inline / 15,286 字 file 化。10k 判定は per context string で multi-hook なら突破可能と実測済みだが構造的想定外として不採用 — ADR 0016)。注入は buildBudgetedResumeContext(上限 9,500 字)で行う
  • thinking の L3 保存: assistant の extended thinking ブロックは details テーブルに kind='thinking' で全ターン保存される。throughline detail <時刻> で取り出せるが、注入には含めない
  • 各レコードは origin_session_id を保持するため、複数回の引き継ぎでも記憶がチェーン状に蓄積する(ホップ制限なし)
  • CLAUDE_AUTOCOMPACT_PCT_OVERRIDE は 使わない(自動コンパクト依存の設計は放棄済み)
  • フォールバック / 逃げ道のコードを書かない — docs/04_public_release_plan.md §0 参照。silent try/catch、exit(0) でのエラー隠蔽は禁止

Read the full file on GitHub · 502 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. 3d ago Changed · +1 lines · +54 tokens per session e8585963ff5b
  2. 6d ago Changed · +40 tokens per session 81a473175463
  3. 10d ago Changed · +2 lines · +152 tokens per session ae6bb88a8402
  4. 11d ago Changed · +113 tokens per session 8fa140435f65
  5. 15d ago Changed · +3 lines · +1,708 tokens per session d2c9f294a2dd
  6. 17d ago Changed · +176 tokens per session 720c5a8da814
  7. 18d ago Changed · +513 tokens per session c29f84332bb5
  8. 20d ago Changed · +1 lines · +168 tokens per session 049f4660d205
  9. 21d ago Changed · +1 lines · +666 tokens per session 524d92b13e68
  10. 22d ago First seen · 494 lines · 24,555 tokens per session scan B 1cb57eb9b9ab

Subscribe to this mod's changes

Throughline AGENTS.md is an instructions file published in the GitHub repository kitepon/Throughline (5 stars, last pushed today), licensed MIT. It adds 28,145 tokens to every session, about $0.1126 per session on Opus 5.5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other instructions, from other repositories

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 · 9,715 tokens

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,461 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, cache eligibility and rollout and applying the notice (cutover).

microsoft/vscode · 5,262 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,680 tokens

vscode copilot-instructions.md

Copilot instructions for microsoft/vscode, covering vs code copilot instructions, project overview, root folders, core architecture (src/ folder) and built-in extensions (extensions/ folder).

microsoft/vscode · 2,750 tokens

deepseek-harness AGENTS.md

AGENTS.md instructions for deepseek-ai/deepseek-harness, covering agents.md, pre-stable apis and released session data, repository layout, commands and host sandbox failures.

deepseek-ai/deepseek-harness · 4,261 tokens