agentleFS
jungjaehoon-lifegamezjungjaehoon-lifegamez/MAMA/AGENTS.md

MAMA

AGENTS.md15 starsChanged 14 days agoMITView on GitHub

Shared instructions for every coding agent working in this repository (Claude Code, Codex, and others). Claude-only notes live in CLAUDE.md. - Read INTENT.md before starting or resuming work. Tie every plan and change to one of its owner checks (recognise, attach, answer, report, learn) or to the shared-engine goal. - The product is "Kagemusha's loop + a wiki + memory that carries over". What sets it apart is task history and similar-case search. Team features wait until the owner flow…

  • Reads credentials
  • Installs packages
  • 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 repository2 other files it gives its agents.

The file

We split this AGENTS.md into the rules it gives an agent

10 rules. About 0 are common, 7 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈7

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Read INTENT.md before starting or resuming work.

    line 8
  2. Distinctive:

    mechanisms only: Never copy names, channels, business content or other personal data from it.

    line 35
  3. Very specific:

    Check an action exists in the catalog (core api/catalog.ts plus the product registrations) before assuming it does.

    line 36
  4. Very specific:

    Run a single package or file from inside that package.

    line 49
  5. Distinctive:

    Check claims of absence ("nothing calls X") at the assembly point where things are wired together, not by grep alone.

    line 72
  6. Very specific:

    Never print ranges of ~/.mama/config.yaml.

    line 74
  7. Distinctive:

    No PII: no personal names, project names or channel IDs in source, comments, examples or test fixtures.

    line 80
  8. Distinctive:

    Build from evidence: Before adding a mechanism, screen, field or action, name the code, the data or the owner decision that requires it.

    line 86
  9. Distinctive:

    Relocate before you delete: Before removing a host step, lane brief or policy line, name the place where its domain knowledge and owner …

    line 90
  10. Distinctive:

    No insurance guards or fallbacks: Do not add a guard or an alternate path just because you are unsure.

    line 93

≈ “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.

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

AGENTS.md

Shared instructions for every coding agent working in this repository (Claude Code, Codex, and others). Claude-only notes live in CLAUDE.md.

Purpose first

  • Read INTENT.md before starting or resuming work. Tie every plan and change to one of its owner checks (recognise, attach, answer, report, learn) or to the shared-engine goal.
  • The product is "Kagemusha's loop + a wiki + memory that carries over". What sets it apart is task history and similar-case search. Team features wait until the owner flow works on real data.
  • Work is done when real owner questions on real data get the right answer. Passing tests, structure checks, line or file counts, and progress scripts are supporting evidence only. Never report a finished sub-task as the purpose being met.
  • The current work list is docs/development/plan.md. After each item, add 3–5 lines to docs/development/checks.md: result, evidence, what still fails. Both are working documents: commit them straight to main, without a PR (owner, 2026-10-06).
  • What a better model would fix is not product work. A problem counts only when a perfect model could not solve it with today's tools, data and write paths. A done condition checks what the program delivers, not whether the model obeys it (owner, 2026-10-06).

Repository map

PackageRole
packages/mama-coreShared engine: storage, records with revisions, search, embeddings, memory, raw observations, runtime, action catalog. Used by MAMA and by other projects
packages/standaloneProduct (MAMA OS, mama CLI): connectors, owner loop, tasks/board/wiki/reports, viewer
packages/mcp-serverPublic MCP server (plain JS) for Claude Code / Desktop
packages/claude-code-pluginClaude Code plugin (hooks, commands) for development-session memory
  • There are two data homes. ~/.mama/ is the daemon's (product) state. ~/.claude/mama-memory.db is MCP and development-session memory. Never mix them.
  • Kagemusha is a local reference implementation outside this repository. Read it, and port mechanisms only. Never copy names, channels, business content or other personal data from it.
  • Check an action exists in the catalog (core api/catalog.ts plus the product registrations) before assuming it does.

Commands

pnpm install
pnpm build
pnpm typecheck
pnpm lint
pnpm test

Run a single package or file from inside that package. Running from the repo root with --root gives false failures.

cd packages/mama-core && npx vitest run tests/unit/some-file.test.ts
cd packages/mama-core && npx vitest run -t "pattern"

Verification gotchas

  • launchd manages the daemon (com.mama.server), restarting it after a failure, so a killed process comes back. Stop it before touching ~/.mama: mama stop, or launchctl bootout gui/$(id -u)/com.mama.server. The daemon runs the Node and the MAMA command on the exec line of ~/.mama/start.sh, which mama service install writes.
  • Live behaviour is proven by an owner turn, a clean ~/.mama/logs/daemon.log, and a DB read-back. A row existing in the DB is not proof on its own.
  • ~/.mama is a disposable testbed: no backups, compatibility windows or dual reads. Use daemon.log to see which branch ran, never to argue about cost or frequency.
  • ~/.claude/mama-memory.db is not disposable. Scripts and benches set MAMA_DB_PATH before initDB(), because the default is that database.
  • Tests that touch config or the home directory run under a temporary $HOME. One of them once overwrote the live config.
  • A bench claude -p runs with --setting-sources project, or the plugin hooks contaminate it.
  • Check claims of absence ("nothing calls X") at the assembly point where things are wired together, not by grep alone.
  • Never print ranges of ~/.mama/config.yaml; it holds tokens.
  • The daemon runs packages/standalone/dist from the main checkout, so pulling into it is a deploy: pull, build and restart together. Only one daemon can poll the Telegram bot.

