agentleFS
sriinnusriinnu/omit/skills/omit-codemode/SKILL.md

omit-codemode

Skill0 starsChanged 2 months agoMITView on GitHub

Explore a repository with one sandboxed script instead of many separate reads and searches, so only the answer reaches the conversation. Use when a task needs three or more reads or greps, a loop over files, or a count or summary across the codebase. Read-only.

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Every separate read or grep puts its raw output into the conversation, where it is paid for again on every later turn.

    line 10
  2. Distinctive:

    If the command says its sandbox is not installed, give the user the install line it prints and carry on with ordinary tools.

    line 48

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

omit codemode

Omit needless context.

Every separate read or grep puts its raw output into the conversation, where it is paid for again on every later turn. Write one script instead: the reads happen inside it, and only what it returns comes back.

Run it

omit codemode run <<'EOF'
const libs = (await tools.files({ under: 'lib' })).filter((f) => f.endsWith('.mjs'))
const sources = await Promise.all(libs.map((path) => tools.read({ path })))
return Object.fromEntries(libs.map((f, i) => [f, (sources[i].match(/^export /gm) ?? []).length]))
EOF

Quote the delimiter ('EOF') so the shell leaves the script alone. Exit status 1 means the script failed or its result was withheld.

The script

The body of an async function: await and return work at the top level.

CallResolves to
tools.files({ under? })string[]: tracked and untracked files, minus what git ignores
tools.read({ path })string: one file as text
tools.grep({ pattern, under? }){ path, line, text }[]: extended regular expression; no match is []

text(value) adds to the output and return adds the returned value. A call that fails rejects with an Error; use Promise.allSettled to keep the calls that worked. Run independent calls together with Promise.all.

There is nothing else in there: no file system, network, process or timers. Paths are relative to the current directory and cannot leave it.

Return the conclusion

  • Return counts, names and the few lines that matter, not file contents. Past 20,000 characters the middle of the result is cut.
  • A result that contains a secret is withheld whole. Filter it out in the script.
  • A script has 60 seconds.

When not to

  • One file or one search: use the ordinary tool.
  • Anything that writes. Codemode is read-only: make edits with the ordinary tools, where the sentinels see them.
  • If the command says its sandbox is not installed, give the user the install line it prints and carry on with ordinary tools. Do not work around it.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.