
coldHat
io.github.vince-gonzalezv0.1.0更新於 Oct 11, 2026
Put on anyone's AI rules by GitHub username: fetches their hat.md and its hat code.
概覽
讓助理依 GitHub 使用者名稱取得某人公開的 hat.md 規則,並在該對話中依這些規則工作。
- 功能
- coldHat 提供 hat(帽子):一份存放在名為 coldhat 的公開 GitHub 儲存庫中的 hat.md 檔案,由本人擁有。這個 MCP 連接器提供名為 wear_hat 的工具與名為 open_sesame 的提示;助理會讀取該 hat,用它的 hat code 回覆以證明讀過,接著在本次對話剩餘時間依這些規則工作。額外的 hat 放在 hats/ .md,以 /u/ / 存取。Status 標題下帶日期的項目會與當天日期核對,過期的項目助理會主動詢問。
- 適用情境
- 當你希望對話助理採用某個人的工作規則、語氣或審查風格,又不想手動貼上時使用。適合能連到該連接器的對話;無法瀏覽的對話也可以複製貼上 hat 內容。
- 執行需求
- 遠端 MCP 端點;未宣告任何套件、執行環境、帳號、金鑰或標頭。hat 擁有者需要一個名為 coldhat 的公開 GitHub 儲存庫並包含 hat.md。用於撰寫、鎖定與評估 hat 的獨立 Python 工具鏈以 pip 安裝,模型執行時使用 ANTHROPIC_API_KEY 或 OPENAI_API_KEY。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 coldHat,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。
其他 MCP 客戶端
把它新增到你客戶端的 mcpServers 設定中。
{
"mcpServers": {
"coldhat": {
"type": "http",
"url": "https://coldhat.f-keys.com/mcp"
}
}
}README
coldHat puts your working rules on any AI chat in one line. Type this into Claude, ChatGPT or Grok:
The assistant reads the hat, answers with its hat code to prove it read it, and works by those rules for the rest of the chat. Live at coldhat.f-keys.com.
[Claude and Grok each put on the frontier hat from one typed line and answer with its hat code]
Recorded 2026-10-11 in Claude (incognito) and Grok (private). Both quote 33963b16, the frontier
hat's live code, which they can only know by reading the page. Models keep their own copy of a
page for a while, so after an edit the code they quote can trail the live one. A playful
version, with the main hat's joke opener, is in docs/demo.gif.
Try one now. Starter hats anyone can wear:
A hat is a hat.md in a public GitHub repository named coldhat, so only its owner can
change it. Extra hats go in hats/<name>.md at /u/<user>/<name>. Dated facts under
## Status (- label: value · as of YYYY-MM-DD · check after N days) are checked by the
server against today's date, and the assistant asks about any that have gone stale.
Which chat boxes work was measured, not assumed.
Edit your hat in your own editor
publish checks the file, commits only that file, pushes, and waits until the live hat code
matches your local one.
Under the hood
worker/: the Cloudflare Worker behind coldhat.f-keys.com: hat pages, the editor,llms.txt, the MCP server. Edge-cached, rate-limited, every name checked before GitHub is asked. 37 tests run in workerd.src/coldhat/: the Python toolchain for authoring hats as cards, locking them, and measuring them with evals across models.
A hat (as cards)
A card:
load: always cards sit in the instructions. load: retrieve cards are fetched
when a task calls for them, so the hat can grow without filling the context.
Activation. open sesame puts on head, body and footer. open sesame head
puts on the voice alone. hat off removes it.
Integrity. coldhat lock records a sha256 for every file. A hat whose files
differ from the lock refuses to load. The fingerprint is a hash over all of
them, and every eval run records it, so a score always names the exact hat
that earned it.
Authority. A hat describes how to work. It grants no tools, permissions or access; the host's own rules and the user's live instructions outrank it.
Delivery modes
Retrieval is BM25 over card titles, tags and bodies; standard library only and deterministic.
Commands
run and grade exit 0 when every case passed, 1 when any failed, and 2 when
none failed but some could not be fully graded.
Credentials come from each SDK's own environment variables
(ANTHROPIC_API_KEY, OPENAI_API_KEY). Name the OpenAI model with --model
or COLDHAT_OPENAI_MODEL. Claude defaults to claude-opus-5-5, with the API's
refusal fallback enabled.
Evals
A suite is a JSON list of cases. Each case is a prompt, usually a bait question built to tempt the model into breaking one rule, and a list of checks:
voice_bans run on every reply: announced honesty, filler words, a closing
"want me to...?" menu.
A judge check with no judge model is not_run. A judge that errors is error.
Either one makes the case incomplete, which is never counted as a pass. An
empty reply fails outright, since it would otherwise pass every "must not
contain" check.
Tuning
- Run the suite on a model.
- Read the failures. Each one points at a card, the head, or a missing card.
- Edit,
coldhat lock, run again. coldhat report OLD NEWshows which cases flipped and confirms the hat changed.
Once a hat scores well, coldhat export turns the head's example answers, the
suite's reference answers and the replies from judged, passing runs into
training data. It only takes replies from runs of the current fingerprint, so
behavior from an older hat cannot leak in.
Chat-window run
coldhat build hats/vinceand copydist/vince/MASTER.mdinto the chat.coldhat sheet evals/vince.json --out claude.json, send each question in that chat, paste each reply into the file.- Repeat in a second model's chat with
--out gpt.json. coldhat grade hats/vince evals/vince.json claude.json --label claude, same forgpt.json.coldhat reporton both runs, andcoldhat agreeto see whether they took the same positions.
Security
A hat is instructions, not a credential, and open sesame is not a password. Commits pass a secret and private-term scrubber before they exist, CI runs it again with gitleaks over the full history, hats refuse to read outside their own folder, and the only tool a hat exposes is a read-only search over its own cards. Details and limits are in SECURITY.md.
To install the commit hook in a clone:
python tools/scrub.py --hash WORD prints the line to add for a term.
Tests
No network and no keys. Each gate is tested on input built to pass it and input built to fail it, and both provider adapters are driven through their tool loops with fake clients.
Part of F-Keys — independent hardware, software and internet products. See the working log and live status.
來源:README.md,提交 78c3bfd
工具
0版本歷史
1- v0.1.0最新Oct 11, 2026


