Your agent wrote it. Git only kept the diff.
Morph runs beside git and records the agent sessions behind every commit: the prompts, the tool calls, the edits. You keep using git commit. Nothing in your repository changes, and teammates who do not use Morph see an ordinary git history.
It is an alpha. Expect bugs and breaking changes.
brew tap r/morph && brew install morph # installs morph and morph-mcpLinux and source builds: docs/INSTALLATION.md.
Once, in a git repository:
morph init # adds git hooks; .morph/ stays out of git
morph setup claude-code # records every Claude Code sessionmorph init runs the second command itself when the project already has a .claude/ directory or a CLAUDE.md. Cursor and OpenCode have their own morph setup.
Then work as usual:
# you and the agent edit code
morph status
# Agent sessions: 2 recorded since the last commit (the next commit carries them)
git commit -am "add retry logic" # plain git, by you or by the agent
morph show HEAD # evidence_refs: the sessions behind this commit
morph inspect recent # read the sessions backA post-commit hook mirrors each git commit into Morph and attaches the sessions recorded since the previous commit. There is no Morph command in the daily loop.
- Git owns the code and its history. Morph stores a second record in
.morph/, whichmorph initadds to.git/info/exclude. - By default the hooks only observe. They never block or change a git command.
- Only a commit you make in this working tree takes the waiting sessions. A pull or a merge of other people's commits does not.
- History older than
morph initstays in git.morph reference-sync --backfillmirrors it when you want it. - Sessions stay on your machine until you
morph pushthem to a Morph remote you chose.git pushnever carries them.
Details: docs/MORPH-AND-GIT.md.
morph setup claude-code # hooks in .claude/settings.local.json, kept out of git
morph setup claude-code --scope user # once per machine: every project that has a .morph/
morph setup cursor # .cursor/ hooks, rules and MCP server
morph setup opencode # opencode.json and a recording pluginClaude Code needs only morph on your PATH: the hooks call morph capture claude-code, which reads the transcript Claude Code already keeps. Cursor and OpenCode also use morph-mcp.
Guides: Claude Code, Cursor, OpenCode, Agent of Empires.
A recorded session holds whatever the agent saw, secrets included. morph forget <hash> removes one. Read docs/SECURITY.md before you share a store.
All of this is opt-in.
Test evidence on a commit. Tell Morph your test command once. morph commit then runs it, parses the result, and attaches it:
morph config commit.test_command "cargo test --workspace"
morph commit -m "fix retry logic" # wraps git add -A and git commit--no-test skips the run. See docs/EVAL-DRIVEN.md.
A merge gate. morph merge <branch> blocks a branch that scores worse than the one you are on, and morph merge-plan <branch> shows the bar. morph install-hooks --solo applies the same rule to a plain git merge. Morph compares the scores on the commits; it does not run your tests. See docs/MERGE.md.
$ git merge cheaper-model
morph: merge blocked: cheaper-model scores worse than main
features_shipped: cheaper-model 11, main 13 (need >= 13)
A shared record. Code travels through your git remote. Sessions and evidence travel through a separate Morph remote:
morph remote add team ssh://user@host/srv/morph-repo
morph push team mainSee docs/MULTI-MACHINE.md and docs/SERVER-SETUP.md.
A browser view. morph serve shows commits, sessions and policy at http://127.0.0.1:8765.
morph --help lists every command by group. The ones you will use:
| Command | What it does |
|---|---|
morph status |
Sessions waiting for the next commit, drift from git, evidence gaps |
morph log, morph show <ref> |
Commit history, and one commit with its evidence |
morph inspect recent, morph inspect show <hash> |
Read recorded sessions |
morph session list, morph session show <hash> |
List and print sessions |
morph commit -m |
git commit plus test evidence |
morph forget <hash> |
Remove a recorded session or prompt |
morph install-hooks |
Reinstall the git hooks |
- docs/README.md: the index, and how the pieces fit.
- docs/THEORY.md and docs/v0-spec.md: the model and the object schemas.
- CHANGELOG.md
cargo test --workspace # unit tests and YAML acceptance specs
cargo test -p morph-e2e --test cucumber # end-to-end scenariosSee docs/TESTING.md and CONTRIBUTING.md.