Sandbox
@re-cinq/shift-log

Git Notes for coding agent conversations

Shift Log attaches agent conversations to commits using standard Git Notes. After `shiftlog init`, it wires in hooks for supported agents so conversations are saved, searchable, resumable, and synced with the repo.

49 stars4 forksGoUpdated 6d ago
Who it's for

Builders who want their agent sessions recorded alongside commits and available later for search or replay.

What it delivers

You can recover the conversation that led to a commit instead of guessing how it happened.

What it does

Save conversations to Git Notes

Stores chat history on commits under `refs/notes/shiftlog` so `git log` stays clean.

Agent-specific hooks

Connects with Claude Code, Codex CLI, Copilot CLI, Gemini CLI, and OpenCode through their hook or plugin systems.

Search and list history

`shiftlog list` and `shiftlog search` let you find past conversations by text or metadata.

Resume from a commit

`shiftlog resume <commit>` restarts a session from a specific commit or ref.

Sync across clones and rebases

`shiftlog sync push/pull` moves notes with the repo, and `shiftlog remap` handles GitHub rebase-and-merge cases.

Browser viewer

`shiftlog serve` starts a web view for browsing stored conversations.

How to get it

  1. 1Run
    curl -fsSL https://raw.githubusercontent.com/re-cinq/shift-log/master/scripts/install.sh | bash
  2. 2Run
    # ...In a Git repo
    shiftlog init --agent=<agent>
  3. 3See what conversations you have
    shiftlog list
  4. 4Search through past conversations
    shiftlog search "authentication"          # Text search
    shiftlog search --agent claude --branch main  # Filter by metadata
    shiftlog search "jwt" --regex --context 2     # Regex with context lines
  5. 5Get a quick summary of a conversation
    shiftlog summarise        # Summarise HEAD conversation
    shiftlog tldr HEAD~1      # Alias, works the same way
    shiftlog tldr --focus="security"  # Prioritise security-related changes
  6. 6Resume a past session
    shiftlog resume abc123    # By commit SHA
    shiftlog resume HEAD~3    # By git ref

README

Shift Log

Save, view, and search coding agent conversation history, persisted as Git Notes.

Install

curl -fsSL https://raw.githubusercontent.com/re-cinq/shift-log/master/scripts/install.sh | bash
# ...In a Git repo
shiftlog init --agent=<agent>

Where <agent> is claude (default), codex, copilot, gemini, or opencode.

Now work with your coding agent as you would normally. Whenever you or the agent commit, the conversation since the last commit will be attached to that commit as a Git Note.

Supported Agents

AgentInit commandHow it hooks in
Claude Codeshiftlog init (default).claude/settings.json hooks
Codex CLIshiftlog init --agent=codexPost-commit git hook
Copilot CLIshiftlog init --agent=copilot.github/hooks/shiftlog.json hook
Gemini CLIshiftlog init --agent=gemini.gemini/settings.json hooks
OpenCodeshiftlog init --agent=opencode.opencode/plugins/shiftlog.js plugin

Usage

See what conversations you have:

shiftlog list

Search through past conversations:

shiftlog search "authentication"          # Text search
shiftlog search --agent claude --branch main  # Filter by metadata
shiftlog search "jwt" --regex --context 2     # Regex with context lines

Get a quick summary of a conversation:

shiftlog summarise        # Summarise HEAD conversation
shiftlog tldr HEAD~1      # Alias, works the same way
shiftlog tldr --focus="security"  # Prioritise security-related changes

Resume a past session:

shiftlog resume abc123    # By commit SHA
shiftlog resume HEAD~3    # By git ref

View in your browser:

shiftlog serve

Pull down conversations from a repo you cloned:

shiftlog sync pull

shiftlog vs Entire

Entireshiftlog
Funding$60M seed roundClaude Code Max plan ($200/mo)
Staffing12 engineersAn imbecile spec-driving while not really paying attention
AgentsClaude Code, Gemini CLIClaude Code, Codex CLI, Copilot CLI, Gemini CLI, OpenCode
StorageCustom checkpoints formatStandard Git Notes
Resume sessionsNoYes
Web viewerNoYes
Rebase supportNoYes
Open sourceYesYes

Why?

In order to understand how and why a commit was made, we need to see the conversation that led to it.

How It Works

Shiftlog uses Git Notes to attach conversations to commits, stored under refs/notes/shiftlog to keep git log clean. When you run shiftlog init, it sets up hooks so:

  1. When the coding agent makes a commit, the conversation is saved automatically
  2. When you make a commit during an agent session, it's saved too
  3. When you push/pull, conversations sync with the remote

No extra steps needed during your normal workflow.

To view notes directly with git: git log --notes=shiftlog

Commands

