Skip to content

The .claude/ layer

cd ~/StudioProjects/my-app
echolot init

Installs into the project the knowledge of how to use the tool:

.claude/
├── skills/echolot/
│   ├── SKILL.md              /echolot — the door: reads the state, routes; how to read the report
│   └── references/           report, config, ART names, trace capture
├── agents/perf-hunter.md     subagent: the iterative loop
├── commands/echolot-setup.md /echolot-setup — build the config (reached from /echolot)
├── commands/echolot-hunt.md  /echolot-hunt — find the cause (reached from /echolot)
├── commands/echolot-reflect.md /echolot-reflect — how the session went, what to change in the tool
├── settings.json             permission to call echolot without asking, and the hooks
│                             that hold perf-hunter to its protocol
└── echolot-layer.json        what init installed, file by file — for doctor

echolot ui runs the same command when its Set it up is pressed in a project echolot has never been set up in, and lists these files on the page before it does.

/echolot is the one door. It runs echolot (the status command), shows it, and acts on the next line — echolot status --next gives it as one word: upgrade, init, doctor, setup, fix-config, resume-or-new, init-force, fix-settings, hunt. Setup and hunt are the two commands beside it, invoked through the Skill tool, so only the branch that applies enters the window; they remain callable directly for whoever knows where they are going. A verb wins over the state: /echolot init runs echolot init (not setup — a session once confused the two), and /echolot doctor, /echolot anr … run those commands.

Words are a request, and only one kind of request is a hunt. The door runs echolot first, then takes the first route that fits: an ANR, a freeze or a crash console's issue goes to echolot anr <file>; a question about traces already on disk, with no device, to echolot analyze and echolot report; a measurement with nothing to blame — "record a baseline", "just measure" — to echolot collect and echolot analyze; and a regression to find, hunt <words> or slowness after a change, to the echolot-hunt skill. The first three run without --hunt, outside any investigation. A hunt with an investigation open is asked about first, whatever next says, with "something new" offered first: opening a new investigation closes the open one. All four used to go to a new hunt, which closed the open investigation as abandoned without a word, and the door said to ask and not to ask twenty lines apart (#497).

They are listed in the order next_kind tries them, and the order is part of the design. A layer a newer echolot wrote comes before everything (upgrade): the agent is about to read files written for a newer CLI than the one installed, every later step would be taken with the older one, and init refuses to touch it — so the skill shows the line and stops, and a person upgrades. Next comes what init does on its own — a layer that is missing or stale: the agent is about to read that layer, and init touches nothing the project edited, so there is nothing to ask. Two things about the layer only a person can settle come last, right before a hunt: files edited here that init --all would overwrite (init-force), and a settings.json that does not parse (fix-settings). The skill asks, and either answer leads on to the hunt. Asked first, "keep my edits" had nowhere to lead but to init-force again, and an unreadable settings.json — read as stale — sent the agent round init, which cannot fix it, for good.

The template ships inside the package rather than living in the application repository: knowledge of how to use the tool belongs to the tool. What lands in the project is a copy — edit it for your modules and commit it. A repeated init brings up to date what you did not touch and leaves what you edited alone; --all overwrites those too — it is still init, and the flag says "every file". The skill never runs it without asking: it shows the files --all would overwrite and lets the human choose.

init also adds /.echolot/ and /local.yml to the project's .gitignore — a comment line and whichever of the two patterns is not already covered, appended — but only at a git root. Anywhere else it writes nothing and says so, with the two lines to put in a .gitignore in the project's directory: the patterns are anchored there, and git reads a .gitignore at every level. The traces are tens of megabytes each and local.yml holds a device serial, and both have been documented as gitignored since before anything wrote them there.

One file in that list is not echolot's copy. settings.json is Claude Code's own configuration — the project keeps its hooks and its enabled plugins there — and the template contributes a permission and two hooks to it (below). So it is merged, never overwritten, --all included: the permission and the hooks go in, everything else in the file stays, and lists gain what they are missing instead of being replaced. A settings.json that does not parse as JSON is reported and left untouched, with the line to add printed for a human — a file that could not be read is not a file to rewrite.

The copy goes stale the moment the package moves on, and nothing in the project would say so — a session ran with a collect.md that said "there is no runner yet" while the binary had one, and the agent drove gradle by hand. So init writes a small manifest of what it installed, and doctor (and echolot with no arguments) compares the layer with the template: current, stale (untouched since install, template moved on), customised (edited here, template did not move), conflict (both), missing, and — for the merged file above — unreadable. None of them fails a check: a project may have edited its copy on purpose, and the manifest is what lets the tool tell the two apart. A layer installed before the manifest existed can only be differs.

What each state asks for, and of whom, is decided in one place and said the same way on the one line doctor -q and status print and in the full doctor section:

state what it asks for
newer — the whole layer, see below an upgrade: pipx upgrade echolot (or uv tool upgrade echolot); init refuses
stale, missing echolot init — it touches nothing edited here
conflict, differs echolot init --all, which overwrites every edited file, the customised ones included — so the skill shows the files and asks first
customised nothing: the edit is the whole difference
unreadable a person fixes the JSON; no flag of init touches a merged file

They used to decide separately, and disagreed: one stale file beside one customised read echolot init on the one line and echolot init --all in the full section, and the second would have overwritten the customised file to update the stale one.

A layer from a newer echolot

The manifest also names the echolot that wrote it, and for a long time nothing read that name back. In a team that commits the layer, that was a way to lose an upgrade. One person upgraded echolot and ran init; a teammate still on the older release ran /echolot. Every file the newer release had changed still matched its hash in the manifest and no longer matched the older template — which is what stale means — so next said init, the skill ran it, the older files went back in, the manifest took the older version, and init printed "Layer updated." The newer echolot then did the same in the other direction, and the layer went back and forth with whoever ran init last.

Now the name is read first, before any file is compared, and compared by the numeric parts of the release: 0.10.0 is newer than 0.9.0, and 0.8 is 0.8.0. Development releases, pre-releases and post-releases sort around their release the way PEP 440 orders them, and a local label (+mine) orders nothing. When a newer release wrote the layer, its state is newer, whatever the files say:

  • echolot, doctor and doctor -q name the release that wrote it and the one that is running, and the upgrade — pipx upgrade echolot, or uv tool upgrade echolot;
  • echolot status --next says upgrade, and the skill shows that line to the human and stops;
  • init refuses with exit 1 and writes none of what it installs: not .claude/, not the .gitignore lines, not the pointers for other agents, not the saved choice of agents. The release that wrote the layer may write every one of them differently, and this one cannot know how.

A version that does not read as one — a hand edit, a spelling a later release may adopt — cannot be put in order, and gets the same answer. A layer left alone costs a person one command; a layer rolled back undoes a teammate's upgrade without a word. If an upgrade does not change it, the manifest is what is wrong: delete it, and init adds what is missing and keeps every file that differs until a person chooses --all. A manifest with no name in it at all makes no claim, and its files are judged as before.

There is no flag to go back. The layer is committed and the manifest with it, so returning to an older layer is reverting the commit that brought the newer one, which takes the manifest back too — and afterwards every echolot agrees on what is installed. A flag would do the same thing less well, and it would be one more command for an agent to try on a route whose whole point is that it stops.

The same line is also the only news of a newer release echolot can give: the tool never checks for one, and its only download is the pinned trace_processor, once. A teammate's commit is what brings the news. Two limits. Releases up to 0.7.0 do not read the name, so they still put their files back; the rule holds once the whole team is on a later one. And between releases a checkout carries the number of the last one, so two builds with the same number are the same version as far as this goes.

A private install

