Tools

Free & open source

git-sim

The visual layer for Git in your own repos: simulate, record, replay, audit and share Git command sequences - wherever you or your agents run them.

  1. Simulate any Git command before it runs, as an interactive graph you can step through.TerminalWebVS CodeJupyterVim / Neovim / EmacsGitHub PRs
  2. Track your repo live while recording every Git operation (human or agentic) as a visual command sequence you can replay.WebVS Code
  3. Catch and review potentially destructive Git commands from AI agents in real-time, before they harm your work.Claude CodeGitHub CopilotCursorCodexGemini CLI+ any MCP agent
  4. Share any git-sim output as a link, an embed, an image, a video, or a social post.Shareable linkHTML embedHTML pagePNGSVGMP4Social post
$ git-sim merge feature/pagination

(Or watch whole Git workflows play out step by step in the git-sim viewer)

git-sim
Initial CommitDevlands
Loading the demo…

Your turn

Try it on your own repo

Install git-sim to start building your confidence with Git, now!

Get more out of git-sim

Git and git-sim tips, straight to your inbox.

Thank you! Please check your email to complete verification.

Already where you work

git-sim meets you wherever you or your agents use Git

What is git-sim?

git-sim is a free and open-source tool that allows you to visually simulate Git operations in your own local repos.

By default, git-sim creates an interactive web animation simulating the Git command in question, but you can choose from various shareable output formats including html embed, png, svg, and mp4.

git-sim is designed to work wherever and however you use Git in your development workflows. It can be run manually, or automated. Use it from the terminal, VS Code, Vim, Jupyter, or wire it into your agentic flows.

It can monitor and pre-flight risky Git commands, and record sequences of Git operations in real-time.

The release post has the longer story of how git-sim got started.

Simulate: "what would this do?"

Run any Git command with git-sim in place of git, and see exactly what it would do to your repo before you run it for real.

Pick a sample Git command to simulate on the graph:

Live: "what just happened?"

Run git-sim live to record every Git operation executed by you or your AI agents in real-time as an interactive session you can replay and share.

Pick a sample Git workflow to play:

Pre-flight: "is this safe?"

Before a Git command runs, git-sim automatically checks to determine how risky it is, exactly what you could lose, and how to undo it. Hook it into your AI agents to ensure their Git commands don't unintentionally break your repo.

Pick a sample Git command to pre‑flight:

Loading the pre-flight reports…

Make git-sim agentic with MCP and pre-flight hooks

git-sim integrates with your AI agents to simulate and pre-flight Git commands, putting control back in your hands.

Your agenttries to run git reset --hard in your Git repo.
git-sim's pre-flight hookstops it and flags it Destructive, showing you what you could lose.
Youapprove or deny it, with the facts in front of you.
git-sim wire-agents

One command finds the AI agents on your machine and adds git-sim to each one's configuration: a pre-flight hook that checks every Git command before it runs, and an MCP server the agent can call to simulate or pre-flight a command itself.

How the pre-flight hook and MCP server work

Pre-flight hook and MCP server

Claude CodeCodex CLICursorGitHub Copilot CLIGemini CLIVS Code (Copilot)

MCP server

WindsurfClineRoo CodeAmazon Q Developer CLIClaude Desktop

git-sim in your editor

The git-sim VS Code extension brings the power of git-sim directly into your code editor. Vim, Neovim, and Emacs are also supported.

VS Code with git-sim's simulation of git reset --hard HEAD^ open in an editor tab: the commits, and the files the reset would discard
The Command PaletteEvery git-sim command: simulate, pre-flight, the live graph, and wiring git-sim into your AI agents.
VS Code's Command Palette filtered to git-sim's commands
Ctrl+Alt+GOpens a prompt with git-sim already typed. Finish the command as you would in a terminal.
git-sim's Simulate prompt in VS Code, with git-sim already typed
The status barClick git-sim in the status bar to open the same prompt.
VS Code's status bar with the git-sim button

The extension works in VS Code, and in Cursor, Windsurf and VSCodium through Open VSX. With Copilot in agent mode, git-sim's pre-flight hook runs right inside the editor too. Install it in your editor.

Embed git-sim graphs in your web page

Writing about Git? Add two lines of HTML to embed git-sim graphs into any web page or blog, just like we did below:

<div class="git-sim" data-src="/img/merge.svg" data-title="git merge feature/pagination"></div>
<script src="https://initialcommit.com/js/tools/git-sim-embed.js" defer></script>

Share your simulations

Every git-sim graph has a button. Use it to copy a link, image, video, HTML page - and post it to your favorite socials.

A git-sim link carries the graph compressed in its #fragment, which browsers never send to the server.

Install and run

Python 3.10 or newer and Git, on Windows, macOS or Linux.

1
Install
pip install git-sim

or pipx install git-sim, or uv tool install git-sim

2
In a local Git repo, prefix any Git command with git-sim instead of git, as follows:
git-sim merge dev
git-sim reset HEAD^
git-sim rebase main

By default, git-sim opens an interactive web graph showing you exactly how that Git command will impact your repo. Run git-sim -h to list all available commands.

3
Check a risky command before it runs, watch your repo live, and connect your AI agents:
git-sim preflight reset --hard HEAD~1   # how risky a command is, and what you could lose
git-sim live                            # a live graph that records your repo as it changes
git-sim wire-agents                     # add the pre-flight hook and MCP server to your AI agents
4
Install the git-sim VS Code extension
code --install-extension initialcommit.git-sim

