mecha: Instructions file for Claude Code

CLAUDE.md

mecha CLAUDE.md is an instructions file for Claude Code from ljchang/mecha. It costs 8,961 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 for Claude Code

Written for Claude Code: the file is CLAUDE.md. Also seen: reads .claude/ paths; mentions CLAUDE.md; mentions subagents.

This is ljchang/mecha's own configuration. It tells Claude Code how to work on mecha itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything mecha configures →

Reuse

Borrowing it

Nothing to install: this file belongs to ljchang/mecha. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/ljchang/mecha/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/ljchang/mecha

Made for: Claude Code.

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/github.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/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.

agentmods 80×15 button for mecha CLAUDE.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/ljchang/mecha/claude-md"><img src="https://agentmods.dev/badge/instructions/ljchang/mecha/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 8,961 This file is loaded in full into every session.
When invoked 8,961 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.08961 $0.08961
Opus 5.5 $0.03584 $0.03584
Sonnet 5.5 $0.01792 $0.01792
Haiku 4.5 $0.00896 $0.00896

Measured today against content hash 8812a31462dc, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 · 596 lines

How it starts

The opening of the file, as written. The whole thing — 596 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/, each rule on the page for the feature it governs rather than restated in one place; the standalone principles page was cut on 2026-09-26.

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 · 596 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 8812a31462dc
  2. 3d ago Changed · +2 lines · +42 tokens per session 59e285a22c28
  3. 4d ago Changed · +3 lines · +58 tokens per session 9f734446c4e0
  4. 6d ago Changed · +14 lines · +249 tokens per session fb67cf340172
  5. 13d ago Changed · +4 lines · +73 tokens per session 9a27d132262b
  6. 19d ago Changed · +3 lines · +68 tokens per session e36fb3d4d81f
  7. 24d ago Changed · +2 lines · +37 tokens per session e88d9cb39b44
  8. 25d ago Changed · +7 lines · +125 tokens per session 201420129e3e
  9. 26d ago Changed · +7 lines · +128 tokens per session fb4cfc72fcb4
  10. 27d ago First seen · 554 lines · 8,181 tokens per session scan A 7b7d3bd82149

Subscribe to this mod's changes

mecha CLAUDE.md is an instructions file published in the GitHub repository ljchang/mecha (7 stars, last pushed today), licensed MIT. It adds 8,961 tokens to every session, about $0.0358 per session on Opus 5.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.

Related

mecha CLAUDE.md compared with instructions from other repositories

mecha CLAUDE.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
mecha CLAUDE.mdljchang/mechaInstructions file7todayMITA8,961Claude Code
agentforge-py copilot-instructions.mdScaffoldic/agentforge-pyInstructions file101mo agoApache-2.0A101GitHub Copilot
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143ktodayMITA7,461Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA5,516GitHub Copilot
langchain AGENTS.mdlangchain-ai/langchainInstructions file149ktodayMITA4,680Codex, OpenCode
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA3,093GitHub Copilot