init is built for a team that commits its layer. Sometimes the repository is not yours to change: one the team shares, before anyone has agreed to a new tool, or one a client owns. For that there is echolot init --private, which installs the same files and keeps all of them out of git.

  • Where the paths go. Every path init writes goes into the clone's own ignore file, info/exclude. git reads it like a .gitignore and never commits it. echolot asks git where the file is: in a worktree, .git is a file, and the exclude file is the one in the repository it points to. The paths sit in one block between two marker lines, written from the top of the repository, since the project may live in a subdirectory of it.
  • What the block names. The layer's files and its manifest, the pointers init created for other agents, Codex's rule, and /.echolot/, /local.yml and /echolot.yml. A pattern works before its file exists, so the config setup writes later is covered too. Every private init writes the block anew, so a file a later release stops installing drops out of it. The rest of the exclude file is the person's, and init never touches it.
  • No file git tracks is written. An exclude file hides untracked files only, so init asks git which of its targets are tracked.
  • The two .gitignore lines go into the block instead.
  • The permission goes into .claude/settings.local.json, Claude Code's per-machine settings, which it reads beside settings.json. status and doctor look for it there.
  • A tracked pointer file, such as an AGENTS.md with the team's rules, is left alone. init prints the section to paste, as it does for a file that is the project's own.
  • After a shared install, --private puts back what that one added to a tracked .claude/settings.json and .gitignore when echolot's edit is all that differs from the last commit. A file with other changes beside it is left as it is and named, and init does not then say git sees none of the install. A settings.json or .gitignore the shared install created with nothing else in it goes into the block.
  • The choice is kept. It goes into .echolot/hosts.json with the choice of agents, so a later plain init stays private: the one /echolot runs when the layer goes stale, or the plugin door's init --for plugin. The layer line in status and doctor says "private to this clone".
  • echolot init --shared hands it back to the team. It takes the block out and does what a plain init does: the .gitignore lines, the permission in settings.json. The files stay where they are, and git sees them from then on.
  • One exclude file for every checkout. Git has no exclude file of a worktree's own: the main checkout and each linked worktree read the same info/exclude, and the block hides its paths in all of them. So --shared leaves the block in place while another checkout has a private install, says which, and names the ways on: git add -f, or --shared in that checkout first. A private init keeps the other private installs' paths in the block, and says that the paths are hidden in the other checkouts too.
  • Outside a git repository there is nothing to keep from git: init --private says so and installs as usual.

The agents read their files whether or not git ignores them. With everything init wrote kept from git: - Claude Code loaded the skill, the three commands and the subagent; - Codex's prompt carried the AGENTS.md section.

Cursor, Copilot and Gemini CLI were not checked.

Taking it out: echolot uninit

echolot uninit              # the plan; on a terminal it asks before it removes anything
echolot uninit --yes        # without asking — what an agent or a script runs
echolot uninit --dry-run    # the plan alone

init writes into more places than anyone keeps in their head, and a missed one is a stale instruction an agent keeps following. uninit is init read backwards, with init's rules. It takes out:

  • The temporary markers in the sources, the lines mark --apply wrote, the way mark --remove takes them out. A line that carries the tag and something else stays and is named with its file and line, as mark --remove names it. A phone still runs the build with the markers until the app is built and installed again, and uninit says so.
  • The layer: every file of .claude/ that is what init wrote — the template's bytes, or the hash the manifest recorded when init wrote it — and the manifest. A file edited here stays and is named; --all takes it, as init --all overwrites it. While one stays, the manifest stays with it. The manifest's hashes are what let a layer a newer echolot wrote go cleanly: init refuses that layer so as not to roll it back, but taking out what the newer release wrote, as it wrote it, rolls nothing back.
  • The permission and the hooks in .claude/settings.json and .claude/settings.local.json: Bash(echolot:*), the two echolot hook entries, and nothing else. An allow list or a permissions key that taking it out leaves empty goes too; one that was empty before stays. The file goes when nothing else was in it. When the last commit holds the same settings, its bytes go back, so the layout init wrote the merged file in goes as well. A file that does not parse is named and left alone, as init leaves it.
  • The section between <!-- echolot --> and <!-- /echolot --> in AGENTS.md, GEMINI.md and .github/copilot-instructions.md, whichever agents are chosen now. The file goes when the section was all of it; otherwise the lines around it stay as they were, line endings included. A section from before the end marker existed goes when the file is exactly what that echolot wrote. Edited since, it stays: where it ends is not known.
  • Cursor's rule .cursor/rules/echolot.mdc. One whose frontmatter was edited here stays whole until --all, rather than becoming a header with no rule under it.
  • Codex's rule .codex/rules/echolot.rules, when it is what an echolot wrote; an edited one stays until --all. Inside Codex's sandbox .codex/ is read-only, and uninit says to run it outside.
  • The .gitignore lines init appended, with their comment, and the block in git's exclude file after init --private. Only this project's lines leave the block. The block stays whole while another checkout of the repository has a private install, since it keeps that install from git too.
  • The saved choice of agents, .echolot/hosts.json, and the folders init made, once they are empty.

After init --private, uninit writes no file git tracks, as that install wrote none: a permission or a section there is the team's, and it is named.

What stays unless asked:

  • The record of the work. .echolot/ with traces, reports or an investigation in it stays, with its run log, and so does the .gitignore line that keeps it from git: taking that line away beside a folder of traces is how they reach a commit. A .echolot/ holding only the saved choice and the run log goes with the rest.
  • The config, echolot.yml, and local.yml.

--data takes all three, and the .gitignore lines with them.

uninit refuses while a job of echolot ui is running in the project, since it writes into what uninit takes apart. A run that took .echolot/ out leaves no line in the run log, which would bring the folder back.

uninit touches nothing outside the project. It ends with what echolot keeps elsewhere and how to remove it: the command itself (pipx uninstall echolot), trace_processor under ~/.local/share/perfetto/prebuilts/, ~/.cache/echolot/, and the plugin where an agent has it. It also names copies of echolot's skills that Codex's /import or a person made in another agent's folder, and leaves them: they are not echolot's to delete.

tests/test_uninit.py holds the claim to one line of git status: after init with every agent chosen, or init --private, and then uninit, git shows nothing, and every file holds the bytes it held before.

Why a CLI and not an MCP server

  • MCP tools sit in the context permanently, even when unused — a tax on every request
  • a CLI is invoked through bash and costs nothing until it is needed
  • a CLI runs in CI with no model at all
  • it installs with one command, without editing a client config

MCP earns its place where interactive access to state is required. Here there is no state: a trace goes in, a table comes out.

The consequence is portability, and it took a user's report to finish collecting on it. .claude/ is a Claude Code mechanism: a skill found by its description, slash commands, a subagent. In Cursor it is an invisible directory. The CLI worked there the whole time — it is a program — but nothing pointed an agent at it, so the instructions were followed only when the model happened to read SKILL.md while looking around. From the outside that is a tool that "sometimes follows the flow".

What ships now is one command and a set of pointers:

echolot guide          # how to work with this tool
echolot guide setup    # building echolot.yml
echolot guide hunt     # the loop
echolot guide anr      # an ANR report from the field, read and then measured

echolot init writes a few lines into whatever the project shows evidence of — AGENTS.md, GEMINI.md, .cursor/rules/echolot.mdc, .github/copilot-instructions.md — each naming that command. For Codex it writes one more file, which is not a pointer: .codex/rules/echolot.rules, the rule that lets echolot out of Codex's sandbox (see A sandbox with no network).

Gemini CLI has its own entry rather than riding on AGENTS.md, and that is worth recording because the obvious assumption is wrong: its context file is GEMINI.md, and AGENTS.md reaches it only when somebody has set context.fileName in .gemini/settings.json. The documentation shows that as an example of overriding the default, not as a second default. One shared file does not yet cover everyone. On a terminal init shows a set and lets you change it — the choice saved last time, or on a first run the detected set, with whatever the tree shows evidence of marked (found) either way. --for claude,cursor (or --for all) skips the question and replaces the choice, and --no-input keeps it as it is. all is every client but one of a pair: the plugin, or Claude Code where the plugin is chosen already. The .claude/ layer and the plugin bring the same skills and Claude Code would load both, so --for that names the two together is refused, and a layer kept current beside a chosen plugin says so on its line.

The question is asked only when the CLI parser turned it on and there is a terminal at both ends, and never under CI. init is run by agents, and by the self-check's checks of init many times over into temporary directories, under doctor --full and the test suite: a prompt appearing there is a hang rather than a question, so both gates are pinned by checks.