Or search for git-sim in the Extensions view: in VS Code from the Marketplace, and in Cursor, Windsurf and VSCodium from Open VSX. The extension uses the git-sim installed in step 1. For Vim, Neovim and Emacs, the plugin is a single file you copy into your setup: see the Vim, Neovim and Emacs instructions.

Get more out of git-sim

Git and git-sim tips, straight to your inbox.

Thank you! Please check your email to complete verification.

Supported commands

Every Git command git-sim can simulate, with flags that follow Git's own, and git-sim's own commands.

AreaCommands
History and inspectionlog, reflog, status, show, diff (including --staged), blame
Working tree and indexadd, restore, rm, mv, clean, stash
Commitscommit (including --amend), revert, cherry-pick (ranges too)
Branches and tagsbranch, checkout, switch, tag, worktree
Mergingmerge, fast-forward or not, --no-ff and --squash, with conflict prediction
Rewriting historyrebase, rebase -i with a todo file, rebase --onto, reset in every mode
After a conflict--continue and --abort for a merge, rebase or cherry-pick in progress
Finding a bugbisect: start, good, bad, skip, reset
Remotesclone, fetch, pull (including --rebase), push, remote, submodule
Setupinit, config
git-sim's ownpreflight, live, wire-agents and unwire-agents (AI agents), aliases, media-dir

Flags follow Git's own. The README lists every option per command.

Learn Git with git-sim

Hands-on Git lessons you work through in your browser, one small step at a time. Made with git-sim of course :)

FAQ

How can I see what a Git command will do before running it?

Run the same command with git-sim in place of git, for example git-sim rebase main instead of git rebase main. git-sim reads your local repository, simulates the command without touching it, and opens an interactive before / after graph of the result.

Does git-sim change my repository?

No. git-sim only reads the repository. Nothing is committed, moved or deleted; simulations and live sessions are written to your user cache folder, never inside the repository.

How do I install git-sim?

With Python 3.10 or newer and Git, on Windows, macOS or Linux: pip install git-sim (or pipx install git-sim, or uv tool install git-sim). Then run git-sim in any repository. git sim works too, since Git runs any git-<name> program, and git-sim aliases adds git preflight and git live.

Which Git commands can git-sim simulate?

add, bisect, blame, branch, checkout, cherry-pick, clean, clone, commit, config, diff, fetch, init, log, merge, mv, pull, push, rebase (including -i and --onto), reflog, remote, reset, restore, revert, rm, show, stash, status, submodule, switch, tag and worktree, with their common flags, and --continue and --abort for a merge, rebase or cherry-pick that stopped on a conflict.

What is the difference between simulate, pre-flight and live?

Simulate (git-sim <command>) shows what one command would do, as an interactive before / after graph. Pre-flight (git-sim preflight <command>) gives the facts about a risky command: how risky it is, what you would lose, and how to undo it. Live (git-sim live) follows your repository and plays every change as it happens, recording the session so you can replay it.

How does pre-flight decide whether a command is safe?

It works from your repository itself, using Git's own data and dry-run plumbing such as clean -n and merge-tree, never a guess. It finds which commits would become unreachable, which uncommitted changes would be discarded and whether they could be recovered, whether published history would be rewritten, and how to undo the command. A command that only adds to the repository is safe; one that can lose work is caution or destructive.

Can I watch what an AI agent does to my repository?

Yes. git-sim live follows the repository whoever is changing it, so every commit, branch, reset or rebase an agent runs plays on the graph as it happens and stays in the session. The pre-flight hook stops the destructive ones first.

Which AI agents does git-sim work with?

git-sim wire-agents finds the agents on your machine and configures each one. Claude Code, Codex CLI, Cursor, GitHub Copilot CLI, Gemini CLI and VS Code (Copilot) get the pre-flight hook and the MCP server; Windsurf, Cline, Roo Code, Amazon Q Developer CLI and Claude Desktop get the MCP server, which lets the agent simulate or pre-flight a command itself. git-sim unwire-agents takes it all out again.

Can I use git-sim in my editor?

Yes. The VS Code extension runs in VS Code, and in Cursor, Windsurf and VSCodium through Open VSX. Vim, Neovim and Emacs have plugins with the same commands, and in Jupyter the %gitsim magic draws the graph under the cell.

Can I share or embed a simulation?

Yes. Every graph has a Share button: a link that opens it in the git-sim viewer, an image (PNG or SVG), the self-contained HTML page, or a post. --img-format png writes an image from the terminal and --animate renders an MP4. Two lines of HTML embed an interactive graph in any web page.

Is my code uploaded when git-sim opens the viewer at initialcommit.com?

No. The graph travels inside the link's #fragment, which browsers never send to a server, and the link git-sim opens carries nothing else about you or your repository. Live mode works the same way: this site serves the page and the graphs come from a server on your own machine. Pass --open-in local to open the saved page directly instead.

Is git-sim free?

Yes. git-sim is free and open source under the GPL-2.0 license, and its code is on GitHub.

git-sim is free and open source, made by Initial Commit. Also from us: Devlands, where you learn Git by transforming your Git repository into a 3D game world you can literally walk through.