mecha CLAUDE.md

mecha CLAUDE.md is an instructions file for coding agents from ljchang/mecha. It costs 6,754 tokens per session, scanned A, original, MIT.

A project instruction document for mecha, an agent harness that turns a local open-weight AI model into a personal assistant connected to mail, calendars and other personal context. It describes the repository's Rust components and interfaces.

In plain words
What is it for?
Use it when working on mecha's core library, command-line tools, mail and document integrations, Slack transport, or chat and terminal interfaces.
Why use it?
It helps coding agents understand the system's structure and privacy-related design constraints before making changes.

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/ljchang/mecha/claude-md
Clone the repo
git clone --depth 1 https://github.com/ljchang/mecha

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

README.md
[![agentmods](https://agentmods.dev/badge/instructions/ljchang/mecha/claude-md.svg)](https://agentmods.dev/instructions/ljchang/mecha/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/ljchang/mecha/claude-md"><img src="https://agentmods.dev/badge/instructions/ljchang/mecha/claude-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 6,754 This file is loaded in full into every session.
When invoked 6,754 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.06754 $0.06754
Opus 5 $0.03377 $0.03377
Sonnet 5 $0.01351 $0.01351
Haiku 4.5 $0.00675 $0.00675

Measured today against content hash 2520350dd026, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

mecha 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 today.

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 · 472 lines

How it starts

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

mecha — CLAUDE.md

What this is

An agent harness whose purpose is to make a local open-weight model into a usable personal assistant: wired into enough personal context to be worth asking (mail, calendar, a knowledge graph), able to reach the world through a reviewed surface, and safe to hold all of that at once. Almost every design decision here is downstream of that last clause — a personal assistant has private data, third-party content and a way to send by definition, so the lethal trifecta is the permanent condition rather than an edge case.

Four crates:

  • mecha-core/ — the library. Knows nothing about any CLI or application.
  • mecha-cli/ — the mecha binary. Thin; all logic belongs in core.
  • mecha-mail/ — mail, calendar and documents. Mail and calendar sit behind one provider-neutral MCP surface; mecha-docs is a fourth binary on the same library, sharing its OAuth and token lifecycle.
  • mecha-slack/ — the Slack transport. No mecha-core dependency, ever; that is the whole reason it is a crate, and it is checkable in Cargo.toml.

Interfaces: mecha run (one-shot), mecha chat (readline REPL), mecha tui (full-screen; the input line stays live so you can steer a run in flight), and mecha batch / mecha eval for fan-out.

The user-facing half of this reasoning is published at https://docs.mecha-factory.ai/; website/docs/principles.md is that site's restatement of the invariants below, without the incident behind each one.

Where everything else lives. This file holds only what any session may need on any run; it is the expensive file, because it rides in every agent's context. docs/ARCHITECTURE.md holds the per-subsystem invariants — read its section before changing a subsystem it names, and put a new subsystem's invariants there, not here. docs/README.md is the map of all the rest — which document holds what, and the routing question to ask before writing a line anywhere. Two of its rules govern this file: state the rule, then the incident in one sentence, never the other way round; and where a topic doc covers something, point at it rather than restating it, because duplication is how documents drift into disagreeing.

Read the full file on GitHub · 472 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. today Changed · +12 lines · +180 tokens per session 2520350dd026
  2. yesterday Changed · +39 lines · +612 tokens per session 1e35c6007c11
  3. 5d ago First seen · 421 lines · 5,962 tokens per session scan A 464dee482536

Subscribe to this mod's changes

mecha CLAUDE.md is an instructions file published in the GitHub repository ljchang/mecha (6 stars, last pushed today), licensed MIT. It adds 6,754 tokens to every session, about $0.0338 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-31.