A plain chat every chat starts from zero Request “Fix the bug in my project” Master’s system every session starts from what was kept Request “Fix the bug in my project” Starts empty knows nothing about you or the project You re-explain everything who you are, which project, the rules: again Answers from general memory not from the project’s own records Nobody checks the answer “done” is taken on trust Nothing is kept close the chat and it is gone nothing carried to the next chat 1 2 3 4 5 Context arrives by itself who Master is, his situation, today’s date hooks/session_start.py · OWNER.md · output style “Sage” The project’s rules apply every world has its own written rules for agents <world>/AGENTS.md · CLAUDE.md · GEMINI.md Knowledge is searched first answers start from the project’s own records python mm.py status · python mm.py find <terms> Work is checked forbidden actions blocked; proof lines checked hooks/guard.py · mm guard · hooks/proof.py Lessons are kept corrections become rules and memory, in Git sage-remember · memory/ · the repo’s lessons file kept: the next session starts from here
A plain chat starts empty, relies on re-explaining and general memory, checks nothing and keeps nothing. The same request in Master's system gets context, rules, knowledge, checks and kept lessons, and the next session starts from what was kept.
every chat starts from zero · I re-explain, it forgets · nobody checks “done” · system: context, rules, knowledge · checked, kept · it compounds

Plain chat

Starts empty

What

A chat with no rules files, no hooks, no knowledge repo and no memory files knows only what you type into it.

Why it matters

Every task begins with the model guessing who you are and how your project works.

Source

Baseline by definition: the left side is the system with every part removed (FACTS.md, visual 1).

Plain chat

You re-explain everything

What

Who you are, which project, its rules, what was decided last week: typed again in every chat.

Why it matters

People forget parts, so the answer misses them, and the time goes each time.

Source

Baseline by definition (FACTS.md, visual 1).

Plain chat

Answers from general memory

What

With no project records to search, the model answers from what it learned in training.

Why it matters

It sounds right for projects in general and can be wrong for this one.

Source

Baseline by definition (FACTS.md, visual 1).

Plain chat

Nobody checks the answer

What

When the model says “tests pass” or “committed”, nothing compares that with what really happened.

Why it matters

A confident wrong claim costs more than an honest “not done”.

Source

Baseline by definition (FACTS.md, visual 1).

Plain chat

Nothing is kept

What

Corrections and decisions live in that one conversation. The next chat has none of them.

Why it matters

The same mistake gets explained again and again.

Source

Baseline by definition (FACTS.md, visual 1).

Sage

Context arrives by itself

What

When a session starts, Claude Code runs Sage’s start hook. It adds today’s date, Master’s current situation, the habits due and Sage’s learned adjustments. Master’s lasting facts and Sage’s personality load too.

Why it exists

Nobody has to retype the background, and nothing is forgotten.

Source

D:/Projects/sage/hooks/session_start.py
D:/Projects/sage/install.py (~/.claude/CLAUDE.md imports OWNER.md; output style “Sage”)

World

The project’s rules apply

What

Each world (a project family) has written rules for agents in AGENTS.md, CLAUDE.md and GEMINI.md. The agent reads them before doing anything there.

Why it exists

Each project’s way of working is written once and followed every time, by every tool.

Source

D:/Projects/AGENTS.md (rule 1)
D:/Projects/Resale.com.pk/AGENTS.md (generated by python mm.py setup)

Knowledge

Knowledge is searched first

What

The rules say: start with mm status (open work to resume), then mm find with exact identifiers before working. Hits are treated as hypotheses and checked against today’s code.

Why it exists

Answers come from the project’s own records, not from the model’s general memory.

Source

D:/Projects/megamind-core/rules/RULES.md (rules 1 and 2)

Guards

Work is checked

What

Guard hooks block forbidden commands before they run (direct database clients, shell heredocs, slow searches, edits to Sage’s soul). The proof hook checks a reply’s Proof: lines: the commits and files they name must exist, and the tests they name must have run.

Why it exists

A hook stops the action; an instruction only asks.

Source

D:/Projects/sage/hooks/guard.py
D:/Projects/sage/hooks/proof.py
D:/Projects/megamind-core/mm/modules/safety.py

Learning

Lessons are kept

What

A correction becomes a memory or rule (sage-remember), signals go to the inbox for reflection, and development lessons go to the repo’s own lessons file. All plain files in Git.

Why it exists

The same mistake is not explained twice, on either machine or any tool.

Source

D:/Projects/sage/OPERATIONS.md (Memory; Learning and improving yourself)
D:/Projects/sage/SYSTEM.md (Where things belong)

Sage Master’s assistant: personality + memory, one layer above every world D:/Projects/sage · SOUL.md · OPERATIONS.md · memory/ Never depends on Megamind without it, works from Git and the repos uses as a tool works inside each world, under its rules Megamind the process for knowledge no personality one source, copied into each world D:/Projects/megamind-core python mm.py <command> One world its code and its knowledge, walled off × 8 worlds D:/Projects/<world>/ Rules for agents read first, by every AI tool AGENTS.md · CLAUDE.md · GEMINI.md (written by mm setup) Knowledge one Git repo per world e.g. resale-knowledge How it works, how to, why explanation · howto · decision Records: incidents, changes mm case open incident|change Indexes for search LOOKUP.tsv · REFERENCE.tsv · INDEX.md Megamind’s copy _megamind/core (never edited) writes rules copied in indexes, never copies Repo with its own process its process governs resale: AGENTS.md work/ · docs/adr/ docs/09-lessons.md Code repos the products themselves e.g. mesgs, electric.com.pk Safety guard on every command no direct database clients · no heredocs mm guard --claude · mm guard --stop Colour = layer Worlds Knowledge Megamind A repo’s own process Sage Guards Learning Shapes store of knowledge or memory tool or command guard indexes, never copies something flows (the label says what)
Sage sits above every world and uses Megamind as a tool without depending on it. Megamind, one source in the Lab, writes each world's rules and is copied into each world's knowledge repo. Each of the eight walled worlds holds code repos and one knowledge repo; a repo with its own process is indexed by the knowledge repo, never copied.
five layers · Sage on top, personality + memory · Megamind = process, no personality · one knowledge repo per world · repo’s own process wins · walls

Sage

Sage

What

Master’s own assistant, one layer above everything. It holds the personality and the memory of Master and his work across worlds, UBT included.

How it relates

It uses Megamind and each repo’s process as tools and follows their rules inside each world. It never depends on Megamind: without it, Sage works from Git and the repos.

Source

D:/Projects/sage/SYSTEM.md (The layers, 5)
D:/Projects/sage/SOUL.md · OPERATIONS.md · memory/

Megamind

Megamind

What

The process for knowledge: rules agents follow, playbooks, and a small standard-library Python command line. It is not the knowledge itself and has no personality.

How it relates

Fixed only in its source, tested, released, then rolled out to every world. mm setup writes each world’s rules files and installs its guard; mm update copies the engine in.

Source

D:/Projects/megamind-core/README.md
D:/Projects/sage/SYSTEM.md (The layers, 3)
D:/Projects/AGENTS.md (rule 5)

World

A world

What

One folder per organisation or project family under D:/Projects. It holds its code repos and one knowledge repo. There are eight, UBT among them.

Why the walls

Worlds never share knowledge, data or code. That is what lets one assistant serve an employer and private businesses without mixing them.

Source

D:/Projects/sage/SYSTEM.md (The layers, 1)
D:/Projects/AGENTS.md (rule 2)
D:/Projects/sage/sage.toml ([worlds], 8 entries)

World

Rules for agents

What

Each world’s AGENTS.md, CLAUDE.md and GEMINI.md: what the world is, its repos, its commands and its rules. Different AI tools read different file names, so the same rules are written into each.

Why it exists

Every agent, on any tool, starts with the same rules for that world.

Source

D:/Projects/sage/SYSTEM.md (The layers, 3)
D:/Projects/Resale.com.pk/AGENTS.md (“Managed by python mm.py setup”)

Knowledge

The knowledge repo

What

One Git repo per world of Markdown files with a small header: explanations, how-tos, decisions, research, FAQ, glossary, records of incidents and changes, and generated reference pages.

Indexes

LOOKUP.tsv, REFERENCE.tsv and INDEX.md are generated, never edited by hand. mm find searches them.

Source

