{"slug": "show-hn-maccha-cross-agent-brain-for-antigravity-claude-code-opencode-etc", "title": "Show HN: Maccha – Cross Agent Brain for Antigravity, Claude Code, OpenCode etc.", "summary": "Maccha, a lightweight file architecture and set of markdown templates, enables cross-agent persistent memory for AI coding assistants like Antigravity, Claude Code, and OpenCode, allowing them to share a unified digital identity without requiring heavy background processes. The system stores structured memory in the user's home directory, solving the problem of transient context and enabling seamless switching between tools.", "body_md": "Turn Antigravity, OpenCode, Claude Code, or any other AI coding assistant into a fully contextualized, highly secure, self-improving Real-World Digital Assistant.\n\n**MACCHA is a lightweight file architecture, a set of intelligent markdown templates, and a suite of maintenance scripts that live in your home directory. It acts as a universal, persistent \"brain\" that any local AI agent can plug into.**\n\nIt solves the biggest limitation of modern AI coding agents: **transient memory and repetitive context-setting**.\n\nWhen you open a new workspace or start a terminal session, standard AI assistants start from absolute zero. They forget who you are, your technical preferences, your system constraints, and the hard-earned lessons from yesterday. You have to explain your project rules over and over again.\n\n**MACCHA solves this permanently.** By establishing a structured memory hierarchy and automated maintenance loops, any AI agent reading your system instantly inherits a persistent, self-improving, and highly protected professional profile.\n\nBecause this memory lives directly in your file system—not in a proprietary cloud silo—**MACCHA creates a shared, evolving intelligence across different platforms.** You can switch seamlessly between Antigravity, OpenCode, and Claude Code. They will all read from and write to the same MACCHA brain, sharing a single, unified digital identity.\n\nImagine this:\n\n**Monday**: You tell Antigravity that you strictly use`pnpm`\n\nand prefer dark-mode CSS without Tailwind. The agent writes this rule to your MACCHA memory.**Wednesday**: You open Claude Code in a completely different project. It instantly reads MACCHA, knows your`pnpm`\n\nand CSS preferences, checks your`todo.md`\n\nto see what you're working on, and starts coding exactly the way you like.**Friday**: You shut everything down. No background servers are running. Your entire agentic identity rests safely in a few kilobytes of text files, ready to be instantly rehydrated next week.\n\nWhile projects like **Hermes Agent** and **OpenClaw** provide incredibly powerful autonomous assistants, they are typically designed as \"always-on\" daemons. They require heavy local computing power, continuous background processing, and constant API polling. For many users, running a heavy 24/7 node simply isn't feasible.\n\nMACCHA is built for people who **cannot or do not want to run heavy, 24/7 background agents**, but still want the compounding benefits of a sophisticated, self-improving autonomous system.\n\n**Lightweight Hardware:** Runs flawlessly on constrained hardware (like Chromebooks, older laptops, or free-tier cloud environments). The agent only consumes compute when you actively invoke it.**Cross-Agent Synergy:** You are never locked into one tool. Antigravity can start a complex coding task today, and OpenCode can continue it tomorrow.**Human-in-the-Loop (HITL) by Default:** Perfect for sensitive operations, financial tasks, or personal data. You remain the conductor. The agent acts on-demand and proposes changes; you approve them. There are no runaway background processes.**True Continuity:** Despite not running 24/7, MACCHA's architecture gives you the same continuous context, tool integration, and long-term memory as an always-on agent.\n\n**If you want the persistent memory and deep context of a sophisticated digital assistant, but need it to be highly resource-efficient and fully under your control—MACCHA is your bridge.**\n\nTo make this possible, MACCHA organizes your system context into seven distinct, isolated tiers. This prevents memory bloat, avoids context-drift, and enforces a strict priority structure so the AI always knows exactly what is most important.\n\n```\n             ┌─────────────────────────────────────────────────────────┐\n             │                      USER REQUEST                       │\n             └────────────────────────────┬────────────────────────────┘\n                                          │\n                                          ▼\n                      ┌───────────────────────────────────────┐\n                      │    TIER 0: ~/AGENTS.md (Bootstrap)    │\n                      └───────────────────┬───────────────────┘\n                                          │\n                                          ▼\n                      ┌───────────────────────────────────────┐\n                      │  TIER 1: ~/BRAIN/AGENTS.md (Mandates) │\n                      └───────────────────┬───────────────────┘\n                                          │\n                                          ▼\n                      ┌───────────────────────────────────────┐\n                      │  TIER 2: ~/.gemini/GEMINI.md (Global) │\n                      └───────────────────┬───────────────────┘\n                                          │\n                                          ▼\n        ┌─────────────────────────────────┴─────────────────────────────────┐\n        ▼                                 ▼                                 ▼\n┌──────────────┐                  ┌──────────────┐                  ┌──────────────┐\n│    TIER 3    │                  │    TIER 4    │                  │    TIER 5    │\n│    SITUATION │                  │  LIVE STATE  │                  │ AUTO-IMPROVE │\n│    ~/INFO    │                  │ ~/BRAIN/tms  │                  │~/IMPROVEMENT │\n└──────────────┘                  └──────────────┘                  └──────────────┘\n        │                                 │                                 │\n        └─────────────────────────────────┼─────────────────────────────────┘\n                                          │\n                                          ▼\n                      ┌───────────────────────────────────────┐\n                      │  TIER 6: ~/BRAIN/learned-lessons/     │\n                      └───────────────────┬───────────────────┘\n                                          │\n                                          ▼\n             ┌─────────────────────────────────────────────────────────┐\n             │              FULLY CONTEXTUALIZED AI AGENT              │\n             └─────────────────────────────────────────────────────────┘\n```\n\n| Tier | File / Location | Purpose | Priority |\n|---|---|---|---|\nTIER 0 |\n`~/AGENTS.md` |\nMaster Bootstrap: The absolute first file any agent must read. Activates the engine. |\n🔴 Highest |\nTIER 1 |\n`~/BRAIN/AGENTS.md` |\nProject Mandates: Session rules, meso memory rules, and local development standards. |\n🟠 High |\nTIER 2 |\n`~/.gemini/GEMINI.md` |\nMachine Mandates: Cross-project preferences, machine hardware profile, global security. |\n🟡 Medium |\nTIER 3 |\n`~/INFO/over-owner/SITUATIE_OVERZICHT.md` |\nOwner Situation: Central reference for personal context, legal/medical history, and targets. |\n🟢 Reference |\nTIER 4 |\n`~/BRAIN/tms/` + `~/BRAIN/policies/` |\nLive State: TMS task flow (todo / in-progress / done) and the machine-enforced guardrails. |\n🟢 State |\nTIER 5 |\n`~/IMPROVEMENT.md` |\nLong-Term Auto-Improvement: Feedback loop tracking what the agent learned during the session. |\n🟢 Feedback |\nTIER 6 |\n`~/BRAIN/learned-lessons/` |\nTechnical Lessons: A highly curated directory of reusable coding/configuration patterns. |\n🟢 Lessons |\n\nImportant\n\n**The Routing Rule:** A piece of information MUST live in exactly one tier. If a conflict or duplicate arises, priority is determined from top to bottom (Global/Machine Rules supersede project templates, which supersede situational references).\n\nNote\n\n**The Zone Model:** `~/BRAIN/`\n\nis exclusively the *technical* capsule (mandates, memory, TMS, hooks, policies) — it stays PII-free and portable. Personal content lives in dedicated root zones: `~/INFO/`\n\n(dossiers & knowledge base), `~/PLAN/`\n\n(plans) and `~/INBOX/`\n\n(the owner → agent drop-off channel: drop any PDF, letter or note there; the session-startup script reports the item count, and the agent processes every item to its owner location and empties the folder). Convenience access to single files from the root happens only via symlinks.\n\nA sophisticated, 13-category temporal memory bank (`Instruction`\n\n, `Fact`\n\n, `Decision`\n\n, `Goal`\n\n, `Preference`\n\n, etc.) that features:\n\n**Exponential Confidence Decay**: Automatically reduces the confidence scores of transient situational facts over time while preserving stable, core facts.**AI-Powered Semantic Conflict Detection**: Scans proposed memory inserts against existing ones to catch and supersede contradictions automatically (compatible with Gemini 3.0 Thought Signatures).**Hybrid Search Recaller**: Batched cosine-similarity vector embeddings combined with Jaccard keyword overlap fallbacks.\n\nAn advanced diagnostics utility specifically engineered to maintain system health on resource-limited systems (such as Chromebooks running Crostini):\n\n**Terminology Alignment**: Categorizes project directory state as either**💧 HYDRATED**(dependencies present) or**🌵 DORMANT**(dependencies pruned to free space).** Interactive Cleanup**: Clears cache stores (`pnpm`\n\n,`npm`\n\n), optimizes bloated`.git`\n\ndatabases via`git gc --prune=now`\n\n, and identifies massive unused files to reclaim space instantly.\n\nMACCHA turns your workspace into an ironclad security zone, protecting users who aren't cybersecurity experts:\n\n**Supply Chain Cooldown**: Enforces a`minimum-release-age=7d`\n\nfor all packages to safeguard against zero-day malware.**HITL (Human-in-the-Loop) Mandate**: Under no circumstances can an agent execute actions modifying real-world capital or sending emails without explicit manual confirmation.**Auto-Guard Scans**: Performs pre-install`pnpm audit`\n\nchecks and prints immediate`Safety Report: GREEN/RED`\n\nflags.**Secrets Scan**: Detects leaked API keys, RSA private keys, or service JSONs before committing.\n\nAutomatic, script-driven maintenance keeps your daily workspace organized without mental overhead:\n\n**TMS Integrity Hook**: Validates that all files modified in the workspace or committed via git are logged correctly under the TMS files (`todo.md`\n\n,`in-progress.md`\n\n,`done.md`\n\n).**Pruning Rotator**: Completed items flow through`done.md`\n\nand are archived quarterly into`~/BRAIN/archive/tms/<year>-Q<x>.md`\n\n, preventing context windows from bloating.**Rule Guard at Startup**:`session-startup`\n\nflags leftover`[x]`\n\nitems, broken TMS symlinks and an overgrown`in-progress.md`\n\n(max ±10 active items), and triggers a throttled weekly sweep.\n\nSet-and-forget disaster recovery for the entire knowledge base:\n\n**AES-256 encrypted tar** of your personal zones (`INFO/ PLAN/ BRAIN/ …`\n\n) written to a mounted cloud drive, with a 4-backup rotation and an automatic decrypt-and-list integrity check.**Key stays local**: generated once into`~/.config/maccha/backup.key`\n\n(keep an off-device copy); plain restore instructions are written next to the backups — without the key.**Zero overhead**: triggered automatically (throttled, once per 7 days) by`session-startup`\n\n.\n\n```\nreal-agent-setup/\n├── system-brain/                  # MACCHA templates (PII-free, ready to customize)\n│   ├── AGENTS.md                  #   Root bootstrap — fill with your own context\n│   ├── IMPROVEMENT.md             #   LTAIS auto-improvement loop\n│   ├── ALIASES.md                 #   Your aliases and shortcuts\n│   ├── todo.md                    #   Task tracker\n│   ├── in-progress.md             #   Current work\n│   └── done.md                    #   Accomplishments\n├── brain/                         # Memory engine\n│   ├── lib/memanto_engine.py      #   13-category working memory (Memanto)\n│   └── README.md\n├── cli-tools/                     # Shared CLI utilities (AI models, storage, cleanup)\n├── infrastructure/                # Shared bridges and session maintenance scripts\n├── learned-lessons/               # Runtime directory (populated locally, never pushed)\n│   └── README.md\n├── setup.sh                       # Install script for new machines\n└── publish.sh                     # Publish local improvements back to repo\n```\n\n*(Note: Directories like cli-tools and infrastructure contain numerous specialized scripts for system maintenance, AI integrations, and daily workflows.)*\n\n- A Unix-like environment (Linux, MacOS, WSL, or ChromeOS Crostini).\n`git`\n\nand`bash`\n\ninstalled.- An AI coding assistant capable of reading local files (Antigravity, OpenCode, Claude Code, Cursor, etc.).\n\nTo set up a new machine with the complete MACCHA scaffolding harness:\n\n```\ngit clone --depth 1 git@github.com:KarelTestSpecial/real-agent-setup.git\ncd real-agent-setup\nbash setup.sh\n```\n\nNote\n\n**Safe Installation:** `setup.sh`\n\nis completely non-destructive. It carefully copies templates to your home folder without overwriting *any* of your existing files or configurations.\n\n**What the setup script accomplishes:**\n\n- Installs all standard\n**CLI utilities** in`~/bin/`\n\n— including the`session-startup`\n\nand`session-closeout`\n\nlifecycle scripts. - Configures\n**Infrastructure Bridges**(storage manager, cloud-drive access, deep-research runner) in`~/INFRA/`\n\n. - Copies MACCHA\n**PII-free templates**(`AGENTS.md`\n\n,`IMPROVEMENT.md`\n\n, etc.) to your home folder`~/`\n\n. - Offers an optional interactive prompt to download, compile, and configure the local\n**Himalaya CLI** email client in`~/.local/bin/`\n\n.\n\n**Populate Your Context**: Open the generated`~/AGENTS.md`\n\nand define your personal constraints, rules, and technical preferences.**Add CLI Tools to PATH**: In your`~/.bash_aliases`\n\n(or`~/.zshrc`\n\n), ensure`~/bin`\n\nis included in your PATH:\n\n```\nexport PATH=\"$HOME/bin:$PATH\"\n```\n\n**Boot Your Agent**: Launch Antigravity, OpenCode, or your preferred agent. The agent will read`~/AGENTS.md`\n\nautomatically at startup and immediately assume its professional persona.\n\nTip\n\n**Bookend every session — if needed, run startup and closeout yourself.** The agent reads its mandates automatically, but the two lifecycle rituals are not deterministic for every agent (ask your agent for help on this):\n\n**At the start of a session**, ask the agent to*\"run the startup checklist\"*(or run`session-startup`\n\nyourself). This primes context, reports your`~/INBOX/`\n\nitem count, verifies the TMS, and triggers the throttled weekly backup.**At the end of a session**, ask the agent to*\"run closeout\"*(or run`session-closeout`\n\nyourself). This captures any new learned lessons, syncs the TMS (`todo`\n\n/`in-progress`\n\n/`done`\n\n), prunes stale items, and records the session event in memory.\n\nMaking these two requests a habit is what turns MACCHA from a static rule file into a genuinely *self-improving* brain — each closeout compounds into the next startup.\n\nChanged your mind, or just testing on a throwaway machine? `uninstall.sh`\n\nreverses `setup.sh`\n\n— **safely**. It removes a file only if it is still byte-for-byte identical to the repo copy (i.e. you never touched it). Anything you edited, and every personal data directory, is left completely alone.\n\n```\ncd ~/real-agent-setup\nbash uninstall.sh            # DRY-RUN — lists what would be removed, deletes nothing\nbash uninstall.sh --force    # asks y/N before deleting each pristine file\nbash uninstall.sh --force --yes   # delete pristine files without prompting\n```\n\nImportant\n\n**Always dry-run first.** The default `bash uninstall.sh`\n\n(no flags) only *reports* — it never deletes. Read the list, then re-run with `--force`\n\nto act on it. With `--force`\n\nyou are still asked to confirm every single file unless you add `--yes`\n\n.\n\nNote\n\n**What it never removes:** your edited templates (`~/AGENTS.md`\n\n, `todo.md`\n\n, …), your memory store (`~/INFRA/agents-brain/data`\n\n), and your personal zones (`~/BRAIN`\n\n, `~/INFO`\n\n, `~/PLAN`\n\n, `~/learned-lessons`\n\n). These are reported as **kept** and must be deleted by hand if you truly want them gone. The optional Himalaya client (`~/.local/bin`\n\n+ its PATH line) is also left for manual cleanup. Every run ends with an itemized report of exactly what was installed, removed, kept, and skipped.\n\nTo push local improvements, bug fixes, or performance refinements to the shared utilities back to the public repository:\n\n```\ncd ~/real-agent-setup\nbash publish.sh           # Interactively copies, commits, and pushes\nbash publish.sh --dry-run # Review changes before committing\n```\n\nWarning\n\n`publish.sh`\n\nwill **NEVER** copy your personal files (`~/AGENTS.md`\n\n, `~/BRAIN/`\n\n, `~/learned-lessons/`\n\n) to the repository. Your private data and re-integration context remain completely localized to your physical machine.\n\n`publish.sh`\n\ncopies your working scripts verbatim, so a few personal details can ride along (a home-folder name, a one-off local tool). To keep those out of the public repo **without ever writing them into the committed publish.sh itself**, the publish step is driven by three optional,\n\n**gitignored** config files in the repo root. They live only on your machine; if a file is absent, that step is simply skipped.\n\n| File | Purpose | Example line |\n|---|---|---|\n`.publish-skip` |\nFilenames/globs to exclude from publishing entirely (one per line, `#` comments, globs allowed). |\n`my-personal-tool.js` |\n`.publish-sanitize.sed` |\n`sed` rewrite rules applied to every copied file — turn personal tokens into the public `*-owner` standard. |\n`s#over-myname#over-owner#g` |\n`.publish-pii-words` |\nWordlist for the hard PII gate: if any of these words (or a hardcoded `/home/<user>/` path) survives into the synced content, the publish aborts before committing. |\n`myname` |\n\nIn addition, you can wrap any personal, non-generic block inside an otherwise-shared script with markers — `publish.sh`\n\nstrips everything between them on sync:\n\n```\n# >>> LOCAL-ONLY\n...personal block kept locally, never published...\n# <<< LOCAL-ONLY\n```\n\nNote\n\nThese three files are listed in `.gitignore`\n\n, so they are never tracked or pushed. Create them from scratch on each machine you publish from. New contributors adopting the framework simply add their own.\n\n*MACCHA v2.0 | Multi-Agent Continuous Context Harness*\n\n*\"Continuity is the absolute key to agentic performance.\"*", "url": "https://wpnews.pro/news/show-hn-maccha-cross-agent-brain-for-antigravity-claude-code-opencode-etc", "canonical_source": "https://github.com/KarelTestSpecial/real-agent-setup", "published_at": "2026-06-20 22:31:18+00:00", "updated_at": "2026-06-20 22:37:17.858333+00:00", "lang": "en", "topics": ["ai-tools", "developer-tools", "ai-agents", "large-language-models"], "entities": ["Maccha", "Antigravity", "Claude Code", "OpenCode", "Hermes Agent", "OpenClaw"], "alternates": {"html": "https://wpnews.pro/news/show-hn-maccha-cross-agent-brain-for-antigravity-claude-code-opencode-etc", "markdown": "https://wpnews.pro/news/show-hn-maccha-cross-agent-brain-for-antigravity-claude-code-opencode-etc.md", "text": "https://wpnews.pro/news/show-hn-maccha-cross-agent-brain-for-antigravity-claude-code-opencode-etc.txt", "jsonld": "https://wpnews.pro/news/show-hn-maccha-cross-agent-brain-for-antigravity-claude-code-opencode-etc.jsonld"}}