What I Took From Garry Tan's gbrain and gstack
I read both repos end to end, moved 14 ideas into my markdown second brain, and left 6 behind on purpose.
A pull request sat in my repo for four months. Mamdouh Aboammar opened it on August 7 to harden the update script in COG, my open-source second brain. It had 15 tests in it. I left one comment in August and then let it rot while I added skills.
That is the state I was in when I sat down to read Garry Tan's two repos. gbrain is his agent memory. gstack is his skill pack for coding agents. Both get commits most days. I wanted to know what a person with far more users than me does differently, and what of it fits a vault that is only markdown and shell.
He deletes his own skills
The file that stopped me was docs/cut-skills.md in gstack. In November he deleted two of his own skills, /investigate and /cso, because his tests could not show that they beat a plain request. The numbers are in the file. /investigate passed 50.0% of 18 real bugs against 47.2% for a plain prompt, a gap the test cannot tell from zero, at about 43% more cost. /cso named 8 of 51 security advisories; the plain prompt named 12.
The rule he wrote down: "A gstack skill stays only while it beats asking the agent plainly."
I have never deleted a skill. COG had 43 of them and I could not tell you which ones still earn their place. Every skill costs tokens in every session, because its name and description load at start. I had no number for that cost either.
gbrain has the same habit on the memory side. Its README has a section on when not to use it. It reports losing to an agent with plain grep on very long chat logs, 55.2% against 67.4%. One research note tests an idea, finds it moved made-up answers only from 22.7% to 20.7%, and ends with a decision not to build it.
So the first thing I took was the habit of measuring before adding.
What I took
I read both repos through a fan of agents, got back about 60 candidate ideas, and judged 21 of them properly. Fourteen went into COG.
- Two-zone pages
- Back-link rule
- Maintenance pass with a fixed order
- Quote check by script
- Context bill and audit
- Skillify with trigger tests
- Reference drift check
- Opt-in safety hooks
- Embedding search
- Skill packs
- Skill generator
- Deterministic skill router
- Action ledger
Two zones per page
gbrain splits every entity page in two. The top is a summary that the agent may rewrite. Below a marker line sits a dated timeline that is only ever appended. Every claim in the summary must trace to a line in the timeline.
Runs platform at a 40-person startup. Cares about test flakiness. Prefers async.
2026-09-14 | Met at a meetup, talked about flaky tests
2026-10-02 | Sent the CI article, replied same day
2026-12-01 | Referenced in [[weekly-notes]], asked for a follow-up
My people notes already had a timeline. What I lacked was the second rule, which gbrain calls the Iron Law: a note that mentions a person adds a dated line to that person's page. Obsidian shows backlinks in a panel, but an agent reads the file. The line has to be in the file.
A maintenance pass with a written order
gbrain runs a nightly cycle and the code has a comment next to each phase saying why it sits where it does. I had /knowledge-consolidation and /memory-hygiene as separate skills that I ran when I remembered, which was rarely.
COG now has /dream. It runs eight phases in one order and the first run only proposes.
The part I like most is phase six. After a model writes a summary, a Python script checks that every quoted span is a verbatim slice of the source file. A quote that fails moves to an unverified_claims list in the frontmatter. No model is asked whether the model was right.
A bill for context
gstack publishes a token cost per skill and fails CI when the always-loaded part grows. I wrote the same thing as scripts/context-bill.py and ran it on COG. The always-loaded layer came to about 26,700 estimated tokens. AGENTS.md alone was about 14,000. One skill body was 18,000.
I did not fix those numbers in this release. I set the CI budget about 10% above them, so the next person who adds 2,000 tokens to a file that loads every session has to raise a limit on purpose. That person is usually me.
What I skipped
gbrain's core is search: embeddings, hot and cold memory, recall at session boundaries. I skipped all of it. COG has no database and I do not want one. The honest consequence went into the README as a section named "When COG Is the Wrong Tool". If your notes fit in one context window, grep and a plain prompt will do, and you do not need my repo.
I also skipped gstack's skill generator and its deterministic router. The router ships off by default in gstack itself after it added noise. That was enough for me.
What broke on the way
The reference checker found 18 places where a COG skill named a file, script or command that does not exist. I shipped those. Then I ran the same script on my private vault and it found 69.
Three reviewer agents read the release before I pushed. They returned 27 findings. One was a real blocker: the quote check ignored blockquotes, which is where most quotes live. The docs said a script could verify quotes, and for the most common case it could not.
Then CI failed on its first Linux run. Two tests left Python bytecode inside a folder that another check compares byte for byte. It passed on my Mac every time.
And the four-month pull request finally landed, along with Caio Barbosa's change that lets the notes live outside the repo. Both conflicted with releases I had cut while they waited, so the conflicts were my doing. Mamdouh's 15 tests are the reason CI exists at all. Users on an older version have to run the updater twice, because the old script cannot restart itself. That is in the changelog.
Still unmeasured
I took the rule that a skill must beat a plain prompt, and I have not yet run that comparison for a single one of my 49 skills. The policy is written. The cut list is an empty table.
That is the next thing to do, and I expect it to cost me a few skills I am fond of.
The release is COG v3.18.0. The changelog credits each idea to the repo it came from.