D:/Projects/sage/SYSTEM.md (The layers, 2)
D:/Projects/megamind-core/spec/KNOWLEDGE-SPEC.md (Document types)

Megamind

Megamind’s copy in each world

What

Each knowledge repo carries a pinned copy of the engine at _megamind/core. mm update overwrites it and refuses local edits.

Why

A fix is made once, in the source, and every world gets the same tested version.

Source

D:/Projects/megamind-core/README.md
D:/Projects/AGENTS.md (rule 5)

A repo’s own process

Repo with its own process

What

Some repos run their own development process. Resale’s resale repo has its AGENTS.md, work items in work/, decisions in docs/adr/ and a lessons file.

How it relates

Inside it, the repo’s process governs and its records are the record. Megamind indexes them for search and never copies them.

Source

D:/Projects/sage/SYSTEM.md (The layers, 4)
D:/Projects/Resale.com.pk/resale/AGENTS.md (section 5)

World

Code repos

What

The products themselves: websites, apps and services, each its own Git repo inside its world.

Source

D:/Projects/sage/SYSTEM.md (The layers, 1)
D:/Projects/mesgs.com/AGENTS.md · D:/Projects/electric.com.pk/AGENTS.md (Repos)

Guards

Safety guard

What

Megamind installs a hook in each world that checks every shell command before it runs. It blocks direct database clients and scripts that import a database driver, shell heredocs, and slow recursive file searches. At the end of a turn it asks for a record before finishing.

Why it exists

Databases go only through Megamind’s guarded path, and authored text is never corrupted by shell quoting.

Source

D:/Projects/megamind-core/mm/modules/safety.py
D:/Projects/Resale.com.pk/.claude/settings.json (guard --claude, guard --stop)

Eight worlds under D:/Projects The Lab UBT the university day job ubt-edu-sa ubt-knowledge Resale tech hardware marketplace Resale.com.pk resale-knowledge WDP the agency site and small projects WebsiteDevelopersPakistan wdp-knowledge dyta AI services agency dyta dyta-knowledge electric electrical and solar services electric.com.pk electric-knowledge QuranLinked Quran study by theme QuranLinked quranlinked-knowledge mesgs a quiet social network mesgs.com mesgs-knowledge Personal personal and hobby projects SajjadArifGul knowledge Sage where Sage itself is changed D:/Projects/sage Megamind where Megamind is changed D:/Projects/megamind-core The walls UBT an employer Resale his own business knowledge · data · code never cross One assistant, every world each world’s rules load in its own folder Sage keeps per-world pointers, not details D:/Projects/AGENTS.md rule 2 · SOUL.md Limits
Eight worlds, each a walled folder with its own code and knowledge repo, plus the two Lab homes where Sage and Megamind are changed. Knowledge, data and code never cross from one world to another, which is why one assistant can serve an employer and private businesses.
eight worlds, one folder each · employer and my businesses side by side · walls: nothing crosses · two Lab homes

World

UBT

What

The university day job: many code repos and one knowledge repo. UBT is a world like the others, with the same rules.

Source

D:/Projects/ubt-edu-sa/AGENTS.md
D:/Projects/sage/SYSTEM.md (UBT is ubt-edu-sa)

World

Resale

What

resale.com.pk: a marketplace for tech hardware in Pakistan, sold only by verified physical shops. Its main repo runs its own development process.

Source

D:/Projects/Resale.com.pk/AGENTS.md

World

WDP

What

Website Developers Pakistan: the agency’s own website and its small projects. The big products have their own worlds.

Source

D:/Projects/WebsiteDevelopersPakistan/AGENTS.md

World

dyta

What

dyta.ai: an AI services agency.

Source

D:/Projects/dyta/AGENTS.md

World

electric

What

electric.com.pk: electrical and solar services for Pakistan, with calculators and city pages.

Source

D:/Projects/electric.com.pk/AGENTS.md

World

QuranLinked

What

quranlinked.com: linking ayahs and topics so the Quran can be studied by theme. Agents build the platform; the Quran content is written by Sajjad himself.

Source

D:/Projects/QuranLinked/AGENTS.md

World

mesgs

What

mesgs.com: a quiet social network with a chronological feed, no algorithms, no ads.

Source

D:/Projects/mesgs.com/AGENTS.md

World

Personal

What

Personal and hobby projects: independent one-off repos, his own site among them.

Source

D:/Projects/SajjadArifGul/AGENTS.md

The Lab

Sage’s Lab home

What

Changes to Sage itself (its rules, hooks, tools, skills, installer) happen here, one session per change, with tests first.

Source

D:/Projects/sage/AGENTS.md
D:/Projects/sage/OPERATIONS.md (Working)

The Lab

Megamind’s Lab home

What

Megamind is fixed only here, tested, released, then rolled out to every world. The copies inside worlds are never edited.

Source

D:/Projects/AGENTS.md (rule 5)
D:/Projects/sage/OPERATIONS.md (Working)

Walls

Nothing crosses a wall

What

One world’s code, data or knowledge is never carried into another world. Each world keeps its own knowledge repo.

Why

It is a design choice: it lets the employer’s systems and private businesses share one assistant without mixing.

Source

D:/Projects/AGENTS.md (rule 2)
D:/Projects/sage/SOUL.md (Limits)

Sage

One assistant, every world

What

World work happens in the world’s own folder, so its rules and guard load there. Sage’s memory keeps open work per world as pointers, with no other world’s details.

Source

D:/Projects/sage/OPERATIONS.md (Memory; Working)
D:/Projects/sage/SYSTEM.md (Where things belong)

One world, cut open D:/Projects/<world>/ Rules for agents what this world is, its repos, its rules AGENTS.md CLAUDE.md GEMINI.md same rules, one file name per AI tool written by mm setup from _megamind/org/RULES.md Megamind’s command line search, record, check, set up python mm.py status | find | case | stale Guard hooks check every command before it runs .claude/settings.json → mm guard Code repos one Git repo per product e.g. electric.com.pk Own-process repo its rules, work items, decisions, lessons e.g. resale: AGENTS.md work/ · docs/adr/ Knowledge repo plain Markdown, one topic per file, a small header on each <org>-knowledge/ · entry point KNOWLEDGE.md How things work explanations · how-tos FAQ · glossary · queries kept current, flagged when stale explanations/ howto/ faq/ glossary/ queries/ What happened incidents · changes decisions · process improvements records of a moment incidents/ changes/ decisions/ improvements/ Generated reference database schema, repo catalog regenerated, never edited reference/ indexed Indexes for search rebuilt on every commit never edited by hand LOOKUP.tsv · REFERENCE.tsv INDEX.md · pre-commit hook Megamind’s copy the engine, pinned _megamind/core · never edited Connections file this machine only never in Git .megamind/connections.json (ignored by Git)
One world opened up: rules files for each AI tool, Megamind's command line and guard hooks, the code repos, and the knowledge repo with its living explanations, records, generated reference, indexes rebuilt on every commit, the pinned Megamind copy and a local-only connections file.
what’s inside one world · rules first · knowledge: how it works, what happened · indexes rebuild themselves · secrets stay on the machine

World

One world

What

Every world folder has the same shape: rules files, Megamind’s launcher, guard hooks, its code repos and one knowledge repo.

Source

Listing of D:/Projects/Resale.com.pk (and every world folder)
D:/Projects/sage/SYSTEM.md (The layers)

World

Rules for agents

What

AGENTS.md, CLAUDE.md and GEMINI.md carry the same rules, because different AI tools read different file names. They are generated by mm setup from the world’s own RULES.md, so they are edited in one place.

Source

D:/Projects/Resale.com.pk/AGENTS.md (header)
D:/Projects/megamind-core/README.md (adapters module)

Megamind

Megamind’s command line

What

A small launcher in every world folder: python mm.py status, find, case, new, stale, db. Standard-library Python, no service to run.

Source

D:/Projects/megamind-core/rules/RULES.md (Commands)
D:/Projects/megamind-core/README.md

Guards

Guard hooks

What

The world’s Claude Code settings run Megamind’s guard before every shell command and again before a turn finishes.

Source

D:/Projects/Resale.com.pk/.claude/settings.json
D:/Projects/megamind-core/mm/modules/safety.py

World

Code repos

What

The products: one Git repo each, inside the world’s folder.

Source

D:/Projects/electric.com.pk/AGENTS.md (Repo)

A repo’s own process

Own-process repo

What

