mirage
CLAUDE.md3.7k starsChanged 4 months agoApache-2.0View on GitHub
MIRAGE is a virtual terminal for AI agents: a bash-compatible shell over one virtual filesystem that mounts anything (object stores, SaaS, databases, disk) at a prefix. It is the control plane between an agent and its data: every backend is reached through one async-native op dispatcher, with an index, a read-through cache and per-mount policy in the path, so a listing costs one request and a refused action never reaches the service. It is implemented in Python and in TypeScript…
Trending
Less talk lately.about the whole repository
Who's talking about strukto-ai/mirage
- @camilleroux.com“Mirage : un système de fichiers virtuel unifié pour les agents IA. S3, Google Drive, Slack, GitHub, Redis… …”Bluesky · May 22, 2026 · 3 likes
- @pythonhub.dev“Mirage A Unified Virtual Filesystem For AI Agents. https://github.com/strukto-ai/mirage”Bluesky · May 19, 2026 · 2 likes
- roomedia/ax-trend“Mirage: AI 에이전트를 위한 통합 가상 파일 시스템 (Unified VFS)”GitHub · May 29, 2026 · 1 reactions
- @spinscale.bsky.social“mirate - a unified virtual filesystem for AI agents So, instead of tools, the current trend is to convert …”Bluesky · May 22, 2026 · 1 likes
- sudosubin/agents.nix“codex-plugins.github.strukto-ai.mirage: init at 0.0.6”GitHub · Oct 4, 2026
The biggest 5 of 19 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 19
Talked about on GitHub and Bluesky (19 times).
On GitHub · 16
- May 29, 2026Mirage: AI 에이전트를 위한 통합 가상 파일 시스템 (Unified VFS) — roomedia/ax-trend1 reaction
- Oct 4, 2026codex-plugins.github.strukto-ai.mirage: init at 0.0.6 — sudosubin/agents.nix0 reactions
- Oct 4, 2026codex-marketplaces.github.strukto-ai.mirage: init at 0.0.6 — sudosubin/agents.nix0 reactions
- Oct 2, 2026agent-skills.github.strukto-ai.mirage: init at 0.0.6 — sudosubin/agents.nix0 reactions
- Sep 7, 2026Weekly discovery: new DeepSeek Harness ecosystem candidates — fendouai/awesome-deepseek-harness0 reactions · 1 comment
11 more on GitHub
- Sep 5, 2026Cooperative builtin processing and incremental cache hashing — sonhmai/mirage0 reactions
- Aug 31, 2026Weekly discovery: new DeepSeek Harness ecosystem candidates — fendouai/awesome-deepseek-harness0 reactions · 2 comments
- Aug 29, 2026catalog: add bytecii-mirage-dsh (community curation, created by @bytecii) — diegosouzapw/awesome-omni-dsh-plugins0 reactions
- Aug 24, 2026Weekly discovery: new DeepSeek Harness ecosystem candidates — fendouai/awesome-deepseek-harness0 reactions · 1 comment
- Aug 17, 2026Weekly discovery: new DeepSeek Harness ecosystem candidates — fendouai/awesome-deepseek-harness0 reactions · 1 comment
- Aug 15, 2026docs: add mirage-dsh — Dominic789654/awesome-deepseek-harness0 reactions · 1 comment
- Aug 15, 2026docs: add mirage-dsh — 0xsline/awesome-deepseek-harness0 reactions
- May 29, 2026Mirage: Unified VFS for AI Agents — roomedia/ax-trend0 reactions
- May 14, 2026[Exploratory] See if there's any way to integrate Mirage into the interface — METResearchGroup/lab_data_integrations_interface0 reactions
- May 12, 20262026-05 GitHub TOP 可用项目收藏清单 — abc468810-sys/OpenClaw-Hao123-Portal0 reactions
- May 11, 2026Analysis: Mirage — Unified Virtual Filesystem for AI Agents (strukto-ai/mirage) — humanjack/ai-engineering0 reactions
On Bluesky · 3
- May 22, 2026Mirage : un système de fichiers virtuel unifié pour les agents IA. S3, Google Drive, Slack, GitHub, Redis… montés côte à côte sous une même… — @camilleroux.com3 likes and reposts · 2 replies
- May 19, 2026Mirage A Unified Virtual Filesystem For AI Agents. https://github.com/strukto-ai/mirage — @pythonhub.dev2 likes and reposts
- May 22, 2026mirate - a unified virtual filesystem for AI agents So, instead of tools, the current trend is to convert everything to a structure that… — @spinscale.bsky.social1 likes and repost
In this repositoryOne other file it gives its agents.
- AGENTS.mdAGENTS.md
The file
We split this CLAUDE.md into the rules it gives an agent
5 rules. About 0 are common, 1 is distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 58
Keep Python and TypeScript mirrored.
- Very specific: line 70
Never swallow an exception.
- Very specific: line 72
Never annotate as object. Use FlagValue, JsonValue, str | PathSpec, Accessor, IndexCacheStore | None, StatFn, or a one-member Enum for a …
- Very specific: line 91
Shell commands: follow POSIX and GNU coreutils.
- Very specific: line 158
Follow tables live in workspace/lookup/constants.py.
≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
CLAUDE.md
MIRAGE is a virtual terminal for AI agents: a bash-compatible shell over one virtual filesystem that mounts anything (object stores, SaaS, databases, disk) at a prefix. It is the control plane between an agent and its data: every backend is reached through one async-native op dispatcher, with an index, a read-through cache and per-mount policy in the path, so a listing costs one request and a refused action never reaches the service. It is implemented in Python and in TypeScript with the same layout and the same semantics.
Development
Commands
- Python lives in
python/(mirage/,tests/). Setup:cd python && uv sync --all-extras. Add dependencies withuv add. Test:uv run pytest. - TypeScript lives in
typescript/(packages/core,node,browser,cli,server,agents,dsh,opencode):pnpm install,pnpm build,pnpm typecheck,pnpm test. Rebuild the dists after a merge; integ and the examples import them. - Lint everything:
./python/.venv/bin/pre-commit run --all-filesfrom the repo root (the venv binary, soexamples/is included). - Examples run from the repo root with the venv interpreter:
./python/.venv/bin/python examples/python/s3/s3.py. - Do not add a changeset.
typescript/.changeset/stays as it is for now: the public interface is still moving, so a per-PR version note describes a surface that changes again before it ships. Nothing gates on one. The release notes get written once the interface settles.
Gates
scripts/check_layout_parity.py --strict: module sets ofmirage/<pkg>/against the TypeScript twin; the count must equal the committed baseline. Exceptions live inspec/layout_exceptions.jsonwith a reason.scripts/check_symbol_parity.py --strict: the top-level names of each module pair, the same ratchet overspec/symbol_exceptions.json. A module constant uses the short name (BUILDER,PROMPT,IO); a file needing several imports them as namespaces (import * as column).scripts/gen_specs.pyandtypescript/scripts/gen-specs.tsregeneratespec/;scripts/check_spec_parity.pydiffs command specs, VFS registries and config fields across the two languages.scripts/check_barrel_surface.py: everycoreexport has a consumer.integ/: one JSON case corpus runs on both hosts against the same targets and goldens. Any change in observable shell behavior adds a case. A pull request runs only the integ jobs whose path filter matches (charted ininteg/README.md), so adding, moving or renaming a module updates the filters intest_integ.ymland that chart.
Patterns
Modules split by role, the same in both languages: types.py (shapes
only), errors.py, config.py (knobs; fail loud on unknown fields),
constants.py, mixin.py (stateless capability mixins, detected with
isinstance), base.py (the ABC and nothing else).
- Keep Python and TypeScript mirrored. Change both sides; the more correct side wins.
- Async-native (
aiofiles,redis.asyncio,aioboto3). Never callasyncio.run()where a loop may already be running. - Imports at the top of the file. A cycle means the dependency direction is wrong; fix the design.
- Package
__init__.pybarrels resolve names on first use (PEP 562__getattr__over an_EXPORTStable,TYPE_CHECKINGimports for the checker), so importing a leaf never loads its package. ThemirageCLI loads only its HTTP client and imports a heavy verb's code inside that verb (mcp,workspace create), as the TypeScript CLI awaits it;scripts/check_cli_cold_start.pygates both hosts. - Never swallow an exception. Log it with
logger.debugor let it propagate. - Never annotate as
object. UseFlagValue,JsonValue,str | PathSpec,Accessor,IndexCacheStore | None,StatFn, or a one-memberEnumfor a sentinel. - A path is a
PathSpecwherever possible, never a raw string. - A nested function must close over its enclosing scope; otherwise it goes to module level.
- Tests mirror
mirage/1:1, with no__init__.pyundertests/. Patch a backend command throughcmd.__wrapped__.__globals__. - Docstrings type their Args. No comment at the top of a file, no per-line comments, few prints. Do not rename files or add READMEs unless asked. No backward compatibility.
FileStat.sizeis the rendered byte length orNone, never a storage-side number.
User-exposed surfaces
Change these deliberately, in both languages, with a golden or gate in the same PR.
- Shell commands follow POSIX and GNU coreutils. Pin GNU with docker
(
debian:stable-slim) before changing semantics and document a divergence where it lives. Exit codes and stderr wording are part of the contract. CommandSpec,Operand,Optionare shared by every command. Add a field only when POSIX and argparse both already have the concept, named after theirs.CLISpecis aCommandSpec, so it gets no exemption.- CLIs (
CLISpec) are the agent's tools, dispatched by name. An account CLI declares aconfig_modeland consults no mount;gitdeclares none and reads its repository throughCLIDoors.register_cliis host-side only; there is no install builtin. A CLI that mimics a real program is gated against that program (integ/ntn_conformance.ts). - Mount configs are one snake_case block with one door per language,
build_vfsandbuildVfs(parseConfigWithSchema). Field sets are gated byspec/*/vfs.jsonandinteg/config/. - YAML keys, the
mirageCLI output, the server API and the agent adapters are public. A TypeScript API change gets a changeset. - Handlers take
(accessor, paths, texts, opts). Read flags through a spec-boundFlagView, never raw. Generics own flag interpretation and parse once into a frozen struct; backend wrappers are wiring only.
Design
Workspace
Workspace (workspace/workspace/) holds mounts ({prefix: VFS | Mount}),
sessions, runtimes, policy and the op dispatcher. It executes a line,
registers CLIs and snapshots state. Mount adds MountMode and
MountBackend (workspace | fuse | fskit; workspace means inside mirage
only).
VFS
One backend adapter per prefix (vfs/, BaseVFS, VFSAdapter): object
stores, SaaS, databases, disk, RAM. Each backend is four layers with one
name: accessor/x.py (client), core/x/ (pure functions), ops/x/ (op
table), vfs/x/ (adapter and config model). vfs/registry.py
(known_vfs_names, build_vfs) and the entry-point group mirage.vfs are
the registry. A VFS never stores a symlink, reports leaf files only, and
classifies an entry through stat, never by name.
POSIX layer
What the agent sees over every VFS. Ops (ops/, OpsRegistry) are the
syscall-shaped table a mount answers: read, write, append, stat,
readdir, mkdir, rmdir, unlink, rename, truncate; the dispatcher
(workspace/dispatcher/) resolves a virtual path to a mount and calls them.
Commands (commands/builtin/) are the coreutils: a generic implements a
family once (generic/), generic_bind/ binds it to a backend,
crossmount/ and executor/fanout.py handle a line that spans mounts. The
namespace (workspace/mount/namespace/) sits above every backend with the
mount table, symlinks and the attribute overlay; MountView and LinkView
ride CommandOpts (opts.ns) into every handler. A filetype registration
on a mount is the only renderer extension point.
Pinned behavior: find -size rounds up and the start row is the generic's;
du derives directory rows, sorts siblings, counts bytes and exits 1 on a
usage error; tar and zip plan on one traversal (scan_operand) and never
cross a descendant mount; MountRootPolicy answers EBUSY for a mount root
under rm/mv/mkdir/... and refuses it as a source of tar -c, zip,
cp.
Shell
shell/parse/ (tree-sitter-bash) builds the node tree workspace/node/
runs; workspace/expand/ expands and classifies words; workspace/lookup/
holds the one precedence list (builtin, namespace command, function, CLI,
mount); workspace/executor/ runs pipes, redirects, jobs and control flow.
Follow tables live in workspace/lookup/constants.py. Every session write goes through
SessionView.set, so a pre_session rule is enforced; only shell
bookkeeping and seed_var are exempt.
CommandSpec
commands/spec/: the argparse-shaped grammar, parse_command,
compile_spec, FlagView, help, usage and GNU option prefixes.
UsageStyle (ARGPARSE, GIT, CLAP) on the root spec sets help layout,
refusal wording and exit code. operand_base (tar -C) is resolved by the
parser, before classification.
CLISpec
commands/cli/: a typed program tree bound to a head word. One
CLIInvocation per leaf; inv.doors (dispatch, stat_path, ns,
session_view) is the only way to a mount. man, --help, type -t and
which derive from the spec. ntn is the worked example (CLAP voice, a
serde_json-faithful scanner, exit 1 for a bad body and 5 for a bad line).
Sessions, policy, history
workspace/session/: env, cwd, functions, jobs; stores for RAM, disk,
redis, s3. policy/: pre_command, pre_session, profiles and scripts;
builtins mount_root, output_cap, permissions. observe/: a hidden
Observer records every top-level command; /.bash_history and the
history builtin are two views of that one recording.
Runtimes
runtime/: Runtime, RuntimeConfig, EvaluatorMixin, reach
workspace | process | remote. WorkspaceRuntime (default) runs inside
mirage; MontyRuntime and wasm run in-process; SSHRuntime and
DaytonaRuntime run remote. RuntimeVFS bridges a guest's file ops back to
the dispatcher.
FUSE and FSKit
fuse/ (python) and node/src/fuse/: MountCore owns the semantics,
MirageFS is the libfuse adapter, classify_error is the one errno table.
direct_io plus attr_timeout=0 keep unknown sizes correct. Python fskit
writes need fuse/darwin.py. One FUSE mount per process on macOS. Never
touch your own TypeScript mountpoint synchronously.
Records, cache, watch, spec, integ
workspace/record/: keyed-record clients (disk lockfile plus rename, s3
CAS) that sessions, the node table and metadata import, never the reverse.
cache/: the read-through file cache and the index a readdir fills.
watch/: external changes as mount events. spec/: generated specs per
host. integ/: runners, fake services (server/), goldens (truth/),
targets.json; spawn asynchronously, a fake on the same loop deadlocks a
sync spawn.
Architecture
flowchart TD
App["application · agent adapter · mirage CLI · server"] --> WS["Workspace.shell(line, session)"]
WS --> Parse["shell parser<br/>shell/parse (tree-sitter-bash)"]
Parse --> Expand["expansion + classification<br/>workspace/expand"]
Expand --> Lookup["lookup<br/>builtin › namespace command › function › CLI › mount"]
Lookup --> Exec["executor<br/>workspace/executor"]
Exec --> Policy["policy<br/>pre_command · pre_session"]
Exec --> Runtime["runtime routing<br/>workspace · process · remote"]
Exec --> Handler["command handler<br/>(accessor, paths, texts, opts)"]
Spec["CommandSpec · CLISpec · FlagView"] -.-> Handler
Handler --> Dispatch["op dispatcher<br/>workspace/dispatcher · ops"]
Runtime -. RuntimeVFS .-> Dispatch
FUSE["FUSE · FSKit"] --> Dispatch
Dispatch --> NS["namespace<br/>mount table · symlinks · attr overlay"]
NS --> VFS["VFS<br/>ops table → core → accessor"]
VFS --> Backend[("backend API")]
Watch["watch"] -.-> NS
Session["session · history<br/>stores · record clients"] -.-> ExecOne backend, bottom to top:
flowchart LR
A["accessor/x.py<br/>client"] --> C["core/x/<br/>pure functions"] --> O["ops/x/<br/>op table"] --> V["vfs/x/<br/>adapter + config"] --> M["mount at a prefix"]
W["commands/builtin/x/<br/>backend-aware wrappers"] -.-> MRepository:
python/mirage/ accessor core ops vfs commands workspace shell runtime policy
observe cache watch fuse cli server agents
typescript/packages/
core/ runtime-agnostic twin; no Node-only or browser-only API
node/ browser/ runtime-specific VFS, commands, wiring, FUSE (node)
cli/ server/ agents/ dsh/ opencode/
spec/ integ/ docs/ examples/ scripts/Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

