chat.md CLAUDE.md

chat.md CLAUDE.md is an instructions file for coding agents from rusiaaman/chat.md. It costs 561 tokens per session, scanned A, original, MIT.

Instructions for a Visual Studio Code extension that treats .chat.md files as editable conversations with a language model. The file marks system, user, and assistant messages and can include text or image attachments.

In plain words
What is it for?
Use it to plan or implement an extension that lets developers write prompts and conversation history in Markdown files, with referenced files or images included in user messages.
Why use it?
It defines how the extension should read conversation files and manage streaming replies, so the chat format and message roles stay consistent.

Instructions file

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/rusiaaman/chat.md/claude-md
Clone the repo
git clone --depth 1 https://github.com/rusiaaman/chat.md

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 chat.md CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/rusiaaman/chat.md/claude-md.svg)](https://agentmods.dev/instructions/rusiaaman/chat.md/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/rusiaaman/chat.md/claude-md"><img src="https://agentmods.dev/badge/instructions/rusiaaman/chat.md/claude-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 561 This file is loaded in full into every session.
When invoked 561 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
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.00561 $0.00561
Opus 5 $0.00280 $0.00280
Sonnet 5 $0.00112 $0.00112
Haiku 4.5 $0.00056 $0.00056

Measured 6d ago against content hash 0ac381551996, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

chat.md CLAUDE.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 6d 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.

CLAUDE.md · 89 lines

How it starts

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

I want you to plan a vscode extension.

What is the extension about?

Any file with extension .chat.md

is used as chat interface with an LLM

Theory

The file is a view of MessageParam data structure which is the chat conversation history with role user or assistant and content a list of text type or image type.

States

The extension doesn't have any long term state, it only has configuration which is part of vscode settings

At any given point of time there's a listener running that listens to keystrokes, and decides to call an LLM for streaming or not.

At any given of point of time there are one or more streamers running.

A "streamer" is a thread that's streaming from LLM a set of tokens at a time.

.chat.md parsing

%% system

Respond succinctly.

%% user

Hi

%% assistant

Hello

%% line is treated as describing a role and starting a text block.

In user block a md like relative url is resolved for text or image file.

All text and image files are parsed as attachment of user message at the beginning of the user turn with file paths introduced in one of two formats:

  1. Using the "Attached file at" syntax: Attached file at /Users/arusia/test.ts
// content

Attached file at /Users/arusia/image.png [image content]

  1. Using Markdown-style links with #file tag: #file #file

Both relative and absolute paths are supported in either format. Home directory paths using tilde (~) are also supported.

When to trigger streaming

If the file ends with an empty assistant block # %% assistant\s* without case match the streaming starts

How to stream idempotentically

At each loop step of the streamer there are a list of tokens received.

The history of tokens of current streamer (a single turn) is also saved in the streamer.

The past text is searched for in the last non-empty assistant block and if found the new tokens are appended regardless of presence of any subsequent text.

If no such text is found (say user deleted), the streamer should abort and cancelled. The streamer's data deleted.

Read the full file on GitHub · 89 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. 6d ago First seen · 89 lines · 561 tokens per session scan A 0ac381551996

Subscribe to this mod's changes

chat.md CLAUDE.md is an instructions file published in the GitHub repository rusiaaman/chat.md (151 stars, last pushed 14d ago), licensed MIT. It adds 561 tokens to every session, about $0.0028 per session on Opus 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.