SageFs / sagefs
AGENTS.md90 starsChanged 3 days agoMITView on GitHub
Read this when you are writing a brief for a sub-agent that will touch F#, or the user says you have drifted off the REPL. If the user says "back to the REPL", "mandate 1", or invokes the SageFs back_to_the_repl prompt, you've drifted. Stop what you're doing, name the step where you left the loop, and pick the loop back up from the REPL. Don't argue it, and don't finish the slow way first. Sub-agents don't inherit any of this.…
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 35,337 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository3 other files it gives its agents.
- AGENTS.mdAGENTS.md
- docs/agents.mdAGENTS.md
- sagefsSkill
The file
We split this agents.md into the rules it gives an agent
6 rules. About 0 are common, 1 is distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 3
Read this when you are writing a brief for a sub-agent that will touch F#, or the user says you have drifted off the REPL.
- Very specific: line 7
If the user says "back to the REPL", "mandate 1", or invokes the SageFs back_to_the_repl prompt, you've drifted.
- Very specific: line 20
Wait for that session's get_session_status to say Ready
- Very specific: line 27
if the REPL will not load a session, say so in the report with the exact error.
- Very specific: line 38
no worktree unless the work must not touch the trunk.
- Very specific: line 56
Put eval "$(sagefs member mint --role Implementer --dir "$PWD" --print-env SAGEFS_MEMBER_TOKEN)" in the brief's setup, or pass --token-file …
≈ “Common” is an estimate: at least 1 in 5 of the 45,344 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Sub-agents and getting back on track
Read this when you are writing a brief for a sub-agent that will touch F#, or the user says you have drifted off the REPL.
Getting back on track
If the user says "back to the REPL", "mandate 1", or invokes the SageFs
back_to_the_repl prompt, you've drifted. Stop what you're doing, name the
step where you left the loop, and pick the loop back up from the REPL. Don't
argue it, and don't finish the slow way first.
Briefing another agent
Sub-agents don't inherit any of this. Every brief for F# work must include the loop explicitly:
get_daemon_status, thenget_available_projectsand the matchingcreate_project_session/create_solution_session/create_bare_sessionfor the agent's own worktree- Wait for that session's
get_session_statusto say Ready - show the failure with
send_fsharp_code - make it pass with
send_fsharp_code - persist to the file
hard_reset_fsi_sessionwithrebuild=true- re-verify, then commit
dotnetonly as the final gate, run in the BACKGROUND, do not block on it- if the REPL will not load a session, say so in the report with the exact error. In
the SageFs repo itself that is a bug in the thing being worked on: fix it or file
it with the paths it names before going on, do not build around it. Anywhere else
report it and use
dotnetfor that one step only. Never write "use the REPL where it works, otherwise fall back" into a brief: it is a permission slip and agents take it. Ask for the actualsend_fsharp_codesubmissions in the report as the evidence the loop was used; "I used dotnet build" is not that evidence - edit with exact editor calls, never
sed/python/bulk regex; prove the change in the REPL before persisting it - finish by removing nothing you do not own, and report your worktree path
and branch so the orchestrator can reap them (
tidy_workspace) - no worktree unless the work must not touch the trunk. An agent that reads or
edits a file or two works in the shared checkout under a claim (
acquire_claim). A worktree is the exception that gets a ledger entry: the daemon records who made it, saves its uncommitted files torefs/sagefs/salvage/<name>, and removes it only after its work has reached the base branch and it has been quiet for a day. Work that exists nowhere else is listed first bysagefs hygiene, andsagefs hygiene --rescue <name>puts it on a branch
The easiest way is to tell it to load this skill.
When the agent's client has no SageFs tools
A client configured with an HTTP URL loses its SageFs tools when the daemon restarts, because the restart ends the one
session id the client holds (claude mcp add sagefs -- sagefs mcp is the durable fix on the client's side). A
sub-agent in that state still has the loop: sagefs call reaches every tool from a shell.
sagefs call --listshows the tools.sagefs call <tool> --<parameter> <value>calls one;--json '{...}'passes the arguments as an object. A name the tool does not have is refused with the names it does.- Put
eval "$(sagefs member mint --role Implementer --dir "$PWD" --print-env SAGEFS_MEMBER_TOKEN)"in the brief's setup, or pass--token-file <path>. Every call is a new connection, so with no token a session one call made cannot be stopped by the next, andstop_sessionis refused. With the token every call is the same member. Do not pass--token <token>: it prints a warning, because the token lands in the process list and the shell history. - The answer is on stdout. A tool error is on stderr with exit code 1. Read the exit code.
When the cohort's conductor seat is empty
get_cohort_status says VACANT when the conductor left, was revoked or went silent, and nobody holds the conductor's
tools until a person says who does. A seated member can ask: seat_conductor (it takes toMember, default yourself, and
working_directory of your repository) puts the question to the person at your client, naming the repository, who would
sit, who held the seat and why it is empty. Only their explicit yes seats anyone.
- A decline, a dismissal, no answer and a client that offers no elicitation all refuse, and nothing changes. Do not ask
again unless the person tells you to. The refusal names the other routes:
sagefs cohort seat <member id>from a shell on the machine that runs the daemon, and the Seat button on the dashboard's cohort panel. - A seat that is held by a conductor whose connection is gone (
get_cohort_statussays the holder is silent and for how long) is replaced the same way: callseat_conductorwithreplacesset to that holder's member id. The person is asked, with the holder and its silence named, and only their explicit yes moves the seat. A holder that is not the holder any more is refused with the actual holder named, and the former holder stays a member with its claims. - Under a member token the tool is not callable, and a member under a token is never the one seated. If you hold a token, the person seats a member that joined on its own connection.
- Meanwhile do what needs no conductor:
acquire_claim,release_claim,request_landing,withdraw_landing,veto_landing.
When a scope is shut by a member that went quiet
acquire_claim is refused while a member holds the scope, and a member that has gone silent keeps its claims until its lease
lapses (30 minutes). get_cohort_status marks such a claim | clearable: ... on its line: its holder has had no open stream
and no call for two minutes, or nobody holds it. If you are the conductor, call release_claim with that claim's id and the
fence on the same line. Naming a claim that is not yours is a clear. It is refused while the holder is here (the refusal says
how long it has been silent), and the old holder's late release_claim is refused as stale. If you are not the conductor, ask
the conductor; do not retry. A landing the holder had queued is blocked as stale when it reaches the front: withdraw it and
request it again. A call under a member token never clears.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

