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.
curl -O https://raw.githubusercontent.com/kitepon/Throughline/main/AGENTS.mdgit clone --depth 1 https://github.com/kitepon/ThroughlineWrote 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.
[](https://agentmods.dev/instructions/kitepon/throughline/agents-md)<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.
<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>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.
| Model | Per session | Once 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 |
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 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 優先):
- baton path: 旧セッションで
/tlを実行すると UserPromptSubmit hook がhandoff_batonsテーブルにそのセッションの session_id を書き込み、次の新規セッションが初回プロンプト時に消費して merge。適格性はセッション誕生時刻基準で0 ≤ (誕生 − baton書込) ≤ TTL 1h。負 age(誕生後に書かれた baton)は消さずに残す=走行中セッションが横取りしない。source値関係なく発火する確定指名方法 - auto path: baton が無く SessionStart で
source='clear'を受け取ったとき、envTHROUGHLINE_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) - baton 消費が auto 判定より先発なので両者は構造上同時成立しない
- baton path: 旧セッションで
- 注入内容 (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)でのエラー隠蔽は禁止
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.
- 3d ago Changed · +1 lines · +54 tokens per session e8585963ff5b
- 6d ago Changed · +40 tokens per session 81a473175463
- 10d ago Changed · +2 lines · +152 tokens per session ae6bb88a8402
- 11d ago Changed · +113 tokens per session 8fa140435f65
- 15d ago Changed · +3 lines · +1,708 tokens per session d2c9f294a2dd
- 17d ago Changed · +176 tokens per session 720c5a8da814
- 18d ago Changed · +513 tokens per session c29f84332bb5
- 20d ago Changed · +1 lines · +168 tokens per session 049f4660d205
- 21d ago Changed · +1 lines · +666 tokens per session 524d92b13e68
- 22d ago First seen · 494 lines · 24,555 tokens per session scan B 1cb57eb9b9ab
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.
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).
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.
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).
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.
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).
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.