Rules

  • No PII: no personal names, project names or channel IDs in source, comments, examples or test fixtures.
  • Core knows no consumer. Other projects use mama-core through public exports only. Engine features (records, revisions, evidence links, search) go in core; product vocabulary stays in the product. A MAMA name inside core is a defect only when it makes the packed second-consumer test fail.
  • Build from evidence. Before adding a mechanism, screen, field or action, name the code, the data or the owner decision that requires it. Do not build from imagination.
  • The agent judges, the host provides. Meaning, relevance, identity and roles are not coded as rules. The host provides collection, storage, search, execution, permissions and receipts.
  • Relocate before you delete. Before removing a host step, lane brief or policy line, name the place where its domain knowledge and owner corrections will reach the agent, and confirm it with one real owner turn.
  • No insurance guards or fallbacks. Do not add a guard or an alternate path just because you are unsure. Surface the error and fix it. A guard needs a named reason.
  • Do not restrict the owner agent or its subagents. The real boundaries are: non-owner principals' turns (grants and scope), deliver.* destination config, credentials outside MAMA's scope, and administration (interactive owner request only). Everything else is observed in tool_traces.
  • Owner decision 2026-10-09 (P6), a narrowing: the owner agent and its subagents do not read a member's personal records (the member's chat, memory bound to the member, unshared work, workspace files and transcripts) unless the member shares them. They read records and sources through MAMA actions under the owner's access; native reads of the product database (with its -wal and -shm), the raw stores, member_root and the member temp root are denied. Everything else stays as above.
  • Schema: change it with the next-numbered migration in packages/mama-core/db/migrations. Numbers 044–060 are held in schema_version by a retired chain; never reuse them.
  • Record architecture, API contract and config schema decisions in MAMA (MCP save).
  • Count what a refactor deletes as well as what it adds. A revision that only adds is suspect.
  • Concurrent workers each get their own worktree. Never switch branches in a shared checkout.
  • Pass commit messages from a file (git commit -F) and check git log before saying you committed.

MAMA OS agent isolation — do not change

Daemon owner agents run only inside ~/.mama. Leaking global settings costs thousands of duplicated tokens every turn. Defined in packages/mama-core/src/runtime/drivers/persistent-cli-process.ts and claude-cli-wrapper.ts; native tool projection in packages/standalone/src/agent/claude-native-tool-policy.ts (carried back at W1).

SettingValueWhy
cwd~/.mama/workspaceThe home directory would inject ~/CLAUDE.md every turn
.git/HEADcreated in the workspaceGit boundary stops the upward CLAUDE.md search
--plugin-dir~/.mama/.empty-plugins (empty)Keeps global plugin skills out
--setting-sourcesproject,local (no user)Keeps ~/.claude/settings.json plugins out
--system-promptfirst turn onlyThe session persists
Native toolsClaude owner: role-projected tools, sandboxed Bash, workspace-only writes and WebFetch/WebSearch; Codex owner: shell and web search; other backends: none; the owner's native reads also exclude the product DB, raw stores and member directories (P6)Owner decision 2026-09-26: both owner runtimes write only inside ~/.mama/workspace and have web access. Claude uses the workspace project sandbox and dontAsk with CLI --allowedTools rules (project-settings permissions were not applied to non-interactive runs), inherited by subagents; Codex keeps sandbox workspace-write and approvals never. Core shell/web defaults stay off; shell network policy is unchanged

Forbidden: cwd set to home, removing --plugin-dir, adding user to --setting-sources, adding --no-session-persistence, removing the .git/HEAD creation, widening native tools in source except for the owner decision of 2026-09-26: both MAMA owner-runtime backends write only in ~/.mama/workspace and have web access. Codex enables shell and live web search with sandbox workspace-write and approvals never; core shell/web defaults stay off and shell network policy is unchanged. Claude replaces permission bypass with required sandboxed Bash (no unsandboxed retry), a workspace-only Edit(//<workspace>/**) rule passed with --allowedTools and dontAsk, retaining readable-file access outside the credential and member-data denies, WebFetch/WebSearch, MAMA MCP tools and Agent. Subagents inherit the same boundary and run inside the owner turn (background tasks off). Any other widening needs an owner decision recorded here.

Owner decision 2026-10-03 (W35.4): the Claude owner's Bash sandbox network goes to MAMA's own deny-all proxy (sandbox.network.httpProxyPort/socksProxyPort in the workspace settings, ports chosen at daemon start). It refuses every connection, as the empty sandbox allowlist did, and reports each attempt with its destination as a security alert. Shell egress stays closed; this is observation, not widening.

Owner decision 2026-10-05: each WebFetch call raises the same kind of security alert, naming its URL and grouped per host within a minute, because text placed in a URL reaches any host. WebFetch stays allowed; WebSearch stays recorded in tool_traces only. This is observation, not narrowing.

Owner decision 2026-11-17, a widening, narrowed the same day: the common session's Codex runtime enables Codex apps (the account's connectors: Google Calendar, Gmail, Drive) read only ([apps._default] destructive_enabled = false, open_world_enabled = false), because turns with no person in them share the process and an app write could come from text in a source. They had been off since the May 2026 port with no recorded reason. Meetings are booked with google.calendar.write, which runs only in a turn an owner's own message started. Each app call is recorded in tool_traces as codex_apps:<tool>; their results reach the model unquoted. Member sessions, owner-role DMs included, keep apps off; the Claude backend has no equivalent.

