ClaudeMods
☰
ZH-TW
● 0 人在線上 · 瀏覽 0 次
贊助提交作品
GitHub 儲存庫 · 發布者 RafeSymonds

refs

一個 Claude Code mod,追蹤 Claude 定義的參照程式碼(F1、D2、A3),提供 /refs 面板瀏覽和插入程式碼,並為被引用的程式碼解析隱藏上下文。

RafeSymonds@RafeSymonds

RafeSymonds/claude-mods/tree/main/plugins/refs

已翻譯

關於這個 mod

refs 讓參照程式碼(F1、D2、A3 等)成為 Claude Code 追蹤的物件,不必往回捲動尋找文字。/refs 會開啟面板,列出 Claude 定義的每個程式碼及其文字;按下程式碼即可將它插入提示。當提示以任何大小寫引用程式碼(a2、A2、a1-a3)時,定義會作為隱藏上下文傳給模型,即使壓縮移除了定義它的回覆,程式碼仍能解析。每個提示都會告訴模型目前使用哪些程式碼,因此新項目會繼續編號。/refs clear 或 /clear 會清空清單。Claude 回覆中只要某一行以程式碼開頭就算定義,例如 - **F1 Name:** text、1. D2: text、### A3 或表格列。最好搭配要求 Claude 用程式碼標記發現、決策、選項、風險、問題和行動的 CLAUDE.md 使用。需要 Claude Code 2.1.289 或更新版本。透過 claude plugin marketplace add RafeSymonds/claude-mods,接著 claude plugin install refs@claude-mods 安裝。

安裝

請先查看作者 README,確認 marketplace 與外掛名稱;指令可能隨儲存庫結構而變動。

claude plugin marketplace add RafeSymonds/claude-mods
claude plugin install refs
原文 / README

claude-mods

Mods for Claude Code. A mod is a plugin of function hooks: TypeScript that runs inside Claude Code, changes how it behaves, and draws UI in the terminal or the desktop app's Code tab.

Requires Claude Code 2.1.289 or newer. The mod API is early access and may change between releases.

Install

claude plugin marketplace add RafeSymonds/claude-mods
claude plugin install refs@claude-mods
claude plugin install latex@claude-mods

Restart Claude Code, or run /reload-plugins in a running session.

Mods

refs

Makes reference codes (F1, D2, A3, ...) something Claude Code tracks instead of text you scroll back for.

  • /refs opens a pane listing every code Claude has defined, with its text. Press a code to insert it in the prompt.
  • When your prompt cites codes, in any case (a2, A2, a1-a3), their definitions go to the model as hidden context. They still resolve after compaction removes the reply that defined them.
  • Every prompt tells the model which codes are in use, so new items continue the numbering instead of reusing a code.
  • /refs clear empties the list. /clear does too.

A code counts as defined when it opens a line in Claude's reply: - **F1 Name:** text, 1. D2: text, ### A3, or a table row | R1 | text |.

refs works best with a CLAUDE.md that asks Claude to label its findings, decisions, options and actions with codes:

When presenting three or more findings, decisions, options, risks, questions,
or actions, assign every one a short code: F1 for findings, D1 for decisions,
O1 for options, R1 for risks, Q1 for questions, A1 for actions.
Preserve the same codes throughout the conversation.

latex

Renders the math in Claude's replies, including your own LaTeX macros.

  • Desktop app: it already draws LaTeX, but not macros from your header. latex expands them first (\newcommand, \DeclareMathOperator, \DeclarePairedDelimiter, \def), so \skcenc_k(m) draws as Enc.
  • Terminal: math is drawn as Unicode: k ← Gen, Pr[Encₖ(m) = c], ℳ, 𝒦, 𝒞, {0,1}ⁿ.
  • Only the display changes. The model and /copy keep the LaTeX, and code blocks are left as written.
  • Headers are found on their own: .sty files and .tex files named like header or hdr, up to two folders deep. Set headers in /config to name them yourself. /latex shows which files were read.

Develop

Load a mod from your clone for one session, then check and test it:

claude --plugin-dir ./plugins/refs
claude plugin validate ./plugins/refs
claude plugin test ./plugins/refs

To run your clone as your installed copy, add it as a local marketplace. Edits then take effect on /reload-plugins:

claude plugin marketplace add ./
claude plugin install refs@claude-mods

License

MIT

更多類似作品