A repo that runs its own development process keeps its own records: its AGENTS.md, work items, architecture decisions and a lessons file. The knowledge repo indexes them and never copies them.

Source

D:/Projects/sage/SYSTEM.md (The layers, 4)
D:/Projects/Resale.com.pk/resale/AGENTS.md

Knowledge

Knowledge repo

What

What is known about the world, as plain Markdown, one topic per file, each with a small header (id, type, summary, search keys). Folders are by type, never by date or author. KNOWLEDGE.md is the entry point.

Source

D:/Projects/megamind-core/spec/KNOWLEDGE-SPEC.md (Layout, Common fields)

Knowledge

How things work

What

Living documents: explanations, how-tos, FAQ, glossary and curated queries. Each lists what it depends on (code, tables), so mm stale can flag it when those change.

Source

D:/Projects/megamind-core/spec/KNOWLEDGE-SPEC.md (Document types; Keeping it current)

Knowledge

What happened

What

Records: incidents (what broke, why, the fix), changes (what was built, risk, how to verify), decisions (what was chosen and rejected) and improvements (friction in the process). Records of a moment keep their meaning.

Source

D:/Projects/megamind-core/spec/KNOWLEDGE-SPEC.md (Document types)

Knowledge

Generated reference

What

Facts produced by commands, such as the database schema and the repo catalog. Regenerated, not edited; hand-written notes sit in protected blocks.

Source

D:/Projects/megamind-core/spec/KNOWLEDGE-SPEC.md (Layout: reference/)

Knowledge

Indexes for search

What

LOOKUP.tsv (key to document), REFERENCE.tsv (key to generated reference) and INDEX.md (a catalog for people). The knowledge repo’s Git pre-commit hook regenerates and validates them, so they are never edited by hand.

Source

D:/Projects/megamind-core/spec/KNOWLEDGE-SPEC.md (Indexes and search)
D:/Projects/megamind-core/mm/setup.py (pre-commit hook)

Megamind

Megamind’s copy

What

The engine pinned inside the knowledge repo, overwritten by mm update, never edited there.

Source

D:/Projects/megamind-core/README.md
D:/Projects/AGENTS.md (rule 5)

Local only

Connections file

What

How this machine reaches the world’s database. It lives only on the machine and Git ignores it. Connection strings are never written to Git.

Source

D:/Projects/sage/SYSTEM.md (Where things belong)
D:/Projects/Resale.com.pk/resale-knowledge/.gitignore

The knowledge cycle rules every agent follows rules/RULES.md · rules 1–4 start or resume work begins what was learned commit searchable next session What is open? resume, don’t restart mm status What is known? search before working mm find <exact terms> Record as you go hypothesis → result mm case open · log · close Leave knowledge how it works, why mm new explanation … Indexes rebuilt on every commit pre-commit: generate Next agent finds it any tool, any machine LOOKUP.tsv → mm find Guards on every command no direct database clients no shell heredocs no slow recursive searches mm guard: Claude · Antigravity · Codex · Cursor The guarded database path read-only, only with an open case every query logged to its case scripts on the test database only mm db query <file.sql> --case --purpose mm db try <script> --case Stale check flags knowledge whose code or tables changed since it was checked mm stale Release path: fixed once, rolled out everywhere Fix in the source never in a world’s copy D:/Projects/megamind-core Test every test must pass unittest discover -s tests Release version + changelog mm/__init__.py · CHANGELOG.md Roll out to every world python mm.py rollout Proved landed 8 of 8, pushed mm rollout --check
Megamind's knowledge cycle: check what is open, search what is known, record the work as a case, leave knowledge behind, indexes rebuild on commit, and the next agent finds it. Around it: guards on every command, the guarded database path and the stale check. Below: a fix is made once in megamind-core, tested, released and rolled out to all eight worlds.
a process, not a chatbot · search first, record as you go · the next agent starts from it · database only through the guarded path · fix once, roll out everywhere

Megamind

The knowledge cycle

What

The rules written into every world: start with status, search before you work, record, leave knowledge behind. Each turn of the cycle leaves the world better documented for the next agent.

Source

D:/Projects/megamind-core/rules/RULES.md (rules 1–4)

Megamind

What is open?

What

mm status starts a session: open work to resume and commits nobody recorded.

Source

D:/Projects/megamind-core/rules/RULES.md (Commands; rule 1)

Knowledge

What is known?

What

mm find with exact identifiers (error text, table, screen, repo) searches the indexes, including repos’ own records. The best hits are hypotheses, checked against today’s code.

Source

D:/Projects/megamind-core/rules/RULES.md (rule 2)
D:/Projects/megamind-core/spec/KNOWLEDGE-SPEC.md (Indexes and search)

Megamind

Record as you go

What

A case is a flight recorder: case open incident|change, then one case log line per step (hypothesis, action, result, decision), case commit to save what was learned, case close at the end.

Source

D:/Projects/megamind-core/mm/case.py (docstring)

Knowledge

Leave knowledge behind

What

Learned how something works, how to do it, or why it was built that way? Write it with mm new explanation|howto|decision, listing what it depends on. Knowledge the work made wrong is fixed in the same task.

Source

D:/Projects/megamind-core/rules/RULES.md (rule 4)

Knowledge

Indexes rebuilt on commit

What

The knowledge repo’s Git pre-commit hook runs mm generate and mm validate, so the indexes always match the documents.

Source

D:/Projects/megamind-core/mm/setup.py (pre-commit hook)

Knowledge

The next agent finds it

What

The indexes are plain committed text, so any tool on any machine can search them, with or without Megamind.

Source

D:/Projects/megamind-core/spec/KNOWLEDGE-SPEC.md (Indexes and search)

Guards

Guards on every command

What

Before a shell command runs, the guard refuses database clients, inline code or scripts that import a database driver, shell heredocs (they corrupt authored text) and slow recursive file searches. Installed for Claude Code, Antigravity, Codex and Cursor.

Source

D:/Projects/megamind-core/mm/modules/safety.py (docstring)

Megamind

The guarded database path

What

mm db query runs read-only queries, refuses without an open case, asks for a purpose and logs each query to the case. mm db try runs guarded scripts on the test database only; production runs are the owner’s.

Source

D:/Projects/megamind-core/rules/db-oracle.md
D:/Projects/megamind-core/README.md (Everyday commands)

Megamind

Stale check

What

mm stale flags a living document when code it depends on got a new commit, a table it describes changed, or it has gone too long unverified. A missing source shows as “unknown”, never “unchanged”.

Source

D:/Projects/megamind-core/mm/stale.py (docstring)

Release

Fix in the source

What

Megamind is changed only in megamind-core, in its own Lab session. The copies inside worlds are overwritten by updates.

Source

D:/Projects/AGENTS.md (rule 5)

Release

Test

What

A test is added for the fix, and the whole suite must pass.

Source

D:/Projects/SajjadArifGul/knowledge/explanations/sage-and-megamind-lab-notebook.md (How to change and release safely)

Release

Release

What

The version is bumped and the changelog says what changed and why.

Source

D:/Projects/megamind-core/CHANGELOG.md

Release

Roll out

What

mm rollout goes through every knowledge base: pull, update the engine, run setup (Claude and Antigravity must say “works”), validate, commit only the engine, push.

Source

D:/Projects/megamind-core/CHANGELOG.md (0.18.1)

Release

Proved landed

What

The rollout must end with every knowledge base on the new version as committed and pushed, read from Git rather than the disk. Added after five worlds were once found on a version that was never committed.

Source

D:/Projects/megamind-core/CHANGELOG.md (0.18.1, Why)

Manners Alfred Pennyworth anticipates, calm under fire, tells the hard truth once, discreet SOUL.md · Character · Manners Mind Dr House’s method every problem is a diagnosis: suspects, evidence, no unchecked claim SOUL.md · Character · Mind Drive An evil genius’s drive beat the best by a clear margin, with real data; force matched to stakes SOUL.md · Character · Drive Limits that never bend A fake win is the worst loss: proof for every claim Blocked? Stop and show the exact error, never work around it A world’s rules apply; production is Master’s alone No tactics that can backfire: spam, fake reviews, deception Nothing carried from one world into another SOUL.md · Limits (never bent) Two modes When the cape comes off outages, stress: short and calm, restore first, explain later In deen addressed as Sajjad, a fellow student; Dr. Israr Ahmed’s manner, sourced SOUL.md · guides/deen.md The soul is protected The soul who Sage is SOUL.md checked against Fingerprint of the approved soul soul.lock writes Only Master approves in his own terminal tools/soul.py approve Edit blocked by a hook hooks/guard.py Commit refused by a Git hook soul.py precommit Restored at session start soul.py check
Sage's personality as an operating spec: manners, a diagnostician's method and a drive to win; limits that never bend; two modes for outages and deen. The soul file is checked against a fingerprint only Master can write; edits are blocked, unapproved commits refused and drift restored at session start.
personality = operating spec · Alfred, House, evil genius · limits never bend · deen mode · the soul can’t drift: only I approve