Owner decision 2026-10-15, a narrowing: web fetch needs judgment, so a turn with no person in it (source deltas, record orders, reports, notices, personal jobs) fetches only the hosts listed in agent.autonomous_web_fetch (none by default; * is every host). Web search stays in every turn, and turns where a person speaks keep web fetch with its alert. The Claude PreToolUse hook refuses from the running turn's mode, written outside the workspace; Codex has web search only.

Owner decision 2026-10-08 (4): member agents run in their own workspace under the configured member root outside the owner's home, with the same isolation settings as the owner: git boundary, empty plugins, project/local settings, persistent sessions, first-turn system prompt, required sandbox and deny-all proxy, workspace-only writes, credential denies, environment scrubbing and background tasks off. Members have no web tools (owner decision 7; owner-role members since 2026-10-12, below). Member runtime state, including each member's own Claude config directory and Codex home, stays under that member root; members never use the owner's ~/.claude. Owner decision 2026-10-09: members sign in with the owner's logins, not their own. The member's Claude CLI reads the owner's credential store (CLAUDE_SECURESTORAGE_CONFIG_DIR), and the member's Codex home receives a copy of the credential in the owner's managed Codex home, copied again after each refresh. The owner still signs in to its managed Codex home directly; nothing is copied into it.

Owner decision 2026-11-14: member shells get MAMA's own Node.js. The daemon's Node is given at <tools_root>/node/bin on every session's PATH (a copy of a Node under HOME, which members cannot read, or a link to one outside it); only node, no npm or npx. The HOME deny is unchanged.

Owner decision 2026-10-12 (P10): owners are members. Each person, owners included, has a member session in its own workspace under the member root, with the member tools above; the owner role adds reads of common records through MAMA actions (not native reads), the owner policy and owner rules read-only, and web search and web fetch. Alerts from an owner-role session (each WebFetch, a refused shell connection) go to that person's own DM, never the common channel. Members without the role keep no web tools. The common session (owner:runtime, deltas, reports and the common channel) keeps the owner runtime's tools.

Owner credential boundary — 2026-09-27

  • Scope (owner decision 2026-09-27): the boundary covers MAMA's own credentials — auth.env, config.yaml, runtime/, the managed Codex home and the replay key file, and since W1.3 (plan decision 5) the MAMA home's backups/, whose archives can carry all of them. Other tools' credential stores on the machine are not denied; the agent's native reads of them are recorded in tool_traces.
  • Each person's own send accounts (approvals.md P1, owner decision 2026-11-17) live in runtime/accounts/ under the MAMA home, inside the denied runtime/. Tokens are entered in the person's Telegram DM as a reply to the host's prompt; the gateway takes every reply to such a prompt before any turn records it (late ones too), and the host deletes it from the chat. They are read at each use, never put in the environment, removed on offboarding, and not in backups (a restored install reconnects them).
  • Each person's own sources (personal-connectors.md, owner decision 2026-11-20) use the same account store for their credentials. What they collect is stored as connector personal-<kind>-<person hash> with a channel key and source id carrying the person and their user: scope, so only that person's access names it. Disconnecting, offboarding and erasure delete it.
  • Owner decision 2026-10-31: gws's credential store (its config directory and a configured credentials file) joined the denied set, for both backends, because MAMA's own connectors and google.read run on that login. Other tools' stores stay as they were.
  • Standalone removes secret-shaped environment names before launching either backend; core accepts a complete consumer-supplied environment. Native children inherit it; daemon connectors keep theirs.
  • Claude CLI Read denies and Bash sandbox denyRead exclude auth.env, config.yaml, runtime/, backups/, the managed Codex home and the replay key file. Codex uses a named workspace permission profile with those paths denied; thread start/resume select that profile instead of the legacy sandbox override.
  • Viewer tunnel headers never establish identity. Remote access requires MAMA_AUTH_TOKEN or a verified Access JWT configured with MAMA_CF_ACCESS_ISSUER and MAMA_CF_ACCESS_AUD. Unconfigured verification fails closed. Direct loopback without tunnel headers remains available.
  • External evidence is quoted at model-facing tool results and delta stimuli; stored source data and host receipts retain their original structure. These changes protect the Answer and Report checks.

References

  • Release: docs/development/release-process.md. A release that touches mama-core publishes core first. The plugin's package.json and .claude-plugin/plugin.json versions must match; a test enforces it.
  • Learning: corrections and learning, with development evidence recorded through the intent workflow.

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.