The answer is kept in .echolot/hosts.json, because declining Claude Code has to be a state rather than a moment. .claude/ missing normally means "run init" — on a project that chose Cursor only, that same absence would have next demand echolot init forever. With the choice recorded the layer reads as opted-out, and the next step is whatever the config says.

A state has to be read back as well as written. init without --for starts from the saved choice, and detects only when there is none. It used to detect on every run, and detection names Claude Code whether or not it is there — so init --for cursor followed by a plain init installed .claude/ and wrote the opt-out over. And where a project declined Claude Code, the lines that name the next step — status, echolot hunt "<q>" — name the door it chose, echolot guide, rather than a /echolot its human does not have.

The knowledge is not copied per client, on purpose. Four files would drift apart within two releases, and a copy committed to somebody's repository goes stale the moment the package moves — which is exactly why init has to be re-run for .claude/ and why doctor checks whether that layer is current. Text printed by the installed package cannot be stale. The pointers are stubs, and a self-check fails if one starts growing into a copy.

A file the project wrote itself is never rewritten. When AGENTS.md is already there and has no echolot section, init leaves the file alone and prints the whole section to paste into it, both marker lines included; pasted as printed, the next init finds its markers and keeps what is between them current. It used to print four lines and an ellipsis, and a section pasted from that had no end marker — every later init found an echolot section it could not bound, and left it alone as edited.

What still does not port

The subagent. A client without one runs the loop in the main context, where raw output fills the window and the instability this whole design exists to remove comes back. guide says so in as many words and tells the agent to work in short passes and keep raw output out of the conversation. That is a mitigation, not a fix — Claude Code remains the better experience, and now it is the better one rather than the only one.

reflect reads the full session for Claude Code and for Codex, whose sessions have a reader each. Everywhere else it falls back to the recorder log, which every command writes from every caller — so the report exists, it is smaller, and it says which checks it could not make. See reflect.md under "Without a transcript".

The plugin: one set of skills for Claude Code and Codex