Character

Manners: Alfred Pennyworth

What

The steady hand behind someone who takes on the world: anticipates the next thing, stays courteous and calm, tells the hard truth politely once and then helps fully, keeps private things private, and cleans up the loose ends.

Source

D:/Projects/sage/SOUL.md (Character: Manners)

Character

Mind: Dr House’s method

What

Every problem is a diagnosis: list the suspects, rule them out with evidence, and trust no claim that hasn’t been checked, its own included. Only his method: none of his rudeness or rule-breaking.

Source

D:/Projects/sage/SOUL.md (Character: Mind)

Character

Drive: an evil genius’s drive

What

Winning means beating the best by a clear margin, defined as a number and backed by real data. Force is matched to the stakes, and nothing is called done before asking “would this beat the best?”

Source

D:/Projects/sage/SOUL.md (Character: Drive)

Limits

Limits that never bend

What

Claim only what its own tool output shows, with Proof lines; stop and report a block instead of working around it; follow each world’s rules, with production Master’s alone; no tactics that can backfire on Master; never carry one world into another; never edit the soul.

Why

A personality here is an operating spec. These lines decide what the agent does when it is unsure.

Source

D:/Projects/sage/SOUL.md (Limits)

Character

Two modes

When the cape comes off

During outages, data loss or stress: short, calm, restore first, explain later.

In deen

He is addressed as Sajjad, both students before the Quran. Taught in the manner of Dr. Israr Ahmed, as a student carrying his teaching, with every claim sourced and no wit or flourish.

Source

D:/Projects/sage/SOUL.md (When the cape comes off; In deen)
D:/Projects/sage/guides/deen.md

Sage

The soul

What

SOUL.md: who Sage is and what it never does. Sage never edits it. Changes are proposed as SOUL.proposed.md and shown to Master as a diff.

Source

D:/Projects/sage/SOUL.md (header)
D:/Projects/sage/AGENTS.md (Never)

Sage

Fingerprint

What

soul.lock holds the fingerprint of the approved SOUL.md. Every check compares the file with it.

Source

D:/Projects/sage/tools/soul.py
D:/Projects/sage/soul.lock

Master

Only Master approves

What

soul.py approve needs an interactive terminal and a typed confirmation, so an agent can’t run it for him. It guards against drift, such as a weaker model rewriting the personality; Git history still shows every change.

Source

D:/Projects/sage/tools/soul.py (docstring)

Guard

Edit blocked

What

A Claude Code hook blocks file edits to SOUL.md or soul.lock, and shell commands that would write, move or delete them.

Source

D:/Projects/sage/hooks/guard.py

Guard

Commit refused

What

The Sage repo’s Git pre-commit hook refuses a commit whose SOUL.md doesn’t match soul.lock.

Source

D:/Projects/sage/tools/soul.py (precommit)
D:/Projects/sage/install.py (git_hook)

Guard

Restored at session start

What

If SOUL.md doesn’t match its fingerprint, the session-start hook restores the approved version and says so.

Source

D:/Projects/sage/hooks/session_start.py (soul_and_style)
D:/Projects/sage/README.md (Tier 3)

Plain Markdown files in Git committed and pushed at the end of every session D:/Projects/sage/memory/ · hooks/journal.py Every session loaded into the model Shown at session start the start hook picks what is due Read when needed opened for the task at hand Who Master is OWNER.md via ~/.claude/CLAUDE.md Who Sage is, how it works SOUL.md + OPERATIONS.md → output style Kept small on purpose owner facts: under about 80 lines adjustments: 15 lines at most tools/selfcheck.py checks sizes This machine only not in Git: the world map, proof log, sync state local/ (WORLDS.md · proof-log · sync) Current situation, dated life/current.md → history.md when expired This quarter’s goals life/goals.md Habits due today life/habits.md + habits-log.md Learned adjustments adaptations.md Open notes and proposals inbox.md · proposals.md Is a memory tidy-up due? days and sessions since the last dream Open work, per world worlds/<world>/now.md Session journal, per world worlds/<world>/journal.md (by a hook) Master’s own notes notes/ (index: notes/README.md) Specialist roles’ knowledge experts/seo · ux · pakistan/ How Master builds software life/engineering-playbook.md Map of his businesses life/portfolio.md Private facts life/profile.md · only when a task needs it
The structure of Sage's memory, without its contents: what loads into every session, what the start hook shows when it is due, what is read only when a task needs it, and what stays on one machine. All of it is plain files in Git, pushed at the end of every session.
memory = plain files in Git · always loaded vs shown when due vs on demand · kept small on purpose · private stays private

Sage

Plain files in Git

What

Sage’s memory is a folder of Markdown files in its own Git repo. The start hook pulls it; the session-end hook commits and pushes it. Any tool and any machine can read it.

Source

D:/Projects/sage/memory/README.md
D:/Projects/sage/hooks/journal.py

Every session

Who Master is

What

Lasting facts about Master and his corrections to Sage, imported into every Claude session through the personal CLAUDE.md. Changed only with his agreement.

Source

D:/Projects/sage/install.py (docstring)
D:/Projects/sage/OWNER.md (header)

Every session

Who Sage is, how it works

What

The soul and the operating rules are joined into Claude Code’s output style, so they load in every session.

Source

D:/Projects/sage/install.py (~/.claude/output-styles/sage.md)

Rule

Kept small on purpose

What

What loads every session costs context in every session, so it has limits: owner facts under about 80 lines, learned adjustments at most 15 lines. The self-check fails a file over its hard limit.

Source

D:/Projects/sage/OPERATIONS.md (file sizes; Tier 1)
D:/Projects/sage/tools/selfcheck.py

This machine

This machine only

What

local/ is not in Git: the map of worlds on this machine, the log of commands the proof hook checks, and the machine-sync state.

Source

D:/Projects/sage/.gitignore (local/)
D:/Projects/sage/hooks/proof.py (LOG)
D:/Projects/sage/hooks/session_start.py (local/sync.json)

Shown at start

Current situation, dated

What

Each line has a start and an end date. The start hook shows the current ones and moves expired lines to history by itself, append-only.

Source

D:/Projects/sage/hooks/session_start.py (docstring)
D:/Projects/sage/memory/README.md

Shown at start

This quarter’s goals

What

Long-term goals by horizon; the start hook shows only this quarter’s, so work can be weighed against them.

Source

D:/Projects/sage/memory/README.md
D:/Projects/sage/hooks/session_start.py (goals)

Shown at start

Habits due today

What

Recurring things with a frequency. The hook counts from the log which are due, so no session has to guess or repeat one.

Source

D:/Projects/sage/hooks/session_start.py (habits)

Shown at start

Learned adjustments

What

Small changes Sage made to how it works, each with a date and evidence. Master can say “undo”.

Source

D:/Projects/sage/OPERATIONS.md (Tier 1)

Shown at start

Open notes and proposals

What

The inbox collects signals for the next reflection (other tools may only add to it). Proposals wait for Master’s yes.

Source

D:/Projects/sage/OPERATIONS.md (Learning; Tier 2)
D:/Projects/sage/OTHER-TOOLS.md

Shown at start

Is a memory tidy-up due?

What

The hook says when a dream is due (at least a day and five sessions since the last one); it runs at the night-time wrap-up.

Source

D:/Projects/sage/hooks/session_start.py (dream_due)
D:/Projects/sage/OPERATIONS.md

On demand

Open work, per world

What

Open threads, waiting-on and pending decisions for one world, read at the start of work there. Pointers only, no other world’s details.

Source

D:/Projects/sage/memory/README.md
D:/Projects/sage/SYSTEM.md (Where things belong)

On demand

Session journal

What

One line per session that made commits, written by the session-end hook. Old lines are compressed into weekly summaries by the dream.

