Skip to content

openprose/mycelium

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mycelium

An underground network of information for AI agents, based on git notes.

Agents read notes on arrival. They leave notes on departure. The network grows. Humans never see it unless they choose to look.

What it is

Structured notes attached to git objects — commits, files, directories. Agents use them to communicate decisions, warnings, context, and culture across sessions. The format is plain text with headers and edges. The storage is git notes. The dependency list is git and bash.

# agent arrives, reads what's known about a file
mycelium.sh context src/auth.ts

# agent works...

# agent leaves a note explaining what it did
mycelium.sh note HEAD -k context -m "Refactored retry logic. See warning on auth.ts."

Install

Install the runtime file (mycelium.sh) with the one-line installer:

curl -fsSL https://raw.githubusercontent.com/openprose/mycelium/main/install.sh | bash

By default this installs to ~/.local/bin/mycelium.sh. Override the location with PREFIX:

curl -fsSL https://raw.githubusercontent.com/openprose/mycelium/main/install.sh | PREFIX=/usr/local bash

If you already cloned the repo, you can install from the local checkout instead:

./install.sh

The runtime is still one file, with no dependencies beyond bash and git.

Quick start

# in any git repo
mycelium.sh note HEAD -k context -m "First note."
mycelium.sh read HEAD

For AI agents, load SKILL.md into your agent framework. The skill teaches the convention: check for notes before working, leave notes after.

Practical notes

Notes don't travel with normal push/pull. Git notes live on a separate ref (refs/notes/mycelium). To sync them:

mycelium.sh sync-init          # adds fetch/push refspecs for origin
git fetch origin               # now pulls notes
git push origin                # now pushes notes

GitHub has no native UI for git notes. Notes don't appear in diffs, PRs, file browsers, or the commit view. We consider this a feature — the mycelium is hidden until explicitly surfaced. To see notes locally:

mycelium.sh log                # recent commits with their notes
mycelium.sh activate           # permanently show notes in git log

Notes are scoped to branches. Work on a feature without polluting the main notes:

mycelium.sh branch use my-feature   # notes go to a separate ref
mycelium.sh branch use main         # switch back
mycelium.sh branch merge my-feature # merge when ready

Security considerations