CommandDescription
shiftlog initInitialize shiftlog in the current repo
shiftlog listList commits with stored conversations
shiftlog search [query]Search through stored conversations
shiftlog show [ref]Show conversation history for a commit
shiftlog summarise [ref]Summarise a conversation using your coding agent
shiftlog resume <commit>Resume a coding agent session from a commit
shiftlog serveStart the web visualization server
shiftlog doctorDiagnose shiftlog configuration issues
shiftlog debugToggle debug logging
shiftlog sync push/pullSync conversation notes with remote
shiftlog remapRemap orphaned notes to rebased commits

Requirements

  • Git
  • One of the supported coding agents (Claude Code, Codex CLI, Copilot CLI, Gemini CLI, or OpenCode)

Multi-Developer Sync

When multiple developers use shiftlog on the same repository, each person's conversation notes are synced automatically via git push/pull hooks. Notes from different developers are merged seamlessly because they typically annotate different commits.

If the remote notes ref has diverged (e.g. two developers pushed notes without pulling first), shiftlog sync push will reject the push and advise you to pull first:

shiftlog sync pull   # Fetches and merges remote notes
shiftlog sync push   # Now succeeds

In the rare case where two developers annotate the exact same commit SHA, both notes are preserved by concatenation — no data is lost.

Git Worktrees

Shiftlog is worktree-safe. If you use git worktree to work on multiple branches simultaneously, each worktree sees only the conversations for commits on its own branch. Hooks are shared across worktrees (as git requires), but shiftlog list and shiftlog show are scoped to the current HEAD.

Local Rebase

Conversation notes automatically follow commits when you rebase. During shiftlog init, the notes.rewriteRef git config is set to refs/notes/shiftlog, which tells git to remap notes to the new commit SHAs during rebase. No manual steps are needed.

If you initialized before this config was added, run shiftlog init again or set it manually:

git config notes.rewriteRef refs/notes/shiftlog

You can verify the config is set with shiftlog doctor.

GitHub Rebase Merge

When a PR is merged via GitHub's "Rebase and merge" strategy, the commits get new SHAs on the target branch. Since this happens server-side, git's notes.rewriteRef does not apply and notes remain keyed to the original (now-orphaned) commit SHAs.

Shiftlog handles this automatically. After you pull a rebase-merged PR, the post-merge hook runs shiftlog remap, which:

  1. Finds notes on commits that are no longer on any branch (orphaned)
  2. Uses git patch-id to match each orphaned commit to its rebased counterpart by diff content
  3. Copies the note to the new commit SHA (the original note is also kept)

For this to work, the local feature branch must be deleted or pruned so the old commits become orphaned. If your GitHub repo is configured to auto-delete branches after merge, this happens naturally when you git pull with fetch.prune=true (or git fetch --prune). Otherwise, delete the branch manually first:

git branch -D feature-branch
shiftlog remap

You can also run shiftlog remap at any time — it reports how many notes were remapped and how many remain unmatched. Unmatched notes are left in place, not deleted.

Note: Remap works with GitHub's "Rebase and merge" strategy. It does not support "Squash and merge", which combines all commits into one new commit with no 1:1 mapping to copy notes from.

License

AI Native Application License (AINAL) — see LICENSE.

Files in the repo

Repository payload25 top-level entries
  • .beads
  • .claude
  • .devcontainer
  • .github
  • cmd
  • docs
  • internal
  • openspec
  • scripts
  • tests
  • .actrc
  • .gitattributes
  • .gitignore
  • .golangci.yml
  • .goreleaser.yml
  • AGENTS.md
  • CLAUDE.md
  • go.mod
  • go.sum
  • LICENSE
  • main.go
  • Makefile
  • PLAN.md
  • README.md
  • todo.txt

Discussion (0)

Ask about usage, or say what you built with it

Sign in to join the discussion.

No comments yet. Be the first to say what this is good for.

More tools

JuliusBrussee/
caveman

🪨 why use many token when few token do trick — Claude Code skill that cuts 65% of tokens by talking like caveman

105k
1 add
MemPalace/
mempalace

The best-benchmarked open-source AI memory system. And it's free.

59k
stablyai/
orca

Orca is the ADE for working with a fleet of parallel agents. Run any coding agent with your own subscription. Available on desktop, mobile and remote runtime.

66k

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

132k

Never stop coding. Free MIT AI gateway: one endpoint, 352 providers (150+ free), 1200+ models Kimi, Claude, GPT, Gemini, GLM, DeepSeek, MiniMax. Works with Claude Code, Codex, Cursor, OpenCode, Cline & Copilot. Quota-aware auto-fallback, RTK+Caveman compression saves 15-95% tokens, MCP/A2A, Desktop/PWA. Built by 550+ contributors

64k
headroomlabs-ai/
headroom

Compress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.

71k