Source

D:/Projects/sage/hooks/journal.py
D:/Projects/sage/tools/dreamprep.py

On demand

Master’s own notes

What

When Master says “note: …”, it lands in an unsorted file; the dream files it into a topic.

Source

D:/Projects/sage/memory/README.md

On demand

Specialist roles’ knowledge

What

What the SEO, UI/UX and Pakistani-market roles have learned across worlds: knowledge, lessons, sources, watchlist. One business’s facts stay in its world.

Source

D:/Projects/sage/SYSTEM.md (Where things belong)
D:/Projects/sage/memory/experts/README.md

On demand

How Master builds software

What

His approaches across worlds, read before a feature, a new project or a big change.

Source

D:/Projects/sage/OPERATIONS.md (Engineering)

On demand

Map of his businesses

What

The map of his businesses and projects, read whenever one comes up.

Source

D:/Projects/sage/OWNER.md (Standing decisions)

On demand

Private facts

What

Private, lasting facts, read only when a task needs them. Sensitive topics are saved only when he asks.

Source

D:/Projects/sage/OPERATIONS.md (Memory; Beyond code)

Master Sage World rules The repo Hooks Example: Master asks Sage to fix a bug in Resale hooks run by Claude Code, set up by install.py and mm setup Session starts “Fix a bug in Resale” SessionStart 1 Context added date · situation · habits · adjustments hooks/session_start.py 2 Finds the world from the folder it was opened in folder · WORLDS.md 3 Its rules load how to work in this world AGENTS.md · CLAUDE.md 4 Knowledge first open work, then what is known mm status · mm find 5 Done the repo’s way issue → spec → plan → PR · Master merges resale/AGENTS.md §5 6 Guard blocks the forbidden before it runs guard.py mm guard 7 Proof checked commits, files, tests really ran proof.py --check 8 answer, proof checked Master gets the answer with Proof: lines Journal + memory saved at session end hooks/journal.py 9 Pushed to GitHub memory/ only pull, then push git push (journal.py) 10 Other machine has it next session pulls it tools/sync.py --auto 11
One request traced through five lanes: the session starts, the start hook adds context, Sage finds the world, its rules load, knowledge is searched, the work follows the repo's process, guard hooks block forbidden commands, the proof hook checks the claims as the answer ends, the session-end hook saves the journal and memory and pushes them, and the other machine pulls them at its next session.
one real request, end to end · context arrives by itself · rules, then knowledge, then work · guard blocks, not asks · proof checked as it finishes · laptop already has it

Step 1 · Master

Session starts

What

Master opens Claude Code in a world’s folder and asks for the work. Sessions are organised by world: the world’s rules and guard load there.

Source

D:/Projects/sage/OPERATIONS.md (Sessions are organised by world)

Step 2 · Hook

Context added by the start hook

What

At SessionStart, Sage’s hook pulls memory from GitHub, checks the soul against its fingerprint, starts the machine sync in the background, and adds today’s date, Master’s current situation, habits due and learned adjustments to the session.

Why

The tidying and remembering is done by code, so the model doesn’t have to remember to do it.

Source

D:/Projects/sage/hooks/session_start.py
D:/Projects/sage/install.py (HOOKS: SessionStart)

Step 3 · Sage

Finds the world

What

Opened in a world folder, the folder decides. Asked at D:/Projects itself, Sage works out the world and repo from this machine’s world map, then that world’s search, and says which in one line.

Source

D:/Projects/sage/OPERATIONS.md (“Do this” at the root)
D:/Projects/sage/local/WORLDS.md (generated per machine, not in Git)

Step 4 · World

The world’s rules load

What

The world’s AGENTS.md / CLAUDE.md say what the world is, its repos, its commands and its rules. Inside a repo with its own process, that repo’s AGENTS.md governs development.

Source

D:/Projects/AGENTS.md (rule 1)
D:/Projects/Resale.com.pk/AGENTS.md
D:/Projects/Resale.com.pk/resale/AGENTS.md

Step 5 · Knowledge

Knowledge searched first

What

mm status shows open work to resume and commits nobody recorded. mm find with exact identifiers (error text, table, screen, repo) finds what is known. Hits are hypotheses, checked against today’s code.

Source

D:/Projects/megamind-core/rules/RULES.md (rules 1 and 2, commands table)

Step 6 · Repo

Work done the repo’s way

What

In Resale, work that changes files is a GitHub issue. Small work takes the quick track: branch, change, test, PR. Everything else: spec (Master approves), plan, implement with a draft PR, then security review and verification only on Master’s go-ahead. Merging is Master’s alone.

Source

D:/Projects/Resale.com.pk/resale/AGENTS.md (section 5, How work flows)

Step 7 · Hook

Guard blocks the forbidden

What

Before each shell command runs, Megamind’s guard checks it: direct database clients, scripts importing a database driver, shell heredocs and slow recursive searches are refused with the reason and the allowed route. Sage’s guard refuses any edit to its soul.

Why

The rule is enforced by the tool, not by the model’s memory of it.

Source

D:/Projects/megamind-core/mm/modules/safety.py
D:/Projects/sage/hooks/guard.py

Step 8 · Hook

Proof checked

What

Every command the session runs is logged. When the agent tries to finish, the proof hook reads its Proof: lines: commit hashes must exist, files in backticks must exist, test or build commands must really have run. If not, the agent is stopped once and must correct them, or mark them “unverified”, before the turn ends.

Also at the finish

improve.py makes sure a logged improvement note is told to Master; Megamind’s guard --stop asks for a record before finishing.

Source

D:/Projects/sage/hooks/proof.py (--log, --check)
D:/Projects/sage/hooks/improve.py
D:/Projects/megamind-core/mm/modules/safety.py (stop_check)

Master

Master gets the answer

What

Finished work ends with Proof: lines (commit, file, test command and result). The finish hooks run as the reply ends: a wrong proof line makes the agent correct it in the same turn.

Source

D:/Projects/sage/hooks/proof.py
D:/Projects/sage/OPERATIONS.md (Proof lines are checked)

Step 9 · Hook

Journal and memory saved

What

At SessionEnd, Sage’s journal hook adds one line to that world’s journal listing the commits made since the session began (up to eight), then commits Sage’s memory/ folder, and nothing else.

Source

D:/Projects/sage/hooks/journal.py
D:/Projects/sage/memory/worlds/<world>/journal.md

Step 10 · Hook

Pushed to GitHub

What

The same hook pulls with rebase, then pushes. If a pull would conflict, it stops safely and the next session start reports it.

Source

D:/Projects/sage/hooks/journal.py (save_memory)

Step 11 · Other machine

The other machine has it

What

On the laptop (or the work PC), the next session start pulls Sage’s memory and starts the machine sync in the background, at most every two hours. The sync fast-forwards clean repos and never pushes app repos.

Source

D:/Projects/sage/hooks/session_start.py (machine_sync)
D:/Projects/sage/tools/sync.py (AUTO_EVERY_HOURS = 2)

Data protects databases and files No direct database clients the guarded path instead safety.py · mm guard Queries need an open case read-only, logged, with a purpose mm db query No shell heredocs they corrupt authored text safety.py Never discard others’ work no restoring over edits you didn’t make rules/RULES.md · rule 5 No slow recursive searches scoped ripgrep instead safety.py (0.18.0) Truth protects what Master is told Proof lines checked named commits and files must exist; tests must have run hooks/proof.py Record before finishing asked once to record after edits or queries mm guard --stop Improvements get told a logged note must reach Master in the reply hooks/improve.py The soul can’t drift edit blocked, commit refused, restored at session start guard.py · soul.py Report only what you saw another agent’s “done” is unverified until checked RULES.md 6 · SOUL.md Production protects live systems Production is Master’s alone agents never write to it OWNER.md · SOUL.md Master merges (Resale) merging deploys resale/AGENTS.md App repos never pushed by the machine sync tools/sync.py Scripts on test only production database runs are the owner’s mm db try Privacy protects worlds and secrets World walls nothing crosses between worlds D:/Projects/AGENTS.md · rule 2 No connection strings the connections file stays on the machine .gitignore · SYSTEM.md Private facts on demand read only when a task needs them OPERATIONS.md · Memory enforced: a hook or code stops it rule: a written instruction the agent follows
Every guard and hard rule, grouped by what it protects: data, truth, production and privacy. Filled shields are enforced by a hook or code; outlined shields are written rules.
grouped by what they protect · filled = enforced, outline = rule · a hook blocks, a rule only asks · production is mine