Most tooling isn't aware of git notes because most developers don't know about git notes. Secret scanners, CI pipelines, and code review tools typically skip refs/notes/*. This means:

  • Secrets accidentally written to notes will not be caught by default tooling
  • Notes are public for public repos — anyone can git fetch them
  • git notes remove does not erase history — the old content persists in the notes ref log

We strongly recommend gitleaks. It scans notes by default (via git log --all which includes refs/notes/*). See our example hooks for pre-commit, pre-push, and post-checkout integration.

The tool

Core files:

File What Who it's for
mycelium.sh The CLI — read, write, navigate notes Agents and humans
install.sh Curl-to-bash installer for mycelium.sh Humans
SKILL.md Agent skill — teaches the convention AI agents

At runtime, you only need mycelium.sh. Everything else in this repo is support machinery: install.sh, tests, example hooks, and mycelium notes on the repo itself. Optionally load SKILL.md, and start writing notes.

Design history

The historical design docs have been distilled into mycelium notes instead of tracked markdown files. Browse them with:

mycelium.sh find decision
mycelium.sh find context
mycelium.sh find summary

Commands

mycelium.sh note [target] -k <kind> -m <body>   Write a note
mycelium.sh read [target]                        Read a note
mycelium.sh follow [target]                      Read + resolve all edges
mycelium.sh refs [target]                        Find all notes pointing at target
mycelium.sh context <path>                       Everything known about a file
mycelium.sh find <kind>                          Find all notes of a kind
mycelium.sh kinds                                List all kinds in use
mycelium.sh branch [use|merge] [name]            Branch-scoped notes
mycelium.sh edges [type]                         List all edges
mycelium.sh list                                 All annotated objects
mycelium.sh log [n]                              Recent commits with notes
mycelium.sh dump                                 Everything, greppable
mycelium.sh compost [path|.] [--dry-run|--report] Triage stale notes
mycelium.sh migrate [--dry-run] [--map <file>]   Reattach notes after jj rewrites
mycelium.sh doctor                               Graph state (facts only)
mycelium.sh prime                                Skill + live repo context for agents
mycelium.sh activate                             Show notes in git log
mycelium.sh sync-init [remote]                   Configure fetch/push

Kinds and edge types are open vocabulary — use whatever strings make sense. mycelium.sh kinds shows what's in use.

Composting

Notes go stale when the file they describe changes. Stale notes aren't wrong — they're just about an older version. Composting triages them:

mycelium.sh compost src/auth.ts --dry-run      # list stale notes with OIDs
mycelium.sh compost <oid> --compost            # compost a specific note
mycelium.sh compost <oid> --renew              # re-attach to current version
mycelium.sh compost src/auth.ts --compost      # batch: compost all stale on path
mycelium.sh compost src/auth.ts                # interactive mode (humans)
mycelium.sh compost --report                   # counts only (for hooks)

Composted notes aren't deleted — they're still accessible via read and dump, just no longer surfaced by context.

Migrate (jj)

When jj rewrites commits (amend, rebase, squash), notes on old commit OIDs become orphaned. migrate bulk-reattaches them using the targets-change edges that mycelium auto-adds in jj repos:

mycelium.sh migrate --dry-run          # show what would be reattached
mycelium.sh migrate                    # auto-resolve via jj change_id edges
mycelium.sh migrate --map mapping.txt  # explicit file: old_oid new_oid change_id

Skips conflicts (target already has a note), updates explains commit: edges, and is idempotent.

Slots

Multiple tools or agents can write notes on the same object without obliterating each other. Each slot is an independent notes ref.

mycelium.sh note src/auth.ts --slot skeleton -k observation -m "File structure."
mycelium.sh note src/auth.ts --slot enricher -k summary -m "Rich context."
mycelium.sh note src/auth.ts -k context -m "Default slot."  # no --slot

mycelium.sh read src/auth.ts --slot skeleton   # read one slot
mycelium.sh context src/auth.ts                # aggregates all slots
mycelium.sh compost src/auth.ts --slot skeleton --compost  # compost per-slot

context, doctor, find, kinds, prime aggregate across all slots. read and follow use the default slot unless --slot is specified. Supersedes is intra-slot only — writing to one slot never affects another.

Kinds

Kinds are just strings — there is no schema, no enum, no validation. You can write kind celebration or kind tech-debt and it works immediately. mycelium.sh kinds shows what's in use across your repo.

We ship with these defaults because they cover most agent and human workflows:

Kind Purpose
decision Why something was chosen — rationale that outlives the commit message
context Background an agent or human needs before touching this code
summary What a file or module does — the note a new reader wishes existed
warning Fragile areas, footguns, things that break in non-obvious ways
constraint Hard rules — must be retryable, must not depend on X, etc.
observation Something noticed but not yet acted on — a seed for future work
value Cultural principles — guides judgment rather than enforcing rules
todo Planned work — compost when done

Add your own, rename these, or ignore the ones you don't need. The vocabulary is yours.

Platform support

Works on Linux, macOS, and Windows (via Git Bash).

Dependencies: bash (3.2+), git, and POSIX coreutils (awk, grep, sed, sort, etc.). On Windows, Git for Windows ships all of these. Optional: gitleaks for secret scanning.

Roadmap

  • Claude Code plugin — native integration so Claude Code reads/writes mycelium notes automatically when working in git repos.
  • Pi extension — same for the pi coding agent, making mycelium a first-class part of the agent loop.

Spiritual predecessors

  • git-appraise — code review stored entirely in git notes. Proved that git notes can carry structured data at scale without touching the working tree.
  • git notes — the substrate itself. Existed since 2010, largely ignored by the ecosystem. GitHub's decision not to surface notes in their UI created the underground we now inhabit.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages