# Apply fixes with your agent

loadsheet writes no file of yours. Each finding carries fixes, and your coding agent applies the ones you accept.

Paste [the prompt](https://loadsheet.dev/docs/guide/fixes#the-prompt) into Claude Code, Codex or another agent, on the machine you want to clean up. The agent then:

1. Runs `npx loadsheet --json` and keeps the Report.
2. Shows you the findings in plain words, ranked by the tokens each would save, and asks which to apply.
3. Applies only the fixes you accept, one at a time, and shows you each command before it runs it.
4. Runs loadsheet again and tells you which findings are gone.

## The prompt

Copy everything in the block below.

```text
Use loadsheet to find context my coding agents pay for and don't use, then help me fix it.
Change nothing until I accept a fix.

1. Run `npx loadsheet --json` and keep its stdout, the Report. A first scan can take a few
   minutes. If it exits non-zero or stdout has no Report, show me its stdout and stderr and stop. Exit code 2
   means a bad flag or config file; 1 means it could not read this machine.
2. If the Report's `schema` is not 1, tell me this prompt is for schema 1 and stop.
3. Read `findings`. Before changing anything, present them to me in plain words, grouped by
   `rule` and ranked by `savesTokens.value` (tokens every session would save; findings without
   it last). For each: the item (or, when it has none, the harness and the `via` entrypoint),
   what its `evidence` numbers mean, what it saves, and what its fixes would change. Say in
   one line which rules did not run (`skipped`). Ask which to apply.
4. Apply only the fixes I accept, one at a time. Each finding lists its fixes in `fixes`.
   - `machine`: act only when it names the machine you run on. The Report's `machines` lists
     the machines read; a local Report holds one, this machine. In a fleet Report, yours is the
     one named like `hostname`; if none is, ask me. List fixes for other machines for me to run
     there. A fix with no `machine` (a pack's Report) goes to the pack's own files.
   - `path`: A memory path is a display label, not a target. On the named machine, `shorten`'s
     `run` prints the real path without editing it; `remove` resolves it before moving anything.
     Other paths are absolute, home-relative, or relative to the pack's folder in a pack Report.
   - `harnesses` lists which harnesses this edit applies to. If omitted (as in older or pack
     Reports), identify the applicable harness from the target and installation when needed.
   - `run`: show me the exact command first, then run it. Never alter it.
   - `set`: write `key` = `value` into the file at `path`, keeping the value's JSON type (the
     string "24000" stays a string). `key` is a dotted path in the file's own format:
     - `settings.json` (JSON): `skillOverrides.<name>` is the `<name>` entry of the
       `skillOverrides` object; `env.NAME`, such as `env.SLASH_COMMAND_TOOL_CHAR_BUDGET`, is a
       key of the `env` object; `promptCacheTtl` and `cleanupPeriodDays` are top-level keys.
     - `config.toml` (TOML): `skills.config[path="~/x/SKILL.md"].enabled` is `enabled` in the
       `[[skills.config]]` entry whose `path` is exactly that value. Add the entry, with that
       `path`, when there is none. The last entry that matches a skill wins, so put it after
       every other `[[skills.config]]` entry; the end of the file is fine.
     - `agents/openai.yaml` (YAML): `policy.allow_implicit_invocation` is
       `allow_implicit_invocation` under `policy`.
     - `SKILL.md` and an agent file such as `~/.claude/agents/<name>.md`: the key, such as
       `disable-model-invocation` or `model`, goes in the YAML frontmatter at the top.
     Create a missing file or parent key. Keep everything else in the file as it is. Show me
     the lines you changed, and nothing else from a file that holds keys or tokens.
   - `hide-from-model` carries a `set` (apply it as above): the model stops invoking the
     skill on its own, and I can still call it by name.
   - `shorten`: say when to use the skill in fewer characters in its SKILL.md `description`, or
     keep one short line per memory outside `archive/` in a `MEMORY.md` (limits: `evidence` or
     `config.rules`). After `stale-memory`, remove links only to notes reported as archived,
     even if other moves failed. For an installer-managed skill (`managedBy`), don't edit the
     installed copy; tell me to make the change in its source (`pack`, if present) or to ask
     its author. If `managedBy` is missing for a skill outside pack mode, check how the copy
     at `path` was installed before editing it. Show me the new text and wait for approval.
   - `remove` with a `run`: before running it, look for links into `path` and for work in it
     that exists nowhere else (`git status`, unpushed commits); if any, stop and ask me.
   - `remove` with no `run`: ask me how to remove it; never guess a command.
   - `dedupe`: a second copy of a skill, which the harness does not load; its `run` removes
     only the copy at `path`. Apply it as `run` above.
   - A finding with no fixes: tell me about it and change nothing.
5. When done, rerun `npx loadsheet --json`. loadsheet reads past sessions, so a finding can
   stay until new sessions have run without the item. Once the Scan shows that the model can
   no longer invoke a copy, its finding stops offering a hide or turn-off for that copy on
   this machine. An item you removed no longer has a `path` on its line in `sheet[].lines`.
   Tell me which fixes are in place, which findings are gone, which remain, and what each
   session will save.
```

## The kinds of fix

| Action            | What the agent does                                                                                                                                                                                                                                              |
| ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `hide-from-model` | Sets a key so the model stops invoking the skill on its own. You can still call it by name, such as `/pdf`.                                                                                                                                                      |
| `set`             | Writes one key and value into a settings file, such as `~/.claude/settings.json` or `~/.codex/config.toml`.                                                                                                                                                      |
| `shorten`         | Rewrites the skill's `description` in fewer characters, and waits for your approval of the new text. For a skill a plugin, the skills CLI or fleetrc installed, it tells you to change the source instead, since the next update would undo an edit of the copy. |
| `remove`          | Runs the command that removes the item. First it looks for links into the folder and for work that exists nowhere else, and asks you if it finds either.                                                                                                         |
| `dedupe`          | Removes a second copy of a skill that the harness does not load.                                                                                                                                                                                                 |

A fix names the machine it is for. In a [fleet report](https://loadsheet.dev/docs/guide/fleet), the agent applies the fixes for its own machine and lists the others for you to run there.

A finding may stay after its fix. loadsheet reads past sessions, so the item drops out once new sessions have run without it.

Without an agent, `npx loadsheet` prints the same findings and fixes as text.

<!-- vitehub-docs:section-links -->
## In this section

- [Install and first run](https://loadsheet.dev/raw/docs/guide.md)
- [Read the report](https://loadsheet.dev/raw/docs/guide/reading.md)
- [Apply fixes with your agent](https://loadsheet.dev/raw/docs/guide/fixes.md) (this page)
- [The report as a web page](https://loadsheet.dev/raw/docs/guide/web-page.md)
- [Weigh a skill pack](https://loadsheet.dev/raw/docs/guide/packs.md)
- [Several machines](https://loadsheet.dev/raw/docs/guide/fleet.md)
- [Privacy](https://loadsheet.dev/raw/docs/guide/privacy.md)
- [Coding agents](https://loadsheet.dev/raw/docs/guide/agents.md)

Next: [The report as a web page](https://loadsheet.dev/raw/docs/guide/web-page.md)

All pages: [llms.txt](https://loadsheet.dev/llms.txt)