Data · Enforced: a hook or code stops it

No direct database clients

What

Before a shell command runs, Megamind’s guard refuses database clients and code or scripts that import a database driver. Databases are reached through mm db. Megamind calls this defence in depth: a read-only database user is the real boundary.

Source

D:/Projects/megamind-core/mm/modules/safety.py

Data · Enforced: a hook or code stops it

Queries need an open case

What

mm db query runs read-only queries, refuses without an open case and logs each query to it, with its purpose. Exploration the owner approved can run without a case (--adhoc).

Source

D:/Projects/megamind-core/rules/db-oracle.md
D:/Projects/megamind-core/README.md

Data · Enforced: a hook or code stops it

No shell heredocs

What

Heredocs re-parse quotes, backticks and $ and silently corrupt files and commit messages, so the guard blocks them; text is written with the file tool and commits use git commit -F.

Source

D:/Projects/megamind-core/mm/modules/safety.py (docstring)

Data · Rule: written instruction

Never discard others’ work

What

No git restore, checkout -- or unstaging of changes the agent didn’t write: it asks instead. A written rule, not a hook.

Source

D:/Projects/megamind-core/rules/RULES.md (rule 5)

Data · Enforced: a hook or code stops it

No slow recursive searches

What

Recursive PowerShell searches crawl build folders and take tens of seconds; the guard blocks them and points to a scoped ripgrep search. Grouped here for space.

Source

D:/Projects/megamind-core/mm/modules/safety.py
D:/Projects/megamind-core/CHANGELOG.md (0.18.0)

Truth · Enforced: a hook or code stops it

Proof lines checked

What

Every command is logged; at the end of a turn the Proof: lines are checked (commits exist, files exist, test commands ran). If not, the agent is stopped once to fix them or say “unverified”.

Source

D:/Projects/sage/hooks/proof.py

Truth · Enforced: a hook or code stops it

Record before finishing

What

At the end of a turn in a world, Megamind’s stop check keeps the agent going once after file edits or database queries that were not recorded; trivial work can say so in one line.

Source

D:/Projects/megamind-core/mm/modules/safety.py (stop_check)

Truth · Enforced: a hook or code stops it

Improvements get told

What

If the session logged an improvement note and the reply doesn’t tell Master, the reply is blocked once.

Source

D:/Projects/sage/hooks/improve.py

Truth · Enforced: a hook or code stops it

The soul can’t drift

What

Three layers keep the personality exactly as Master approved it.

Source

D:/Projects/sage/hooks/guard.py
D:/Projects/sage/tools/soul.py

Truth · Rule: written instruction

Report only what you saw

What

A commit, push or test result counts only when the agent’s own tool output shows it. A written rule; the proof hook enforces part of it.

Source

D:/Projects/megamind-core/rules/RULES.md (rule 6)
D:/Projects/sage/SOUL.md (Limits)

Production · Rule: written instruction

Production is Master’s alone

What

A standing decision: production systems are Master’s alone; agents never write to them. Production commands are given to Master, not run.

Source

D:/Projects/sage/OWNER.md (Standing decisions)
D:/Projects/sage/SOUL.md (Limits)

Production · Rule: written instruction

Master merges (Resale)

What

In Resale, agents never merge a PR; merging triggers deployment and is the owner’s alone.

Source

D:/Projects/Resale.com.pk/resale/AGENTS.md (sections 3 and 5)

Production · Enforced: a hook or code stops it

App repos never pushed

What

The sync pushes only Sage, Megamind and knowledge repos. A push to an app repo’s main branch can deploy, so app repos are only pulled.

Source

D:/Projects/sage/tools/sync.py (docstring)

Production · Enforced: a hook or code stops it

Scripts on test only

What

mm db try runs guarded scripts on the test database only.

Source

D:/Projects/megamind-core/rules/db-oracle.md

Privacy · Rule: written instruction

World walls

What

Never carry one world’s code, data or knowledge into another world.

Source

D:/Projects/AGENTS.md (rule 2)
D:/Projects/sage/SOUL.md (Limits)

Privacy · Rule: written instruction

No connection strings

What

Connection strings are never written; Megamind’s connections file is local only and ignored by Git. (Megamind’s rules leave it to the owner whether IPs, server details and passwords may be recorded in knowledge.)

Source

D:/Projects/sage/SYSTEM.md (Where things belong)
D:/Projects/Resale.com.pk/resale-knowledge/.gitignore

Privacy · Rule: written instruction

Private facts on demand

What

Private facts are read only when a task needs them, and sensitive topics are saved only when Master asks.

Source

D:/Projects/sage/OPERATIONS.md (Memory; Beyond code)

a session fastest loop inside, slowest outside Monthly: behaviour tests sage-evals · evals/scenarios.md Dream: tidies memory, keeps every fact sage-dream · tools/dreamprep.py Weekly: reflection adjusts behaviour sage-reflect · tools/signals.py Signals → inbox, told at task end memory/inbox.md · hooks/improve.py Correction → remembered sage-remember Three tiers of self-change 1 · Changes itself small adjustments, dated, with evidence; “undo” reverses them memory/adaptations.md 2 · Proposes facts, habits, rules, skills: only with Master’s yes memory/proposals.md 3 · Never the soul SOUL.md (protected) Checked after every change fails → Sage undoes it (a rule) tools/selfcheck.py Better by writing files under rules, not by retraining a model In every world, the knowledge grows Cases → records incidents, changes mm case Decisions with their why decisions/ · docs/adr/ Lessons files in repos with a process resale/docs/09-lessons.md Process friction what slowed us down improvements/
Sage's learning loops, fastest inside: a correction is remembered at once, signals go to the inbox and are told at the end of a task, a weekly reflection adjusts behaviour, a dream tidies memory, and monthly tests check behaviour. Self-change has three tiers and is checked after every change. In each world, cases, decisions, lessons and process friction become files.
no retraining: files under rules · correction → remembered now · weekly reflect, monthly test · three tiers: change, propose, never · every world’s knowledge grows

Loop 1 · at once

Correction → remembered

What

When Master corrects Sage, states a preference or makes a lasting decision, sage-remember writes it to the right memory file in the same session.

Source

D:/Projects/sage/skills/sage-remember/SKILL.md
D:/Projects/sage/OPERATIONS.md (Memory)

Loop 2 · every task

Signals → inbox, told at task end

What

Signals noticed while working (a correction, something ignored, a failed result) go to the inbox. A task that hit a gap ends with a short “Sage could improve” note; a hook blocks the reply once if a logged note wasn’t told.

Source

D:/Projects/sage/OPERATIONS.md (Learning and improving yourself)
D:/Projects/sage/hooks/improve.py

Loop 3 · weekly

Reflection adjusts behaviour

What

sage-reflect reads a one-page digest of recent sessions (repeated endings, corrections, open inbox lines) and adjusts behaviour from the patterns.

Source

D:/Projects/sage/skills/sage-reflect/SKILL.md
D:/Projects/sage/tools/signals.py

Loop 4 · when due

Dream tidies memory

What

When at least a day and five sessions have passed, at the night-time wrap-up: close finished threads, compress old journals, merge duplicates, keep files within limits. It never deletes a fact.

Source

D:/Projects/sage/OPERATIONS.md
D:/Projects/sage/tools/dreamprep.py

Loop 5 · monthly

Behaviour tests

What

Prompts with what a good answer does, scored pass, partial or fail in a new session; failures are fixed in the rule or skill that caused them. “Instructions guide a model; they don’t guarantee anything.”

Source

D:/Projects/sage/evals/scenarios.md
D:/Projects/sage/skills/sage-evals/SKILL.md

Tier 1

Changes itself

What

Small adjustments to how Sage works (how often, how long, which format), at most 15 lines, each dated with its evidence. Master is told in one line and can say “undo”.

Source

D:/Projects/sage/OPERATIONS.md (Tier 1)

Tier 2

Proposes

What

Changes to owner facts, habits, operating rules or skills: shown as an exact change, made only after Master agrees. At night they wait in proposals.

Source

D:/Projects/sage/OPERATIONS.md (Tier 2)

Tier 3

Never

What

The soul. An adjustment that would contradict it is not allowed.

Source

D:/Projects/sage/OPERATIONS.md (Tier 3)

