Docs / History & versions

History & versions

Turn history, references, and addressing commits.

Use history to recover a decision, review an agent’s work, or find the right point to continue from. Start with a session you have saved using agit commit; Everyday commands covers that workflow.

Examples use alice/my-project@first-task. Replace it with your repository and session branch. To read another person’s published history locally, first run agit clone owner/repo.

Find a session or turn

agit log alice/my-project --branches
agit log alice/my-project@first-task
agit log alice/my-project@first-task --oneline --limit 10

The repository view lists session branches. The branch view lists saved turns, commit IDs, messages, and milestones. Use --grep "login" to filter messages, --since 7d for recent work, or --graph to inspect relationships between branches.

Read a conversation

agit show alice/my-project@first-task
agit show alice/my-project@first-task#3
agit show alice/my-project@first-task#3.2

The branch head renders the conversation’s current VIEW. #3 selects turn 3; #3.2 selects event 2 within that turn. Use numbers from your own history. When AGIT_SESSION is set, agit show @ selects that exact session branch.

Add --max-chars 10000 to ordinary show output when you need longer message bodies.

Browse history in the terminal

From an interactive terminal in your project, select a session explicitly and open its turn timeline:

AGIT_SESSION=alice/my-project@first-task agit log --tui

Replace the target with your own. The timeline requires log without a positional target or filtering options; AGIT_SESSION selects the branch explicitly. The screen might look like this, with illustrative conversation titles:

alice/my-project @ first-task

  #3  Add a regression test
> #2  Explain the proposed change
  #1  Find where the request is handled

Use the arrow keys and the key hints at the bottom to inspect a turn or go back. agit show alice/my-project@first-task --tui opens the conversation browser for that branch. Run these interactive screens from a terminal, outside the agent’s tool shell. Use --no-tui for ordinary text output or --json for machine-readable output.

Read a shared file

Append :path to a saved point to inspect an instruction, memory, or skill file:

agit show alice/my-project@first-task:AGENTS.md
agit show alice/my-project@main:memory/decisions.md

Use a path that exists at the selected point. The selector also works with a tag or commit SHA in place of the branch, so you can inspect the shared files that accompanied an earlier version of a conversation.

Compare saved points

agit diff 'alice/my-project@first-task#2..first-task#5'

Pass both endpoints as a single a..b argument. The right endpoint can omit the repository when both points belong to the same repo, but must still name the branch or another saved reference.

The default --turns mode compares recorded turns. Use --view to compare selected conversation context, or --files for shared files such as memory/ and skills/:

agit diff 'alice/my-project@first-task#2..first-task#5' --view
agit diff 'alice/my-project@first-task#2..first-task#5' --files

Inspect the context an agent will receive

agit view alice/my-project@first-task
agit view alice/my-project@first-task --json

The VIEW selects the events used to restore the conversation. It includes merge markers and summaries, so you can see what a resumed agent will receive. The underlying evidence log also retains events excluded from the VIEW. Core concepts explains the distinction.

Reference syntax

Reference Meaning
first-task Branch head in the repository supplied by AGIT_SESSION
alice/my-project@first-task Explicit repository and branch
first-task#3 Turn 3
first-task#-1 Latest turn
first-task#3.2 Event 2 inside turn 3
first-task#2..#5 Turns 2 through 5, for commands accepting a range
ms-login A tag naming a saved point
A commit SHA or full agit-<40-hex> version ID A saved version
first-task:AGENTS.md A file on the selected session branch
main:memory/decisions.md Shared file content on the main line
@ The session branch supplied by AGIT_SESSION

Selectors combine: alice/my-project@first-task#3.2 identifies an event without depending on the terminal’s current context. A reference to an old turn is for inspection; use agit fork to continue work from it.

Search hosted history

agit search "rate limit retry"
agit search "agent:alice/my-project login"

The search guide covers repository scopes, author and date filters, batch queries, pagination, and incomplete results. Search requires agit login and queries the Hub’s corpus you have permission to read. Put filters such as agent:owner/repo, runtime:codex, or in:prompt inside the query. You can also ask your agent to search using the MCP integration:

Search our AgentGit history for the retry strategy we used, read the relevant turns, and cite the session before proposing a change.

Export a conversation

agit export alice/my-project@first-task --format markdown -o conversation.md
agit export alice/my-project@first-task#2..#5 --format jsonl

Use jsonl, ir, or markdown for general exports, or a registered runtime’s native format, including claude-code, codex, opencode, openclaw, hermes, and workbuddy. See native export and restoration for the difference between an exported file and an installed runtime session. The default exports the full evidence log. Add --view-only for only the context selected by the VIEW, or --redact to mask detected secrets in the exported output. Review the resulting file before sharing it.

Next, resume or fork the work, or share it with someone else.