plugins/echolot/ is a plugin both hosts load: four skills — the door, setup, the hunt and reflect — and a manifest. It is not the layer packaged again. Codex loads a plugin's skills and nothing else, turns a command into a skill only when it fits in 4,000 bytes and drops the rest without a word, and has no place for an agent file: today's layer, packaged as it is, arrived in Codex as a door that routed to two skills that were not there (#188). And a second set of texts written for Codex would be the drift #5 closed.

So each skill is a door to a topic, and says little besides what to run. echolot guide <topic> prints the rest, from the files the layer is made of:

topic printed from
overview, hunt, anr the guide's own pages
setup commands/echolot-setup.md
reflect commands/echolot-reflect.md
loop agents/perf-hunter.md — the text a Claude Code subagent is given
report, config, naming, collect the skill's references

One file per text, and nothing printed can be older than the echolot that prints it. The guide used to keep a setup.md of its own beside the command; by then each of the two knew things the other did not, and they are one file now.

The skills carry what a host needs and the guide cannot give: where to go next, and how to hand the loop over. The door runs echolot and routes on next; the hunt opens the investigation, then hands the loop to a subagent that starts with none of the conversation — Codex copies the whole of it into a subagent unless told otherwise — and waits for the conclusion. Nothing in them names a Claude Code tool, and each stays under 4,000 bytes; tests/test_plugin.py holds both, and that every topic a skill names exists.

The hunt skill is the main thread's part whole, and the loop's first message is a brief to fill in, a block the skill and echolot guide hunt print alike (a test holds the two to one text). The main thread never needs the loop's own guide. It used to be told where to find the brief rather than given it, and in two live Codex runs it read echolot guide, guide hunt and guide loop before starting the subagent: about 35,000 characters in the window the subagent is there to protect, guide loop alone half of it, and the subagent read the loop's guide again (#202). With the brief handed over as a block, a live Codex run read echolot guide hunt alone before the hand-off: 5,878 characters of guides, and 13,504 in all against 47,354 in the run before. reflect says when the loop's guide is read in the main context (guides_in_main).

In Codex only the door is listed to the model at all. Each of the other three turns implicit use off in its agents/openai.yaml, and Codex leaves such a skill out of the list a session starts with; a person can still call it by name ($echolot-hunt). So the door reaches them through the guide: echolot guide hunt, setup and reflect print their text, and that is what the live runs read. All four stay out of ChatGPT's chat, where there is no shell to run echolot in.

A project whose skills come with the plugin does not get .claude/ — Claude Code would load the skills twice. The door answers next: init with echolot init --for plugin, which writes the .gitignore lines, saves the choice, and installs nothing else; echolot then reads the layer as provided by the plugin, and stops asking for init. In Codex the door runs echolot init --for plugin,codex, which writes Codex's rule as well.

A person may run echolot first, before any agent. With no choice saved yet, echolot looks for the plugin where each agent keeps it: Claude Code's enabledPlugins in the user's settings and the project's settings.json and settings.local.json (the nearer file decides), and the entries of ~/.claude/plugins/installed_plugins.json installed for this project or its main checkout; Codex's plugin cache; the copy echolot plugin cursor makes. When it finds one, the layer line and next name echolot init --for plugin (--for plugin,codex for Codex's) and the agent that has it. When it finds none, next names plain echolot init and, beside it, --for plugin for a person who has the plugin anyway.

Installing the plugin

.claude-plugin/marketplace.json at the root of this repository is a marketplace with one plugin in it, and both hosts read it:

pipx install echolot                          # the CLI the skills drive
  • Claude Code: /plugin marketplace add grishan0v/echolot, then /plugin install echolot@echolot, or from a shell claude plugin marketplace add grishan0v/echolot and claude plugin install echolot@echolot. The door is /echolot:echolot.
  • Codex: codex plugin marketplace add grishan0v/echolot, then codex plugin add echolot@echolot, or install it from /plugins in the CLI or the Plugins tab of the ChatGPT desktop app. The door is the echolot skill, $echolot in a prompt and echolot:echolot in Codex's list, and it also answers a plain question about slow startup.
  • Cursor loads the plugins Claude Code has installed and enabled, so the plugin installed there is in Cursor too, at the same release. Without Claude Code, copy the plugin into Cursor's folder for local plugins, ~/.cursor/plugins/local/echolot, then restart Cursor or run "Developer: Reload Window" in it:
echolot plugin cursor

The copy is the plugin the installed echolot carries in its package, so it needs no git and no network, and it is always that echolot's release. It replaces an older copy whole. A link at that place, or a folder that is not echolot's plugin, is left as it is, and the command says why. Inside Cursor's sandbox, which lets a command write in the project only, it stops and says so: run it in a terminal, or let the agent run it outside the sandbox when Cursor asks.

Customize lists it, with its four skills. The door is the echolot skill, /echolot in a chat, and the agent opens it by itself for a plain question about a slow start; the hunt hands its loop to Cursor's Task subagent. .cursor-plugin/marketplace.json at the root is what Cursor's team marketplaces import from the repository. It serves the default branch, which between releases can be ahead of the echolot on PyPI.

Cursor's community catalog lists the plugin at cursor.directory/plugins/echolot. The listing shows the text of the four skills, copied from this repository, with a button that copies each one. To use them, install the plugin as above: that keeps the four skills together, at the release of the echolot installed.

Claude Code needs git 2.36 or newer on PATH for this. It fetches plugins/echolot with a sparse checkout of a partial clone, and tries the checkout offline first: git 2.35 and older reach for the network anyway, are refused, and crash with the index still locked, so the retry stops at index.lock: File exists. Ubuntu 22.04 ships git 2.34.1 and the git-scm.com installer for macOS 2.33.0; git from Xcode's command line tools or Homebrew is new enough. Codex installs the plugin with old git as well (#205).

A linked git worktree is the natural place to try the plugin without touching the main checkout, and --scope local did not stay in one. This is Claude Code's behaviour, not echolot's, seen with its CLI on macOS installing echolot 0.17.0 (#597):

cd ~/work/app-worktree      # a linked worktree of ~/work/app
claude plugin marketplace add <path to an echolot clone> --scope local
claude plugin install echolot@echolot --scope local

Both commands said the plugin was declared in local settings. The declaration, extraKnownMarketplaces.echolot and enabledPlugins["echolot@echolot"], went into the main checkout's ~/work/app/.claude/settings.local.json, and the worktree got no settings.local.json at all. ~/.claude/plugins/installed_plugins.json recorded the install with the worktree as its projectPath. So the plugin was on for every session in the main checkout, which had the .claude/ layer from echolot init, and Claude Code listed the skills twice there: /echolot and /echolot:echolot.

Claude Code's own page on plugin scopes says only that the local scope is one repository's .claude/settings.local.json, and nothing about worktrees. So, to try the plugin in one worktree alone, use a separate clone; after a local install from a worktree, look at the main checkout's .claude/settings.local.json. In the case above the two keys were taken out of it by hand. echolot reads the same places: it counts the plugin as installed for a project when installed_plugins.json names that project or its main checkout. echolot uninit leaves those keys alone, since they are Claude Code's and not init's, and says where the plugin is on.

An upgrade is pipx upgrade echolot, and then the plugin: claude plugin marketplace update echolot and claude plugin update echolot@echolot, which Claude Code applies after a restart; codex plugin marketplace upgrade echolot and codex plugin add echolot@echolot again in Codex; echolot plugin cursor again for Cursor's copy. Until then, echolot and doctor say that the copy in Cursor is from another release.

The entry fetches plugins/echolot at the release tag of the version in the code. So what a person installs is the plugin the CLI on PyPI was released with: served from main, it would name topics and flags that no released echolot has yet. A new plugin reaches people with the next release, when the tag and version move together — Claude Code copies a plugin again only when its version changes. tests/test_plugin.py fails when the tag, plugin.json and echolot/__init__.py disagree. The package carries the same plugin: setup.py copies plugins/echolot into the wheel as echolot/plugin, and that is the copy echolot plugin cursor makes.

On a project that ran init before, the .claude/ layer is still there, and Claude Code loads its skills beside the plugin's. Once the plugin's door has run echolot init --for plugin, echolot says so on its layer line and stops asking for init; whether the files go is the human's call, since teammates without the plugin may work from them.

A sandbox with no network

Codex runs every command in a sandbox, and by default the sandbox has no network. On macOS that takes localhost with it. echolot needs localhost twice: it binds a free port before it starts trace_processor, and collect reaches the phone through the adb server on port 5037. So in Codex, as it comes, doctor, analyze and collect all fail.

They used to fail in ways that looked like a broken install: doctor said "could not run — [Errno 1] Operation not permitted", analyze ended in a traceback, and collect passed on twenty lines of adb's startup log. Now each says that a sandbox refused the port, whose sandbox it was when the environment names it (Codex marks the commands it sandboxes with CODEX_SANDBOX_NETWORK_DISABLED), and the way out. doctor logs the reason, so echolot and its next line say it too.

The way out is to let the one command through:

  • Codex: approve running echolot outside the sandbox when Codex asks, or let it out for good with a rule, which echolot init writes when codex is among its agents (below). ~/.codex/rules/ holds the same rule for every project.
  • Claude Code, when its own sandbox is turned on: "echolot *" in sandbox.excludedCommands.

Cursor's sandbox lets localhost through: with Cursor 3.24 on an SM-A515F, analyze, adb devices and collect ran in it and passed. It marks the commands it runs, CURSOR_SANDBOX=seatbelt on macOS, and refuses any .cursor/ it did not make, a temporary project's included. Two checks of init in the self-check write one. They check echolot's own logic, which init and doctor leave to the test suite; doctor --full skips them there, says why, and passes with them skipped. A command on Cursor's allowlist runs outside its sandbox altogether (#204).

Turning the network on for every command is wider than it needs to be, and still leaves the first download of trace_processor nowhere to write: perfetto keeps it outside the workspace. The rule was tried in a live Codex session (#188): with it, all three commands passed, in the main thread and in a subagent.

Codex's rule, from init

codex is an agent of its own in init's list, apart from AGENTS.md: Codex reads AGENTS.md like many clients do, and the rule is Codex's alone. A project with a .codex/ folder gets it by default on its first init; after that the saved choice decides, and --for …,codex adds it, as the codex line of echolot says. init writes .codex/rules/echolot.rules: prefix_rule(pattern = ["echolot"], decision = "allow"), with a few echolot commands as examples that Codex checks when it loads the file, so a rule that stopped matching says so as a session starts. The file is echolot's alone, so it is written whole; an edit made here is kept, and --all puts echolot's back, as with the files of the layer.

Two more rules stand beside it, for ./gradlew and for adb: an investigation rebuilds the app and puts it on the phone, Gradle needs the network and writes under ~/.gradle, and adb needs its server on localhost. With them, Codex runs those two without asking in every session in this project, the way it runs echolot; Dig deeper grants a Codex it starts through them and nothing else. A file an earlier echolot wrote, with the echolot rule alone, is known by its text: echolot, status and doctor say it is from an older echolot and name the init that brings it up to date, and init does, since nobody edited it.

Three things decide whether the rule works, and doctor and status say each of them on a codex line, shown wherever Codex is chosen, has a .codex/ folder and no choice recorded yet, or is what runs the command. A recorded choice that leaves Codex out wins over the folder, which may hold nothing but the project's MCP servers for Codex: the line is gone, and only the full doctor says once that the folder is there and how to add Codex.

  • The file: there, as echolot wrote it, edited, or gone. A rule counts when it is a prefix_rule with the pattern ["echolot"] and decision = "allow", not commented out, in either quote and laid out any way Starlark allows. It is looked for from the directory the command ran in up to the project's root, the first directory with a .git in it, as Codex bounds a project, and under ~/.codex/rules/. A worktree under the main checkout is a project of its own, and the main checkout's rule is not its rule.
  • Trust. Codex reads a project's .codex/ only once the person has said they trust the project, and records that in ~/.codex/config.toml ([projects."<path>"], trust_level = "trusted"). echolot reads that the way Codex does: the folder, then the repository it is in, then the main checkout of a linked worktree. An untrusted project is told both ways out: trust it when Codex asks, or put the same file in ~/.codex/rules/. A rule there is read in every project, so with one in place an untrusted project's own rule hides nothing: the line says in every project.
  • The moment. Codex reads rules when a session starts, a rule under ~/.codex/rules/ as much as a project's. A session open when the rule was written keeps echolot in the sandbox until it restarts.

The rule lets out a command line that starts with the word echolot. python -m echolot is not one, and a refusal under it says so.

One thing init cannot do from inside: Codex keeps .codex/ read-only for the commands it sandboxes (.agents/ and .git/ too), so that no command can let itself out. Tried on codex sandbox, init --for codex there got Operation not permitted making .codex/. So it says that, and names the command to run outside the sandbox — with the project's other agents in --for, since --for replaces the saved choice and --for codex alone would stop keeping .claude/ current.

The AGENTS.md pointer carries one sentence about this, so that an agent which read only the pointer knows why its first analyze failed.

The copies /import leaves

Codex's /import turns a Claude Code project's .claude/ into .agents/skills/echolot/, .agents/skills/source-command-echolot-*/ and .codex/agents/perf-hunter.toml, and rewrites .claude/ to .Codex/ in them on the way. The manifest knows only .claude/, so the layer line went on saying current while an agent in Codex followed copies that described a .Codex/settings.json nobody has. doctor now lists them, says the plugin replaces them, and deletes nothing: someone may have edited them on purpose.

Two things are not copies. A project that keeps one skills directory for several agents may link .claude/skills to .agents/skills; the door init wrote through the link is the layer's own, and is not listed. A door copied by hand into another agent's skills directory (.gemini/skills/, .cursor/skills/, .github/skills/) is listed on the layer line and in the layer section of doctor, unless it is a link to the layer's door.

What calls what

Left is a file an agent reads; right is what it may run once it has. There is one executable in the whole design — echolot — so every arrow lands on a verb of the same CLI a human types.

/echolot                             what the file lets an agent run
 └─ skills/echolot/SKILL.md          echolot · status --next · init · doctor · hunt
    │                                analyze · report · compare · probe · anr · mark
    │                                domains · calibrate
    │
    ├─ references/report.md          report · analyze · probe · explain · guide
    │  └─ references/report-*.md     compare · collect · mark · names: schema, window,
    │                                environment, markers, checks, columns,
    │                                detectors, compare
    ├─ references/config.md          domains · calibrate    → references/naming.md
    ├─ references/naming.md          names
    ├─ references/collect.md         collect · calibrate
    │
    ├─ commands/echolot-setup.md     scan · domains · mark · collect · probe · names
    │                                analyze · calibrate                → echolot.yml
    │
    ├─ commands/echolot-hunt.md      doctor · init · hunt · collect · mark · domains
    │  │                             hunt "<q>" opens it, hunt --done closes it
    │  │
    │  └─ agents/perf-hunter.md      doctor · analyze · report · compare · names
    │     its own window             probe · domains · mark · anr · explain · collect
    │                                hunt --show            + Read Edit Grep Glob
    │
    └─ commands/echolot-reflect.md   reflect          → .echolot/reflect/<id>.json

echolot guide                        the same map, for a client without `.claude/`
 └─ guide/overview.md                echolot · status --next · init · doctor · collect
    │                                analyze · report · compare · domains · hunt
    │                                calibrate · explain · reflect · guide
    ├─ guide setup                   commands/echolot-setup.md, printed
    ├─ guide/hunt.md                 doctor · hunt · collect · domains · mark
    │  └─ guide loop                 agents/perf-hunter.md, printed: the brief a
    │                                subagent is given, or the loop run by hand
    ├─ guide reflect                 commands/echolot-reflect.md, printed
    ├─ guide report | config         references/*.md, printed
    │  | naming | collect
    │  └─ guide report-<topic>       the report's topics, one at a time
    └─ guide/anr.md                  anr · mark

plugins/echolot/skills/              the plugin: four skills, each a door to a topic
 ├─ echolot/SKILL.md                 --version · echolot · status --next
 │                                   init --for plugin[,codex] · doctor · hunt --resume
 │                                   guide
 ├─ echolot-setup/SKILL.md           scan · probe · names · domains · analyze
 │                                   guide setup
 ├─ echolot-hunt/SKILL.md            doctor -q · hunt · collect · mark --remove
 │                                   report · hunt --done · guide hunt · guide loop
 └─ echolot-reflect/SKILL.md         guide reflect

report (views of a report already on disk) sits beside analyze wherever a report is read row by row — the skill, its report reference, the hunter and the guide's overview; scan (the facts setup starts from) is in the setup command, which guide setup prints, and in the plugin's setup skill, and nowhere else. Every invocation in these files and in the plugin's skills, inline or fenced, is run past the CLI's own parser by a test: the verb has to exist and every flag has to be one that verb takes.

Four things the shape says.

The first call is always the same. Every path out of the door begins with bare echolot — the status command — and the skill switches on the word on its next line (echolot status --next prints the word alone) rather than on the look of the project.

The references are one level down. They name verbs, and one of them points further: the config reference sends its reader to the naming one for why thread masks are masks — comm is cut to fifteen characters. Nothing in the layer sits more than three hops from /echolot. Two references are opened from below as well, by the topic guide prints them under, so the same line works with the layer and without it: perf-hunter looks a field up in the one topic of the report reference that holds it — echolot guide report is a page of 8 KB at most that names a topic for each key, guide report-schema and the rest — rather than working the schema out by hand, and one detector up in echolot explain <id>, which prints its part of report-detectors after the header's words (#854); never the whole reference, and never on its first step, which reads the overview and echolot report -d (#493). Setup reads echolot guide collect to capture the probe trace while there is still no config.

One file puts markers in. perf-hunter is the only place that adds anything to the sources, which is what makes AGENTTMP_ a prefix one agent owns rather than a convention several of them have to keep. The main context only takes out: echolot mark --remove, before a new hunt, for the markers an earlier investigation's mark --apply left behind.

One file points back at the others. echolot-reflect proposes changes to SKILL.md, perf-hunter.md and the CLI itself — the only arrow here that returns to where it started.

Why the loop lives in a subagent

This is the most important of the four decisions.

Inside the loop, mess accumulates: raw SQL output, repository searches, diffs of temporary instrumentation, five iterations in a row. In the main context that fills the window within two rounds — and then the very instability this whole thing exists to remove sets in.

The subagent works in its own window and returns only the conclusion:

Against:       <the reference: report N, which build> | none — where this
               build spends its time, against <the budget | late frames>;
               not shown to be what changed
Place:         <file:line or module>
Evidence:      <detector, numbers from the report — measured, nothing else>
Mechanism:     <why this costs that much time; steps it did not measure
               marked (inferred), steps it could not check marked (gap)>
Suggestion:    <what to do>
Confidence:    high | medium | low — and why; with no reference, that it
               costs this, and that it is what changed: not measured
Ruled out:     <what it checked and did not carry to a cause>
Also measured: <every marker it planted, one line and one number each>
Cleanup:       temporary instrumentation removed | none was added

Nine fields, and reflect checks for the eight below Against. Ruled out and Also measured were added after hunts that lost something: an agent measured the redundant work it was looking for at 252.7 ms and returned a conclusion about something else, with no field to put the number in; and a suspect nobody measured to the end costs the next hunt a round spent rediscovering it. Against came from hunts with nothing to compare: see A hunt with no reference.

The same answer is also written as a verdict file, which echolot can check and keep in a form that reads back; see Closing with a verdict.

The loop protocol

round = 1
while round <= loop.max_rounds:
    report = analyze(traces)
    if the config looks wrong  → fix the config, do not hunt a problem
    if everything is silent    → exit: "clean"
    hypotheses = firing detectors → domains → files
    if localised to a place in the code → exit
    if round == loop.max_rounds → exit, before recording what nobody
                                  would analyse
    otherwise: pick a blind spot (usually uninstrumented_cpu)
               add AGENTTMP_ markers inside instrumentation.allowed
               build and install the app, unless the macrobenchmark
                 does it (gradle mode)
               re-record
    round += 1

cleanup: remove every AGENTTMP_ marker
running out of rounds → an interim conclusion from the data at hand

Stopping is hard-coded, not a heuristic. The agent has no goal of its own to economise; without a limit it will spin for days and eat context. max_rounds is set by a human in the config.

Instrumentation rules: write only inside instrumentation.allowed, never into generated or build; prefix every temporary slice with AGENTTMP_; clean up on success and on running out of rounds alike. The prefix is what makes cleanup deterministic — grep and delete, rather than "remember what you added".

Refused while it runs: echolot hook

The rules above are written in perf-hunter.md, and transcripts show them broken anyway: reflect finds the step after the session, when the round it cost is spent. So Claude Code is asked to stop the step as it is taken. echolot hook <event> reads a hook event on stdin and answers in Claude Code's hook format; init wires it into .claude/settings.json beside the permission, and the plugin into its own hooks file. It acts inside perf-hunter alone (perf-hunter, or <plugin>:perf-hunter), and inside a subagent that ran echolot guide loop, which is how the plugin's hunt starts its loop: the plugin carries no agents, since Codex drops them, so its loop runs in a subagent with no type of its own, and only the guide it starts on says it is the hunter. That subagent is noted in a file under .echolot/hook/, named by its session and its id, and the file goes when its stop goes through. In every other session and agent the hook answers at once and changes nothing.

Event What is refused What the agent reads instead
PreToolUse, Edit or Write a source file outside instrumentation.allowed, or under build/ or generated/ the allowed folders, by name
PreToolUse, Bash report.json, or a report an investigation filed, read with cat, jq, python and their kind the echolot report view that prints the same
PreToolUse, Bash trace_processor started, code that opens a trace, a trace's bytes read echolot report, names, probe
SubagentStop a verdict echolot hunt --verdict would refuse, or none written since the investigation opened the check's problems, as it names them
SubagentStop temporary markers still in the sources, and a verdict that does not say "cleanup": "left" what echolot mark --remove takes out and what goes by hand

A refused call does not run; the model reads the reason in its place. A refused stop keeps the subagent working once: the second stop (stop_hook_active) always goes through, so a hunt cannot loop on the hook. The rules are reflect's, read off the same predicates — mark's allowed, the readers trace_opened_directly knows — so a step the hook lets through is one reflect does not count either.

The hooks live in settings.json and the plugin's hooks file rather than in perf-hunter.md's frontmatter: Claude Code ignores hooks in the frontmatter of an agent a plugin ships. The plugin's file is hooks/claude-code.json, named by .claude-plugin/plugin.json and by nothing Cursor's or Codex's manifest reads: hooks/hooks.json is the name both look for by themselves, each in a format of its own. Cursor does import a project's .claude/settings.json hooks; its events carry no agent_type or agent_id, and the hook says nothing to them.

It runs on every Edit, Write and Bash call of every session in the project — with the plugin, of every project — so most calls never reach it. The command wired is a line of sh that reads the event and leaves before Python starts when there is no echolot.yml, when the call is the main conversation's (no agent_id), and when it is a subagent's that names neither perf-hunter nor a guide while no subagent is on the loop: about 5 ms a call, against about 110 for the interpreter. Inside the hunt echolot hook answers in about a seventh of a second, never starts trace_processor, and lets the step through on anything it cannot read: input that is not JSON, a config that does not load, an error of its own. It always exits 0, and the line ends in exit 0: an echolot from before the command exits 2 on a word it does not know, and exit 2 from a PreToolUse hook is a refusal of the call — every call of the session. Claude Code runs the line in sh, and in Git Bash on Windows; without Git Bash it runs hooks in PowerShell, which cannot read it, so the PreToolUse hook says "onFailure": "continue" and the call goes ahead there too.

Each refusal is a line of .echolot/log/hooks.jsonl. reflect reads it: a row of trace_opened_directly, edits_outside_allowed or report_sliced_by_hand that the hook refused says refused: by echolot hook, a signal whose every row was refused is info instead of warn — the step was tried and did not happen — and hook_refused lists them all, the stops among them. A layer installed before this has no hooks until init runs again, which the stale layer line already asks for.

Which investigation, and where that is asked

.echolot/traces/ and .echolot/out/report.json mean "the latest set" and nothing more. For a while the tool had no way of saying what question that set was recorded for, so /echolot a week later found history, attached to it and carried on — whether or not the human had come back for the same thing. Old cold-start traces answered a question about scrolling; thresholds calibrated for one scenario gated another; markers left behind by an investigation that ran out of context became the starting conditions of the next one.

.echolot/hunt.json is the missing label: one open investigation at a time, holding the question in the human's words, when it opened, what it has been through, and the config it was opened against. It sits in .gitignore next to the traces — an investigation is the state of a machine, while echolot.yml describes the project and is committed.

echolot hunt is where that state is read and written — one noun with one home. It began as four hidden flags on status, which made a reporting command mutate state and left the concept without a name a person could find; status reports, hunt is the investigation. The word means the same in a shell and after /echolot: echolot hunt "<q>" does the half a shell can do and names the half it cannot, /echolot hunt <q> does both.

next_kind reads it and gains one word, resume-or-new: there is an investigation open, it left traces or a report behind, and nobody has worked on it recently enough for this to be the same sitting. The CLI still asks nobody anything — it prints the recap and the word, and the skill puts the question with AskUserQuestion. That keeps status usable from CI, where there is no one to answer.

The loop never sees the question, by construction rather than by a flag. The question is which investigation to work in; perf-hunter is handed one in its prompt, so for the loop the question cannot arise. It never calls status at all. And the two set-aside boundaries do not meet: collect moves traces aside between rounds, opening an investigation moves them aside between investigations, and both use the same primitive at different levels.

A second guard falls out of the same design: every collect and analyze run inside the investigation updates touched_at, so a running loop keeps its own investigation inside the freshness window even if it started from a stale one. touched_at means the investigation's work rather than "when someone last typed echolot", which is what makes the freshness rule honest.

Inside is said, not assumed: --hunt <n>, which the hunt command and perf-hunter pass on every collect and analyze, by the number echolot hunt printed when it opened. A run without it is outside any investigation, whatever is open: nothing of it is filed, touched_at stays, a collect in flight does not stand in for the investigation's work, and the first scenario is the default. Every run used to count. A cold-start baseline recorded two months after a question about scrolling went into that investigation as its eighth report and renewed it as worked on that day, so the next /echolot carried on with the scroll question on cold-start traces, without asking and without the "untouched for 68 days" line (#498). A number that is not the open one exits 2 before anything is recorded, so a run meant for one investigation is never filed under another that opened since.

Starting a new investigation is where the value beyond the question sits. The previous one is archived rather than deleted — the question someone was chasing three weeks ago costs a kilobyte and cannot be reconstructed from the traces. The loose trace set moves aside, so the new investigation cannot inherit it, and where it moved to is recorded against the investigation it belonged to. That last part is what keeps the archive from being decoration: set_aside already returned the directory it created, and dropping that return value left the record remembering a question with nothing behind it. Investigations are numbered so there is something short to name one by — echolot hunt --show 2.

Some of that loose set may have been recorded for the very question being opened — the human captured the traces, then asked. They are moved, not lost, and they are still that question's evidence: the command hands the agent the directory echolot hunt names, rather than recording them again.

An investigation is about one scenario. In a config that names several, echolot hunt --scenario feed_scroll "<q>" opens it on that one, the first without the flag, and only that scenario's loose set moves aside. Inside it, collect --hunt <n>, analyze --hunt <n>, calibrate and report take its scenario when no --scenario is given, and say so on stderr: one forgotten flag measured the first scenario, and the investigation's evidence then mixed two journeys. A collect or an analyze without --hunt is not inside it, and takes the first. The scenario is the question's, so a config that no longer has it is drift, named among the signs that the investigation is not the one being asked about. /echolot-hunt picks it from the human's words, by the scenarios' names and anchors that echolot status and echolot.yml give, and asks when the words fit more than one. With one scenario the words are held to it all the same, by its name, its window and its runner: a question about a list that stutters once went into the only scenario there was, a cold start, and its scroll traces were recorded by hand outside collect (#539). When the words fit none, the hunt proposes a scenario of its own before anything is recorded. /echolot-setup adds one to a config that has one without starting over: the scenario there moves under scenarios: as it was, and the new one is probed and anchored with the human the way the first was — its start from the probe's start candidates, the tap or the intent a command's journey begins with. A journey a script paces is a command runner that drives the screen with adb shell input swipe (400 ms or more a swipe: a shorter one lands as a tap on a loaded phone), reset_policy: none, no anchors so the whole recording is the scenario, and duration_ms longer than the script; or the project's own frame-timing macrobenchmark (FrameTimingMetric) in gradle mode. --scenario with a name the config lacks refuses with exit 2, opens nothing, and says those two shapes.

A hunt with no reference

A regression is a change, and a change is two builds. Asked "after which change", the human often has nothing better than "unknown", or the words are about how it is now: "the list stutters". In a fault-injection run, five blind cold-start hunts with no build from before the change all named the same place, a cost the app has had all along, and a control with no change at all named it as its cause with medium confidence. With one set, the loop returns the costliest place, changed or not.

So before anything is recorded the hunt asks for a reference, the cheapest first: traces of an earlier build already on disk (an earlier investigation's rounds, a set recorded on a release before), an earlier build to install and record (the store build, a release's APK, a commit before the change), or none. With one, it is a regression hunt: the reference is analysed under the investigation first, filed as a report of its own, and compare sets the build measured against it. The same build recorded twice is no reference: it says how far the numbers wander, which each report's repeats already say.

With none, the brief says Reference: none and the loop answers another question, where this build spends its time. It says first what counts as slow for the scenario and how the build stands against it — the window against budget_ms for a launch, the frames the app made late for a scroll, Buffer Stuffing being latency rather than a stutter — skips compare between rounds, which with nothing changed in the app would compare only its own markers, and asks of each candidate how much of the slow part it accounts for. Its verdict names no reference, and echolot reads it as the costliest places wherever it is shown. echolot hunt "<q>" with no change named says so when it opens.

Who opens it, and who closes it

On the Claude Code path both ends belong to the echolot-hunt command. It opens the investigation with the human's question and the change (--since) before anything is recorded for it — unless the human is carrying on the one already open — and closes it with echolot hunt --done when perf-hunter returns, whatever the answer was: with the verdict file the agent wrote, or one line of the conclusion when there is none.

For a while the path opened one only when the door asked resume-or-new and the human chose something new, and closed none. collect and analyze file only into an investigation that is open, so on every other route analyze kept no copy of its report and perf-hunter's bare echolot compare said there was nothing to compare; and a hunt that had finished stayed open, so the next visit was asked resume-or-new about work that was over.

perf-hunter itself never opens or closes one. It is handed an open investigation in its prompt and works inside it, which is the same boundary as the question above: which investigation is settled before the loop starts.

Started from echolot ui (Dig deeper from the page), the page opens it: echolot hunt "<the question>" --since unknown, the question taken from the report. Then it starts Claude Code with /echolot-hunt and a request that says the investigation is open, its number, the folder the report's recordings were set aside into, that nobody is at the keyboard, and what it may run: the three facts are all in it, so the command carries on in the open investigation and asks nothing. Codex gets the same request, told that echolot guide hunt prints the steps /echolot-hunt would. It closes it as on every other route, with the verdict. When the agent ends without one, the investigation stays open, and the page's Close the investigation closes it with echolot hunt --done and a sentence on what came of it.

While a collect records a round for the open investigation, neither a new question nor hunt --done (with or without --verdict) goes ahead: both exit 2 and say how far the collect got. Closed under it, the round was no part of the conclusion, and its analyze --hunt was refused once it finished. A collect outside the investigation, or for another one, does not hold --done.

Closing with a verdict

echolot hunt --done "<text>" keeps one string, and a string can be read and nothing else: it cannot be checked, and two hunts cannot be set side by side. What the loop returns has a shape every time, so a hunt can also be closed with that shape as JSON:

echolot hunt --done --verdict .echolot/verdict.json     # a file, or - for stdin
echolot hunt --verdict .echolot/verdict.json            # only checks it, records nothing
{
  "summary": "Nearly all of the extra time is one call, Store.fill(): 1.5 s of the 2.1 s launch.",
  "against": {"report": 1, "what": "the release before the change, 4.1, recorded on the same phone"},
  "inside": {"report": 2, "location": "AGENTTMP_fill"},
  "causes": [
    {
      "title": "The store is filled in about 150 small transactions",
      "where": ["store/StoreFiller.kt:70-88"],
      "mechanism": "About 3,000 rows go in through about 150 transactions.",
      "evidence": [
        {"report": 2, "detector": "uninstrumented_cpu", "location": "arch_disk_io_0"},
        {"report": 3, "location": "AGENTTMP_insert_cards"}
      ],
      "cost_ms": 1150,
      "cost_of": "wall time of the inserts, as the AGENTTMP_insert_cards marker measured it",
      "fix": "One transaction for the whole fill.",
      "expected_ms": [300, 400],
      "confidence": "high",
      "confidence_why": "three runs in each of two rounds, within 10% of each other"
    }
  ],
  "suggestions": [
    {"fix": "Ship the rows in a prebuilt database instead of filling it at launch.",
     "expected_ms": [1000, 1400]}
  ],
  "ruled_out": [
    "Layout inflation: 41 ms in each of three runs, as before the change",
    "Garbage collection: no pause above 8 ms in any run"
  ],
  "also_measured": [
    "AGENTTMP_fill: 1,480 ms",
    "AGENTTMP_insert_cards: 1,150 ms"
  ],
  "cleanup": "removed"
}

Required: summary; causes, a list that is empty when nothing was found; and in each cause title, where (a list of places in the code) and evidence. A verdict with one cause and no estimate is a verdict. Optional: against, mechanism, cost_ms with cost_of, fix, expected_ms, confidence (high, medium or low) with confidence_why, inside and cleanup (removed, none_added or left) — and three lists at the top of the verdict. ruled_out and also_measured are the Ruled out and Also measured lines of the text conclusion, one string each. suggestions are changes that belong to no one cause, such as one change that makes several go away: each is {"fix": "…", "expected_ms": …}, fix required and expected_ms as in a cause. None of the three points at a row, so only their shape is checked. A field outside these lists is refused, at any level, so a misspelt optional one does not vanish without a word.

Cost and estimate. cost_ms is what a cause costs, as measured: a number of milliseconds, or [low, high] when the runs differ, which the agent took from its rows. cost_of says what that number measures ("wall time of the inserts", "processor time on the disk threads", "of the launch") and is allowed only with cost_ms. expected_ms is what the fix should win back, the agent's estimate, a number or [low, high] as well. They are two fields so that a measurement is never taken for a guess, by a reader of the verdict or by a page drawn from it. Only their shape is checked: echolot does not recompute a cost from the rows, and hunt --show says a single measured number as it is and a single estimate as "about".

Against. against is what the build measured was set against: report, the number the reference's report is filed under, and what, which build it is, in words, since no report records a build. It is held to the reports: the reference is one this investigation filed and reads, it measured the same scenario as the reports set against it, every cause cites a row of a report other than the reference, and inside is in one of those. A verdict without it is one with no reference: --show, --list and the page read its causes as where the build spends its time, each cause's confidence as what it costs, and say beside it that whether it is what changed was not measured. That is decided by the field, not by the summary's words, so a hotspot is never shown as a regression because a sentence called it one.

What is checked. Every evidence entry, and inside, has to be a row of a report this investigation filed. report is the number a report is filed under (reports/003.json is report 3, which analyze prints when it files it); location is the row's location as the report holds it, compared as written; detector is optional, and without it the row may be any detector's or one of the markers'. A verdict that cites a row no report holds is refused: each entry and the reason is named on stderr, the exit code is 2 and nothing is recorded, so the investigation is still open for a corrected file. The check reads the verdict and the filed reports and nothing else, which makes the same verdict against the same reports accepted or refused the same way. It is the only thing echolot judges: the content is the agent's, and nothing is rewritten, ranked or filled in.

Checking without closing. echolot hunt --verdict <file>, with no --done, makes that check and stops. It prints that the verdict would be accepted, or every entry it would refuse, and exits 0 or 2; it counts the markers in the sources the same way and says where they disagree with the verdict's cleanup. It records nothing and the investigation stays open. It is for the agent that wrote the file, which has the evidence in front of it and can put a refusal right before it returns: perf-hunter is told to run it, and never to close the investigation, which is the main thread's. The closing runs the same check again, so the two ends judge a verdict by the same rules. Like --done, it exits 1 when no investigation is open or the last one is already concluded.

What is recorded. hunt.json gains verdict, the file as it came, and verdict_check, what echolot found when it was handed in: the reports it held, how many rows the verdict cites, the report it was set against (against, null with no reference), and the temporary markers that hunt counts in the sources (the same count hunt "<q>" makes for the previous investigation) next to what the verdict said about them. A disagreement is not a refusal; it is said on stderr and kept in both halves. conclusion is the verdict's summary, or the text given beside it, so --list, status and the recap read a verdict hunt as they read any other. echolot hunt --show <n> prints the verdict as text.

The answer as a page

A verdict in a terminal is for whoever ran the hunt. For the person who asked there is the same answer as a page, in the shape the report's page has:

echolot hunt --show --html                          # the last investigation: .echolot/hunts/<n>/answer.html
echolot hunt --show 2 --html                        # the one named, by number or by part of its question
echolot hunt --done --verdict verdict.json --html   # close, and write the page of what was just closed

The file goes into the investigation's own directory, beside its record and its reports, and the command prints where it is. It is one file that opens from disk: nothing is fetched, and the same record and reports give the same bytes. From the top:

  • The verdict, in a tile at the top: the first sentence of summary as the headline, the rest under it, and how many rounds the investigation took. A round is one report it filed. An investigation that recorded nothing itself, with no collect --hunt in it, says "no new recording" in place of that count: its rounds read recordings made before it opened, as an agent from Dig deeper does when it answers from the report it was handed. Under it, what the build was set against: the reference's report and build, or "No reference", which says the causes are where the build spends its time and none is shown to be what changed.
  • A split bar in the same tile, when the verdict names a piece with inside and that row is still in its report: the piece against the rest of the window.
  • A tile per cause, in the order the agent gave them: what it costs as measured, what happens, where in the code, what to do, and what the change is expected to win back. A change that belongs to no one cause (suggestions) is a tile after them.
  • Details, on a cause's tile, opens it in place: how sure the agent is of it, and the rows the cause cites, as bars, each from the round it was measured in. They are looked up in the filed reports when the page is written, by the rule the check above uses, and nothing is copied into hunt.json. A report deleted since leaves a sentence where its rows were, and the page is written all the same.
  • Checking again, a tile: the command that records the app once more and compares it with the investigation's first report, to copy.
  • Closed tiles at the end: how sure the agent is of each cause — with no reference, that it costs this, and beside it that it is what changed was not measured — with what echolot looked at itself (the rows cited, the markers left in the sources); how it got there, round by round; what was ruled out and what else was measured; and the investigation's own facts, with the two commands about it: echolot hunt --show N prints it as text, and echolot reflect --hunt N reports how the agent that worked in it went (Reflect).

A cause has no level of attention. A level is worked out by echolot from measurements (plain), and a cause carries the figures the agent gave: cost_ms is the figure in large type and said to be measured, expected_ms stands in a chip of its own beside "The agent's estimate, not a measurement", and a cause with neither shows neither.

Each round is read from its report and from nothing else: how long the window was and on how many recordings, how many checks found something, how much of the main thread's window the rows name, how many temporary markers were in the app, and when the report was written, counted from when the investigation opened.

An investigation with no verdict has a page too. One closed with a text shows the text and its rounds. A verdict with "causes": [] says plainly that no cause was found, which is a result, and shows what was ruled out at once. One that is still open shows the rounds so far, which is its progress, and one left unfinished says that it was.

The page beside an investigation is always of that investigation as it stands. Once an answer.html is there, it is written again when a round is filed by analyze, when hunt --done closes the investigation, and when the next question is opened over an open one, with --html or without. Where there is no page, none is written unless --html asks. It gates nothing: asking for a page that cannot be written is exit 2, and at closing the investigation is closed either way.

Filed under the investigation, without moving

.echolot/traces/ and .echolot/out/report.json stay exactly where they are: they are what every example, every CI job and the agent read, and moving them would rewrite all three for tidiness. What changed is that each artefact is also filed under the investigation it belongs to.

.echolot/
├── hunt.json                    the open investigation; a closed one stays
│                                here, readable, until the next one opens
│                                (a verdict, when it closed with one; whether
│                                each report filed is a round or a look)
├── hunt.lock                    held while a command changes the records, so
│                                two at once wait for each other
├── traces/                      the working set — unchanged
│   └── coldStart-<stamp>/       a round, pushed aside by collect
├── out/report.json|md           the latest report — unchanged
└── hunts/
    └── 1/
        ├── hunt.json            the record, archived when the next one opens
        ├── reports/001.json…    a copy per analyze, oldest first
        └── answer.html          the investigation as a page, when one was
                                 asked for (hunt --show --html)

Only a run inside the investigation is filed: collect --hunt <n> records the round it pushes aside, analyze --hunt <n> copies its report. One round is recorded whoever pushes it aside: the set a run outside the investigation moves is still filed under the investigation that recorded it, read off the last collect's progress file, since it is that investigation's evidence and the record is the one place that says where it went. A new question moves the loose set aside the same way, and files it under the investigation it closes only when that one recorded it: not when the last collect says it ran outside it, nor when the traces were written after it was concluded.

echolot hunt --done marks the record concluded where it is; echolot hunt "<q>" is what moves it here. Bare echolot hunt reads the one in place and says whether it is open — a concluded one used to be headed "Open investigation", which told an agent deciding whether to open one that one was.

A hunt.json that is there and does not load — cut short, empty, or JSON that is no object — stops nothing, as before. It is no longer silent: status, hunt and the start page of echolot ui say ".echolot/hunt.json does not load: … — the open investigation is unknown" where the investigation would be, and the next echolot hunt "<q>" moves the file to .echolot/hunts/hunt.json.unreadable-<stamp> before it opens a new one beside it. A field holding what echolot never writes there ("reports": "abc", a number in opened_at) reads as unknown, and the rest of the record is shown.

Reports are copied, trace directories are recorded by path. That asymmetry is deliberate: a report is tens of kilobytes and there is no other way to see what an investigation concluded at each step, while traces run to gigabytes and copying them would be a way to fill a disk.

Two return values had to stop being dropped for this to work. collect called set_aside and discarded the directory, so a hunt that ran four rounds remembered only the last; it now hands it to the caller through on_set_aside. And analyze overwrote one report.json for every question in the project. And the sources are scanned for leftover AGENTTMP_ markers, split by who can remove them: lines mark --apply wrote carry its tag and mark --remove takes them out, while ones an agent added by hand carry only the prefix and have to go by hand. One number for both would send a human away believing the tree was clean. A tagged line in any other shape is counted too, by its file and line: mark --remove leaves it, since it holds more than a marker (an agent's one-line try { work() } finally { android.os.Trace.endSection() }), and hunt, its cleanup check and the page in echolot ui say it goes by hand.

From a shell

/echolot runs all of this for you. By hand, or to look back:

echolot hunt "cold start was 3s, now 7s" --since "the tab redesign"

That opens one, moves the previous set of traces aside without deleting it, and says whether the last investigation left temporary markers in your sources. echolot hunt on its own says what is open.

echolot hunt --list          every investigation, newest first
echolot hunt --show 2        one of them in full — including where its traces went
echolot hunt --show 2 --html the same one as a page; without the number, the last one
echolot hunt --resume        carry on with the open one
echolot hunt --done "..."    record what it came to
echolot hunt --done --verdict verdict.json
                             the same as a structured verdict, checked first
echolot hunt --verdict verdict.json
                             only check a verdict: records nothing, closes nothing
echolot hunt --done … --html close as above, and write the answer as a page

Each one is numbered, and everything it produces is filed under it: every round of traces by path, every report as a copy in .echolot/hunts/<n>/reports/. So a question asked three weeks ago still knows what was measured to answer it, and what each round concluded on the way.

You rarely type any of it. /echolot reads the state and, when an investigation has been sitting untouched with traces behind it, asks whether to carry on, start something new, or record a new report outside it — and never asks inside the hunting loop, which re-records and re-instruments on purpose. By hand, --hunt <n> on collect and analyze is what files a run under the open investigation; the By hand: line echolot hunt prints carries it.

Three things this layer closes

The agent never looks at the trace. The rule is the first item in the skill, with the proportion attached: on a large app's cold start, 255 rows and about 240 KB of report.json, read through an overview of about 3.5 KB. Without it stated plainly, an agent will open the trace itself and everything built here is wasted in one go.

The loop is isolated. See above.

Knowledge about ART is written down, not rediscovered. references/naming.md holds facts from live Android 14 and 13: how GC cycles are named and why their phases must not be counted separately, which locks are application-level and which are runtime-internal, how a synchronous binder transaction differs from an async one, that comm is truncated to 15 characters. Every one of those cost a trace and several iterations to establish. Without them written down, an agent works it all out again on every project.

Setup as inverted configuration

/echolot-setup exists so the user never opens the config. The agent obtains everything obtainable and asks only about what exists neither in the repository nor in the trace — of roughly 25 fields, four need a human decision.

The order matters: scan, capture, reconnaissance, and only then conversation. By the time of the first question the agent holds real options from a real trace:

Ran a cold start. Last slices before the first frame:
  1) Choreographer#doFrame*        @ 772 ms
  2) activityResume                @ 731 ms
  3) Compose:recompose             @ 690 ms
What counts as "the app is ready to use" for you?  [1]

The agent does not decide; it presents candidates and asks for confirmation. That makes it impossible to get wrong, and the answer is fixed in the config for good.

Every field carries provenance — _source and _evidence — so a human sees what to double-check, an agent knows that confirmed_by_user is untouchable, and when something goes wrong you can see where the nonsense came from.