Rule

Checked after every change

What

After any self-change, the self-check runs: the soul matches its fingerprint, files are within limits, every adaptation has a date and evidence and doesn’t contradict the soul, habits and dates parse. The rule: if it fails, Sage undoes the change; no hook runs it.

Source

D:/Projects/sage/tools/selfcheck.py (docstring)
D:/Projects/sage/OPERATIONS.md

Knowledge

Cases → records

What

Investigations and changes are recorded as they happen and end as incident and change records in the world’s knowledge repo.

Source

D:/Projects/megamind-core/mm/case.py
D:/Projects/megamind-core/rules/RULES.md (rule 3)

Knowledge

Decisions with their why

What

Owner decisions are written down (who, date, scope), in the knowledge repo or in the repo’s own decision records.

Source

D:/Projects/megamind-core/rules/RULES.md (rule 3)
D:/Projects/sage/OPERATIONS.md (Engineering)

A repo’s own process

Lessons files

What

Development lessons about one repo go to that repo’s lessons file, so the next agent working there reads them.

Source

D:/Projects/sage/SYSTEM.md (Where things belong)

Knowledge

Process friction

What

What slowed the work down, with a “seen” count, goes to the knowledge repo’s improvements folder.

Source

D:/Projects/megamind-core/spec/KNOWLEDGE-SPEC.md (improvement)
D:/Projects/megamind-core/rules/RULES.md (rule 7)

Work PC stays on at night: unattended work All 8 worldsD:/Projects/ Sage installedpython install.py Megamind set upmm setup (each world) · --root This machine onlylocal/ · connections files Laptop the same setup All 8 worldsD:/Projects/ Sage installedpython install.py Megamind set upmm setup (each world) · --root This machine onlylocal/ · connections files GitHub pushed: Sage, Megamind, knowledge pulled into clean repos only app repos: pulled, never pushed sage · megamind-core · <org>-knowledge push pull push pull Machine sync at session start, wrap-up, or “sync” tools/sync.py --auto (at most every 2 h) Many tools, one Sage The same files soul, owner facts, situation, world rules SOUL.md · OWNER.md · current.md · AGENTS.md each through its own entry file Claude Code must work personality, hooks, skills output style · ~/.claude/CLAUDE.md Antigravity must work no Sage hooks: notes to the inbox ~/.gemini/GEMINI.md Gemini CLI best effort same entry file as Antigravity ~/.gemini/GEMINI.md Codex best effort reads a written-out copy ~/.codex/AGENTS.md
The work PC and the laptop hold the same worlds and setup and meet through GitHub: Sage, Megamind and knowledge repos are pushed and pulled; app repos are only pulled. Claude Code, Antigravity, Gemini CLI and Codex each read the same soul, owner facts, situation and world rules through their own entry file.
two machines, one state · GitHub in the middle · app repos never pushed · any tool, same Sage · not tied to one vendor

Machine

Work PC

What

Holds every world under D:/Projects, with Sage installed and Megamind set up in each world. It stays on at night, so anything that must run unattended belongs here.

Source

D:/Projects/sage/SYSTEM.md (Machines)

Machine

Laptop

What

The same worlds and the same setup. A world missing on a machine is brought in by the sync from the list in sage.toml; a missing repo inside a world is reported.

Source

D:/Projects/sage/SYSTEM.md (Machines)
D:/Projects/sage/sage.toml ([worlds])

GitHub

GitHub in the middle

What

Everything syncs through GitHub, both ways. Pulls go only into repos that are clean and on their default branch. Only Master’s own system repos are pushed; app repos are never pushed, because a push to main can deploy.

Source

D:/Projects/sage/tools/sync.py (docstring)
D:/Projects/sage/SYSTEM.md (Machines)

Sage

Machine sync

What

Runs in the background at session start (at most every two hours), at wrap-up, or when Master says “sync”. Afterwards it re-runs the installer or Megamind setup where those changed.

Source

D:/Projects/sage/tools/sync.py (docstring, AUTO_EVERY_HOURS)

Sage

The same files

What

Sage is a set of files in Git, so the model behind it can change. Each tool loads the soul, owner facts, current situation and the world’s rules through its own entry file.

Source

D:/Projects/sage/install.py (GEMINI_FILES)
D:/Projects/sage/README.md

Tool

Claude Code

What

The daily tool: the personality as an output style, owner facts through CLAUDE.md, plus the hooks, skills and specialists.

Source

D:/Projects/sage/install.py
D:/Projects/sage/SYSTEM.md (Tools)

Tool

Antigravity

What

Reads the personal GEMINI.md in every project. It runs Megamind’s guard but no Sage hooks, so it doesn’t change Sage’s files: it only adds notes to the inbox for Claude to process.

Source

D:/Projects/sage/OTHER-TOOLS.md
D:/Projects/sage/install.py (set_gemini)

Tool

Gemini CLI

What

Reads the same personal GEMINI.md as Antigravity. Kept updated, best effort.

Source

D:/Projects/sage/SYSTEM.md (Tools)
D:/Projects/sage/install.py

Tool

Codex

What

Codex can’t include files, so it reads a written-out copy that is refreshed whenever Sage’s files change. Kept updated, best effort.

Source

D:/Projects/sage/tools/refresh.py
D:/Projects/sage/SYSTEM.md (Tools)

