Lichii Is Emulating the Switch 2, and It Wrote an Operating Manual for AI Agents

A yuzu descendant ships a live debug server, a 17-game compatibility table, and a strict upstream-first protocol. The most interesting file in the repo is the one written for the robots.

9 min read • View on GitHub • More from zortos293

An overhead workbench scene in black ink on white. A game console sits in a dock with a dark screen beside an open laptop showing a scrolling terminal log and a small JSON payload. A thin cable connects the two, and a single articulated mechanical hand reaches in from the upper right, holding a fine-tipped probe over the console's vent. The illustration frames the article's two subjects at once: the hardware being emulated and the AI agent that watches it.
Two subjects, one cable. The console is the target; the probe is the agent.
Key Takeaways

A Fork That Aimed at Hardware Nobody Had Emulated

The repository describes itself plainly: Lichii is an experimental, open-source Nintendo Switch and Switch 2 emulator written in C++. It is GPL-3.0, roughly 95 percent C++ by bytes, and its default branch is named nx2.

Switch emulation is a crowded, well-mapped field. Switch 2 emulation is not. The console is new, its firmware keeps moving, and public documentation for the hardware is thin. Targeting it means chasing a goalpost that shifts under your feet, on a codebase inherited from a project that no longer exists.

Lichii does not ship games, keys, or firmware. Users supply their own, and the README asks them to use only legally obtained files and to back up saves before running an experimental build.

The snapshot figures are modest for this ambition: around 2,891 stars, 445 forks, and 147 open issues, as of the repository at time of writing. The project's own release notes are careful not to oversell. Build 88 states that performance varies by hardware and scene, that gameplay timing has not been fully verified, and that no universal FPS gain is promised.

And yet the strangest part of Lichii has nothing to do with the console at all. It is a file in the repository root called AGENTS.md, and it is addressed to machines.

The Repo Has a Job Description for Its AI Co-Worker

AGENTS.md is not a style guide. It is a workflow contract for AI coding agents working on the emulator, and it reads like the rules you would hand a new engineer in their first week.

An extreme close-up in black ink on white of a single sheet of notebook paper on a desk. The paper shows a hand-drawn checklist with three boxes ticked and a fourth box, labeled write new code, left empty and circled in pen. A small floating JSON payload of three key-value lines hovers beside the page, and a single mechanical fingertip rests on its edge. The empty fourth box visualizes the central rule of the protocol: reconcile with upstream before writing anything.
Three boxes ticked, one circled. The empty slot is the whole ethos of the file.

The first rule is reconciliation. The agent must add the upstream Eglantine remote, fetch it, check open and closed pull requests and issues, and read the actual diffs, not just the titles. If the branch is behind upstream, merge first. If an upstream fix already exists, port it and cite the PR or commit. Only when nothing upstream addresses the root cause is the agent allowed to write new code.

That sequence is the point. In a fork ecosystem, the most common failure mode is duplicated work. Someone upstream fixes a bug, a downstream fork fixes it again from scratch, and the two patches drift apart. The protocol makes the agent check before it types.

Then come the operational restrictions, and they are specific. The agent may never start or stop the emulator. It must restore every shader hash it rejects. It must use full 16-digit hashes. It must not run capture loops while the owner is playing. A shader replacement that happens to reduce fog is, in the file's own framing, not proof of an emulator fix.

There is also a comment policy that will feel familiar to anyone who has reviewed AI-generated code.

The file also carries a table of 17 known game program IDs, so the agent can map a raw log line from the emulator to a title like Mario Kart World, Donkey Kong Bananza, or Kirby Air Riders without asking. That table is the bridge between a player's bug report and a proposed fix.

A JSON Port Into a Running Game

How an AI agent moves from a player's bug report to a proposed fix inside Lichii.

A debug build of Lichii launches with a live JSON server bound to 127.0.0.1:6545. The agent can talk to a running game over a local socket. A status call looks like this.

// request
{ "method": "status" }

// response
{
  "running": true,
  "title": "010015100B514000",
  "build": "nx2-<sha>",
  "framebuffer": "640x360"
}

The methods are small and concrete. status returns the emulator's current state. screenshot returns the framebuffer. log_tail returns recent log lines. capture_frame grabs a frame for inspection. reject_shaders marks a shader as broken. The same Python entry point can also run as a stdio MCP server, which means the workflow can be wired into any agent runtime that speaks the Model Context Protocol.

Three environment switches change what the emulator records. EDEN_NX2_SVC_TRACE logs every supervisor call with its arguments and results. EDEN_NX2_IPC_TRACE logs every IPC command and any non-zero result word. EDEN_NX2_AUTO_STUB answers every unknown service command with an empty success and records that it did.

There are RenderDoc rules too. Captures stay on the owner's machine, because a replay can change timing and hide a race condition. Before an agent rules out a synchronization bug, it has to reproduce the problem in a comparison that was not captured. A captured run that looks clean proves less than it seems.

What It Inherits, and What It Owes

Lichii is one link in a chain. yuzu is the root. Eden and Sudachi are yuzu descendants. Eglantine is the immediate upstream that Lichii fetches from. The repository states the relationship directly: Lichii builds on Eglantine, Eden, yuzu, and Sudachi, and it retains their original notices and third-party licenses.

In 2024, yuzu settled with Nintendo and shut down. Every emulator that followed carries that shadow. Lichii's answer is to be explicit about where it stands.

This is an independent fork, not an official release of those upstream projects. Lichii is not affiliated with Nintendo.

Lichii project, Project description in the repository · zortos293/Lichii README

The rebrand also keeps the past on purpose. Lichii retains the existing Eden and Eglantine data directories and configuration keys, so a user coming from those projects does not lose saves, settings, or shader caches. Internally, the CMake project is still named yuzu, a small fossil of the lineage that the build system never renamed.

How Lichii Compares

ProjectLanguageStated lineageSwitch 2 targetAI agent workflowData continuity
LichiiC++Eglantine + Eden + yuzu + SudachiYes (default branch nx2)Yes (AGENTS.md, live debug server)Keeps Eden/Eglantine dirs and config keys
EglantineC++yuzu + Eden lineageNot statedNot documentedN/A
EdenC++yuzu lineageNot statedNot documentedN/A
yuzuC++OriginalN/A (discontinued 2024)NoN/A
SudachiC++yuzu lineageNot statedNot documentedN/A
RyujinxC#IndependentNot statedNot documentedN/A

Star counts and statuses for the comparison projects are not asserted here; check each repository for current figures. Lichii's figures are a snapshot from the repository at time of writing.

The table is factual, and so is the caveat. Lichii is not the fastest emulator, not the most compatible, and not the most stable. The project says so itself. It is a fast-moving fork with an experimental Switch 2 target and targeted renderer fixes, aimed at people willing to run pre-release builds and file useful reports.

The Takeaway

Lichii is two experiments running at once. One is technical: emulating hardware that is still new, on a codebase inherited from a project that no longer exists. The other is procedural: maintaining a large C++ emulator with AI agents in the loop.

The second bet may outlive the first. Switch 2 emulation will either mature or stall, but the pattern of handing a model a rulebook, a live probe into the running program, and a leash on what it is allowed to touch is portable. If you are going to let an agent near your codebase, that is the shape of the thing you have to build. Lichii just wrote it down first.