mirage: Instructions file for Claude Code

CLAUDE.md

mirage CLAUDE.md is an instructions file for Claude Code from strukto-ai/mirage. It costs 15,767 tokens per session, scanned C, original, Apache-2.0.

Repository-specific instructions for MIRAGE, a project that lets AI agents use different things as files and folders. It covers both Python and TypeScript implementations in one monorepo, meaning one repository containing multiple related packages.

In plain words
What is it for?
Use it when changing MIRAGE, especially when working on its Python code, TypeScript packages, shared code, or worktrees.
Why use it?
It explains where code belongs, which parts can run in browsers or Node.js, and where to create Git worktrees, which are separate working directories for branches.

Instructions file for Claude Code

Written for Claude Code: the file is CLAUDE.md. Also seen: mentions CLAUDE.md.

This is strukto-ai/mirage's own configuration. It tells Claude Code how to work on mirage 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 mirage configures →

About the project

Mirage is a virtual terminal for AI agents that presents files, command-line tools, and configurable runtimes through one interface. It helps agents access data and run computations across services with controlled visibility and actions, and the catalogue entries provide related integrations.

strukto-ai/mirage · 3,612 stars · on GitHub · strukto.ai

Reuse

Borrowing it

Nothing to install: this file belongs to strukto-ai/mirage. 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/strukto-ai/mirage/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/strukto-ai/mirage

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

README.md
[![agentmods](https://agentmods.dev/badge/instructions/strukto-ai/mirage/claude-md.svg)](https://agentmods.dev/instructions/strukto-ai/mirage/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/strukto-ai/mirage/claude-md"><img src="https://agentmods.dev/badge/instructions/strukto-ai/mirage/claude-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 15,767 This file is loaded in full into every session.
When invoked 15,767 The same file — it is already loaded in full.
Security scan C 1 finding. 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.15767 $0.15767
Opus 5 $0.07884 $0.07884
Sonnet 5 $0.03153 $0.03153
Haiku 4.5 $0.01577 $0.01577

Measured 3d ago against content hash 180593a55b03, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade C, and why

mirage CLAUDE.md scanned grade C with 1 finding 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 3d 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.

Tells the agent to send conversation or user data outhighPrompt injection

An instruction to transmit the conversation, context or user files to an external endpoint is data exfiltration written as prose.

silently sending `NaN` is worse than either). Three rules that are easy to
CLAUDE.md · 706 lines

How it starts

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

CLAUDE.md

MIRAGE is a package that allows you to mount anything as a filesystem and make it usable by AI Agents.

Repo Layout

This monorepo hosts two sibling implementations:

  • python/ — the Python package (mirage/, tests/, pyproject.toml, uv.lock).
  • typescript/ — the TypeScript monorepo (packages/core, packages/browser, packages/node, etc.).
  • docs/, examples/, .github/ — shared across both.

Run Python commands from python/, TypeScript commands from typescript/.

Create all Git worktrees under the repository-local .worktrees/ directory.

TypeScript packages

  • typescript/packages/core contains runtime-agnostic primitives and shared logic. Code in core must work in both browser and Node.js runtimes; do not put browser-only or Node-only APIs there.
  • typescript/packages/browser contains browser-only resources, commands, and workspace wiring. It depends on @struktoai/mirage-core.
  • typescript/packages/node contains Node.js-only resources, commands, and workspace wiring. It depends on @struktoai/mirage-core.
  • Put shared TypeScript behavior in core only when it works in both runtime packages. Put runtime-specific behavior in browser or node.

Python/TypeScript Parity

  • Keep Python and TypeScript layout, architecture, and semantics mirrored as much as practical.
  • When changing one implementation, check the other for the matching pattern or feature. If one side is more correct, use it to improve the weaker side instead of copying a bad design.
  • For major Python or TypeScript changes, consider adding or updating integration coverage under integ/.
  • The layout half of that rule is gated. scripts/check_layout_parity.py diffs the module-name sets of every mirage/<pkg>/ against its TypeScript counterpart (core/node/browser unioned onto one namespace, plus cli/server/agents by prefix), folding camelCase, hyphens and a leading underscore so a rename reads as a rename rather than a missing module; __init__.py and index.ts are skipped because only Python needs one per directory. Intentional differences live in spec/layout_exceptions.json with a reason, and a stale entry fails as loudly as a new gap. --strict (what CI runs) does not demand zero: it fails when the count moves off the committed baseline in either direction, so new drift is blocked and closing a divergence has to be locked in by lowering the number. Run it without --strict for the full advisory report; that report is how layout work gets scoped.
  • mirage ships no filetype renderers, and no factory for them. Parquet, ORC, feather/arrow/ipc and hdf5/h5 rendering are gone, along with the parquet/hdf5/pdf extras, the hyparquet/apache-arrow/h5wasm dependencies, and the whole commands/builtin/filetype_factory/ package in both languages (with its filetype_read / filetypeRead op knobs). A file with an unregistered extension is read as raw bytes. The one surviving extension point is registration on a mount: a command or op carrying a filetype resolves as (name, filetype) before (name, resource) before (name,). examples/{python,typescript}/filetype/ register a .tally renderer end to end and are gated in CI against integ/truth/*/filetype.json; tests/commands/custom/test_filetype_fns.py and test_unregister_removes_all_filetypes cover the unit path.

Read the full file on GitHub · 706 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. 3d ago Changed · +41 lines · +649 tokens per session 180593a55b03
  2. 9d ago First seen · 665 lines · 15,118 tokens per session scan C d6fc27d710b0

Subscribe to this mod's changes

mirage CLAUDE.md is an instructions file published in the GitHub repository strukto-ai/mirage (3,612 stars, last pushed today), licensed Apache-2.0. It adds 15,767 tokens to every session, about $0.0788 per session on Opus 5. A static security scan graded it C with 1 finding (tells the agent to send conversation or user data out). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other instructions, from other repositories

next.js AGENTS.md

AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,296 tokens

codex AGENTS.md

AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.

openai/codex · 5,153 tokens

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 6,785 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).

microsoft/vscode · 5,001 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,469 tokens

spec-kit AGENTS.md

AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.

github/spec-kit · 7,104 tokens