71 code repos the university’s systems, one Git repo each D:/Projects/ubt-edu-sa/* catalogued, never copied One knowledge repo what is known about UBT’s systems Cases: 63 incidents and changes incidents/ · changes/ How things work, how to explanations/ · howto/ · queries/ Generated reference database schema · repo catalog D:/Projects/ubt-edu-sa/ubt-knowledge An agent at work in D:/Projects/ubt-edu-sa tries directly Direct client blocked mm guard asks Guarded path open case, purpose, logged mm db query University database agents read; production runs are Master’s Before and after: examples Master picks Example 1 empty: to be chosen by Master Before After Example 2 empty: to be chosen by Master Before After Example 3 empty: to be chosen by Master Before After
The same pattern at the day job: many university code repos, catalogued by one knowledge repo of cases and explanations; agents reach the university database only through Megamind's guarded path, while a direct client is blocked. Three example slots wait for Master's choice.
same pattern at work · many repos, one knowledge repo · database only through the guarded path · cases build up · examples: (pick)

World

Many code repos

What

The university’s systems, each its own Git repo inside the UBT world. The count is taken by stats.py on the date shown in visual 14.

Source

D:/Projects/ubt-edu-sa (repos with a .git folder)
D:/Projects/sage/presentation/src/stats.json

Knowledge

One knowledge repo

What

Everything learned about UBT’s systems: cases recorded as incidents and changes, explanations, how-tos, curated queries, and generated reference for the database schema and the repo catalog. Repos are catalogued, never copied.

Source

D:/Projects/ubt-edu-sa/ubt-knowledge (folder listing)
D:/Projects/megamind-core/README.md (mm repos catalog)

Sage

An agent at work

What

Work at UBT happens in the UBT world’s folder, where its rules and guard load, the same as in every other world.

Source

D:/Projects/sage/OPERATIONS.md (Sessions are organised by world)
D:/Projects/sage/OWNER.md (UBT is a world like the others)

Guard

Direct client blocked

What

A database client typed in a shell, or a script that imports a database driver, is refused before it runs, with the allowed route in the message.

Source

D:/Projects/megamind-core/mm/modules/safety.py
D:/Projects/ubt-edu-sa/.claude/settings.json

Megamind

The guarded path

What

mm db query: read-only queries only, with an open case and a stated purpose, each logged to the case. Guarded scripts run on the test database only.

Source

D:/Projects/megamind-core/rules/db-oracle.md

Database

University database

What

Agents read through the guarded path; production runs are the owner’s. Connection details live only on the machine, never in Git.

Source

D:/Projects/megamind-core/rules/db-oracle.md
D:/Projects/sage/SYSTEM.md (Where things belong)

To be chosen

Example slot

What

Before and after examples from UBT go here once Master picks them from the knowledge repo’s cases, with anything sensitive removed.

Source

D:/Projects/sage/presentation/HANDOFF.md (section 7)

Cost Setup per machine install.py on each machine, mm setup in every world, again when hooks change SYSTEM.md · Machines Lab notebook: release steps Cost Releases take time Megamind rollout: ~10 minutes across 8 knowledge bases; Sage’s full tests: ~17 minutes Lab notebook: release steps, open items (2026-11-01) Cost Rules to maintain the operating rules are at their size cap: a new rule must move an old one out Lab notebook: open items Limit Context budget what loads every session costs every session, so it is kept short and checked OPERATIONS.md · selfcheck.py Limit Guards block real work 117 heredoc blocks in 46 sessions (October 2026); false proof blocks on paths guides/claude-setup.md Limit Depends on the model “Instructions guide a model; they don’t guarantee anything.” evals/scenarios.md tools/soul.py Limit One owner production, merges and the soul wait for Master alone OWNER.md · tools/soul.py resale/AGENTS.md Evidence Learned the hard way 47 hard lessons recorded in the Lab notebook, so they aren’t repeated Lab notebook: Hard lessons Each entry comes from a dated record, not from memory. sources: presentation/FACTS.md, visual 13
What the system costs and where it is weak: setup on every machine, release time, rules at their size cap, a finite context budget, guards that sometimes block real work, dependence on the model, and a single owner. Each entry comes from a dated record.
it isn’t free · setup, releases, rules to maintain · guards misfire too · only as good as the model · one owner · all on record

Cost

Setup per machine

What

Each machine runs Sage’s installer, Megamind’s setup in each world and the top-folder setup once. The other machine needs a pull and the installer again when hooks or the installer change.

Source

D:/Projects/sage/SYSTEM.md (Machines)
D:/Projects/SajjadArifGul/knowledge/explanations/sage-and-megamind-lab-notebook.md (How to change and release safely)

Cost

Releases take time

What

A Megamind rollout runs in the background for about ten minutes across every knowledge base. Sage’s full test suite takes about 17 minutes on the work PC, so it runs in the background.

Source

D:/Projects/SajjadArifGul/knowledge/explanations/sage-and-megamind-lab-notebook.md (release steps; Open items)

Cost

Rules to maintain

What

OPERATIONS.md loads in every session, so it has a size cap and is at it; the next addition must move something out into a guide.

Source

D:/Projects/SajjadArifGul/knowledge/explanations/sage-and-megamind-lab-notebook.md (Open items: specialist roles)
D:/Projects/sage/tools/selfcheck.py

Limit

Context budget

What

The model’s context is finite. Owner facts stay under about 80 lines and adjustments at most 15; the self-check fails a file over its hard limit, and details go to guides read on demand.

Source

D:/Projects/sage/OPERATIONS.md (file sizes)
D:/Projects/sage/tools/selfcheck.py

Limit

Guards block real work

What

A guard that blocks also blocks honest mistakes: the heredoc guard fired 117 times in 46 sessions in October 2026, and the proof hook read hex inside file paths as commit hashes (false blocks, 23–31 October). Each case is recorded with its fix.

Source

D:/Projects/sage/guides/claude-setup.md (Other known guards)

Limit

Depends on the model

What

Rules guide the model but can’t force it. That is why behaviour is tested monthly and the soul is protected against drift, such as a weaker model rewriting it.

Source

D:/Projects/sage/evals/scenarios.md (intro)
D:/Projects/sage/tools/soul.py (docstring)

Limit

One owner

What

Production is his alone, only he merges, and only he approves the soul. Safe, but every one of those steps waits for him.

Source

D:/Projects/sage/OWNER.md (Standing decisions)
D:/Projects/sage/tools/soul.py
D:/Projects/Resale.com.pk/resale/AGENTS.md

Evidence

Learned the hard way

What

Hard lessons from building Sage and Megamind are written down with their fixes in the Lab notebook, which every Lab session reads first.

Source

D:/Projects/SajjadArifGul/knowledge/explanations/sage-and-megamind-lab-notebook.md (Hard lessons)
D:/Projects/sage/AGENTS.md

8 worlds sage.toml [worlds] 86 code repos folders with .git, all worlds 196 knowledge documents written, all knowledge repos 87 incident and change records incidents/ + changes/ 37 Megamind releases CHANGELOG.md · now 0.18.2 50 commits to Megamind git rev-list megamind-core 385 commits to Sage git rev-list sage 26 days since the first commit first: 2026-10-17 6 Sage hooks per world install.py HOOKS 10 Sage skills skills/*/SKILL.md 31 behaviour test scenarios evals/scenarios.md 47 hard lessons recorded Lab notebook Knowledge documents per world written documents, reference excluded UBT: 104 documents UBT 104 Resale: 34 documents Resale 34 electric: 27 documents electric 27 QuranLinked: 19 documents QuranLinked 19 Personal: 5 documents Personal 5 mesgs: 4 documents mesgs 4 WDP: 3 documents WDP 3 dyta: 0 documents dyta 0 Counted 2026-11-12 by stats.py, from the repos themselves sage eae2f89 · megamind-core a4800b0 · a number that can’t be counted by script is not shown python presentation/stats.py → presentation/src/stats.json
The system in numbers, counted by script from the repos on the date shown: worlds, code repos, knowledge documents and records, Megamind releases and commits, Sage commits, days since the first commit, hooks, skills, behaviour tests and recorded lessons, plus knowledge documents per world.
real counts, by script · 26 days old · UBT has the most knowledge · date on screen: how fresh it is

Counted by stats.py

8 worlds

What is counted

Worlds listed in sage.toml, one per organisation or project family.

Source

D:/Projects/sage/presentation/stats.py → src/stats.json, counted 2026-11-12

Counted by stats.py

86 code repos

What is counted

Git repos inside the world folders on this machine, knowledge repos not included.

Source

D:/Projects/sage/presentation/stats.py → src/stats.json, counted 2026-11-12

Counted by stats.py

196 knowledge documents

What is counted

Markdown documents in the knowledge repos' written folders (explanations, how-tos, decisions, incidents, changes, queries, FAQ, glossary, improvements, research). Generated reference pages, investigation traces and query logs are not counted.

Source

D:/Projects/sage/presentation/stats.py → src/stats.json, counted 2026-11-12

Counted by stats.py

87 incident and change records

What is counted

Incident and change records in all knowledge repos, including records imported from before the system began.

Source

D:/Projects/sage/presentation/stats.py → src/stats.json, counted 2026-11-12

Counted by stats.py

37 Megamind releases

What is counted

Release headings in megamind-core's CHANGELOG.md.

Source

D:/Projects/sage/presentation/stats.py → src/stats.json, counted 2026-11-12

Counted by stats.py

50 commits to Megamind

What is counted

Commits on megamind-core's checked-out branch.

Source

D:/Projects/sage/presentation/stats.py → src/stats.json, counted 2026-11-12

Counted by stats.py

385 commits to Sage

What is counted

Commits in the Sage repo, including memory saved at session end.

Source

D:/Projects/sage/presentation/stats.py → src/stats.json, counted 2026-11-12

Counted by stats.py

26 days since the first commit

What is counted

Days from the first commit in sage or megamind-core to the day the numbers were counted.

Source

D:/Projects/sage/presentation/stats.py → src/stats.json, counted 2026-11-12

Counted by stats.py

6 Sage hooks per world

What is counted

Hook entries Sage installs in each world: session start, session end, soul guard, command log, proof check, improvement check.

Source

D:/Projects/sage/presentation/stats.py → src/stats.json, counted 2026-11-12

Counted by stats.py

10 Sage skills

What is counted

Packaged routines, such as morning brief, remember, reflect, dream, evals and the specialist roles.

Source

D:/Projects/sage/presentation/stats.py → src/stats.json, counted 2026-11-12

Counted by stats.py

31 behaviour test scenarios

What is counted

Rows in Sage's behaviour test table, run monthly.

Source

D:/Projects/sage/presentation/stats.py → src/stats.json, counted 2026-11-12

Counted by stats.py

47 hard lessons recorded

What is counted

Numbered entries in the Lab notebook's Hard lessons list.

Source

D:/Projects/sage/presentation/stats.py → src/stats.json, counted 2026-11-12

Counted by stats.py

Knowledge documents per world

What is counted

Written Markdown documents in each world’s knowledge repo; generated reference pages, traces and query logs excluded.

Table

UBT: 104
Resale: 34
electric: 27
QuranLinked: 19
Personal: 5
mesgs: 4
WDP: 3
dyta: 0

Source

D:/Projects/sage/presentation/stats.py → src/stats.json, counted 2026-11-12

Turn your phone sideways to see the diagrams larger. Pinch to zoom.