Shared memory lets a new session inherit useful project knowledge from the
Agent repo’s main line. It is separate from the conversation VIEW and from
personal memory that a runtime keeps on this machine.
Inspect the memory for a session
agit memory status --into alice/my-project@first-task
agit memory diff --into alice/my-project@first-task
Replace the target with your session. Status compares the runtime’s memory,
the session branch’s memory/, and main. Diff shows branch changes against
main; add a filename such as decisions.md to inspect one file.
How runtime memory is collected
Claude Code has a project memory directory. When AgentGit starts or resumes a
session, it places the branch’s memory in a per-branch mirror there and adds
links to the runtime’s MEMORY.md index. Existing personal files are preserved.
At agit commit, AgentGit collects new, edited, or deleted top-level Markdown
files relative to the recorded startup baseline, including changes in the
branch mirror. Untouched memory that was already present before the session
stays local. The runtime’s own MEMORY.md, nested directories, and non-Markdown
files are not collected. Files rejected by the secret scan are not collected.
If the session was not started through AgentGit, the first collection records a baseline without copying all pre-existing memory. An explicit sync can collect all top-level memory when that baseline is absent, so inspect the files first:
agit memory sync --into alice/my-project@first-task
Sync collects runtime changes to the branch, then refreshes the runtime mirror.
Only Claude Code currently has this automatic memory-directory integration.
For other runtimes, runtime sync is a no-op; branch status and distillation still
work. Set agit config memory.track off to disable collection on this machine,
including explicit sync.
Promote a reviewed file to main
Session memory does not enter main just because a conversation was saved.
Review a file and explicitly promote it:
agit memory diff decisions.md --into alice/my-project@first-task
agit memory distill decisions.md --into alice/my-project@first-task
Use an actual filename from memory status. Distillation scans each file for
secrets and asks for confirmation, then records a file commit on main.
agit distill is an alias for agit memory distill; --yes skips the per-file
confirmation only when you already intend those changes.
A file inherited from main and deleted on the branch can be promoted as a deletion. If main also changed it, AgentGit reports the conflict instead of discarding main’s version. Inspect the diff rather than treating distillation as a text-summary operation: it carries selected file changes, including deletions.
Publish shared knowledge for new sessions
agit push alice/my-project@main
agit new alice/my-project -b next-task --as codex
Publishing main lets colleagues fetch the reviewed shared files. New sessions
inherit that main line. A colleague with an existing clone can first run
agit pull alice/my-project@main; starting another conversation does not itself
fetch updates. Publishing a session branch and publishing main are separate.
See Core concepts for instructions and skills on main, and secret protection before sharing memory.