<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: nimblegate</title>
    <description>The latest articles on DEV Community by nimblegate (@nimblegate).</description>
    <link>https://dev.to/nimblegate</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3962936%2F984be0fb-1057-4f9a-a018-0f9ab17f5411.png</url>
      <title>DEV Community: nimblegate</title>
      <link>https://dev.to/nimblegate</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/nimblegate"/>
    <language>en</language>
    <item>
      <title>Git worktrees for parallel AI coding agents: what they fix and what they don't</title>
      <dc:creator>nimblegate</dc:creator>
      <pubDate>Tue, 24 Nov 2026 14:46:54 +0000</pubDate>
      <link>https://dev.to/nimblegate/git-worktrees-for-parallel-ai-coding-agents-what-they-fix-and-what-they-dont-4921</link>
      <guid>https://dev.to/nimblegate/git-worktrees-for-parallel-ai-coding-agents-what-they-fix-and-what-they-dont-4921</guid>
      <description>&lt;p&gt;ou want three agents working at once: one on the checkout page, one on a bug, one writing tests. If they share one working copy, they overwrite each other's files mid-task and nobody can tell whose change broke what.&lt;/p&gt;

&lt;p&gt;The standard answer is git worktrees: one checkout per agent, all backed by the same repository. This guide sets that up, covers the traps people hit in the first hour, and then the part worktrees don't solve: the agents still meet at merge time.&lt;/p&gt;

&lt;h2&gt;
  
  
  One worktree per agent
&lt;/h2&gt;

&lt;p&gt;A worktree is a second (third, fourth) checkout of the same repo in its own directory, on its own branch. Commits made in any of them land in the same &lt;code&gt;.git&lt;/code&gt;, so there is nothing to clone or sync.&lt;/p&gt;

&lt;p&gt;From your main checkout:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git worktree add -b agent/claude/checkout ../app-checkout main
git worktree add -b agent/codex/fix-1234  ../app-fix-1234  main
git worktree add -b agent/cursor/tests    ../app-tests     main
git worktree list
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Start each agent in its own directory (&lt;code&gt;cd ../app-checkout&lt;/code&gt; first), and tell it which branch it owns. Branch names that say which agent and which task, like &lt;code&gt;agent/claude/checkout&lt;/code&gt;, cost nothing and make every later question easier: who changed this, whose branch conflicts with whose.&lt;/p&gt;

&lt;p&gt;When a task is merged:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git worktree remove ../app-checkout
git branch -d agent/claude/checkout
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If a worktree directory was deleted by hand, &lt;code&gt;git worktree prune&lt;/code&gt; clears the stale entry.&lt;/p&gt;

&lt;p&gt;Some agent tools now create worktrees for you. The traps below apply either way.&lt;/p&gt;

&lt;h2&gt;
  
  
  The traps in the first hour
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;One branch, one worktree.&lt;/strong&gt; Git refuses to check out a branch that is already checked out in another worktree. Agents never work on &lt;code&gt;main&lt;/code&gt; itself; each gets a fresh branch.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Dependencies are per worktree.&lt;/strong&gt; &lt;code&gt;node_modules&lt;/code&gt;, a Python virtualenv or a build directory are not shared, so each worktree needs its own install. Budget the disk space, and put the install step in the agent's instructions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Untracked files don't come along.&lt;/strong&gt; Your &lt;code&gt;.env&lt;/code&gt; is untracked, so a new worktree doesn't have it. The agent will notice the missing variables and either stop or invent a fix. Copy what it needs on purpose, and check that &lt;code&gt;.gitignore&lt;/code&gt; still covers it there. An agent that recreates &lt;code&gt;.env&lt;/code&gt; from memory with a real key in it is how keys end up in commits.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Ports and databases clash.&lt;/strong&gt; Three agents running &lt;code&gt;npm run dev&lt;/code&gt; all want port 3000, and three test suites against one local database delete each other's rows. Give each worktree its own port (&lt;code&gt;PORT=3001&lt;/code&gt; in its environment) and, if the tests write to a database, its own database name.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Hooks and config are shared.&lt;/strong&gt; Git hooks live in the common &lt;code&gt;.git&lt;/code&gt; directory, so every worktree runs the same &lt;code&gt;pre-commit&lt;/code&gt; hook, and a change to &lt;code&gt;.git/config&lt;/code&gt; in one worktree changes it for all of them. That is usually what you want. It also means an agent that edits or skips a hook in its worktree has done it for everyone.&lt;/p&gt;

&lt;h2&gt;
  
  
  What worktrees don't prevent
&lt;/h2&gt;

&lt;p&gt;Worktrees isolate the working copies. They don't isolate the files the branches will be merged into. Agents on related tasks drift to the same places: the changelog every task adds a line to, the route table every feature registers in, the shared config. Each branch is fine on its own; the conflict appears when the second one is merged, after both agents are done.&lt;/p&gt;

&lt;p&gt;In a &lt;a href="https://nimblegate.com/blog/parallel-ai-coding-agents" rel="noopener noreferrer"&gt;small simulation on a copy of the nimblegate repo&lt;/a&gt;, one append-only &lt;code&gt;CHANGELOG.md&lt;/code&gt; blocked three of four agents' merges by itself. A few habits remove most of it:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Let append-only files merge themselves.&lt;/strong&gt; &lt;code&gt;CHANGELOG.md merge=union&lt;/code&gt; in &lt;code&gt;.gitattributes&lt;/code&gt; keeps both sides instead of conflicting. Only for files where line order doesn't matter.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Split work by files, not only by task.&lt;/strong&gt; If two tasks will touch the same module, run them one after the other. The cheapest conflict is the one that never starts.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Merge small and often.&lt;/strong&gt; Rebase each branch on &lt;code&gt;main&lt;/code&gt; after every merge, so the next conflict is a small one.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Test the merged result, not just each branch.&lt;/strong&gt; Two branches can each pass their tests and break together. Run the suite on the combined result before the second merge, not after.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  See the overlap while the agents still work
&lt;/h2&gt;

&lt;p&gt;All of that happens at merge time. It is earlier and cheaper to know that two agents are editing the same file while they are still working.&lt;/p&gt;

&lt;p&gt;Have each agent push its branch after every working step, not only at the end:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Commit and push your branch after each working step, not only at the end.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then something that sees every branch can compare them. That is what the Overlaps page in &lt;a href="https://github.com/nimblegate/nimblegate" rel="noopener noreferrer"&gt;nimblegate&lt;/a&gt; does: the agents push to a self-hosted gateway instead of straight to GitHub, and it lists pairs of open branches that change the same files, now and on each push, with an optional webhook so whatever runs your agents hears about it. The &lt;a href="https://nimblegate.com/blog/overlap-alerts-parallel-ai-agents" rel="noopener noreferrer"&gt;overlap alerts guide&lt;/a&gt; has the setup, and the &lt;a href="https://demo.nimblegate.com/overlaps/" rel="noopener noreferrer"&gt;live demo&lt;/a&gt; shows the page. Because every push goes through the same gateway, the same pass also checks what the agents push: keys, force-pushes, skipped tests. Unlike the shared hook, an agent can't edit that check from its worktree.&lt;/p&gt;

&lt;h2&gt;
  
  
  Checklist
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;One worktree and one fresh branch per agent: &lt;code&gt;git worktree add -b agent/&amp;lt;tool&amp;gt;/&amp;lt;task&amp;gt; ../app-&amp;lt;task&amp;gt; main&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Install dependencies in each worktree; copy only the untracked files it needs.&lt;/li&gt;
&lt;li&gt;A port and a database name per worktree.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;merge=union&lt;/code&gt; for append-only files; split tasks by files.&lt;/li&gt;
&lt;li&gt;Agents push after every step; watch for branches that touch the same files.&lt;/li&gt;
&lt;li&gt;Merge one branch at a time, rebase the rest, test the combined result.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;git worktree remove&lt;/code&gt; and delete the branch when it's merged.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://nimblegate.com/blog/git-worktrees-parallel-ai-agents" rel="noopener noreferrer"&gt;nimblegate.com&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>git</category>
      <category>ai</category>
      <category>productivity</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>How to stop AI coding agents from pushing API keys to GitHub</title>
      <dc:creator>nimblegate</dc:creator>
      <pubDate>Tue, 17 Nov 2026 08:27:09 +0000</pubDate>
      <link>https://dev.to/nimblegate/how-to-stop-ai-coding-agents-from-pushing-api-keys-to-github-i17</link>
      <guid>https://dev.to/nimblegate/how-to-stop-ai-coding-agents-from-pushing-api-keys-to-github-i17</guid>
      <description>&lt;p&gt;An AI coding agent needs a key to test something, finds one in your environment (an OpenAI, Claude or GitHub token), writes it into a config file to make the test pass, commits, and pushes. It did exactly what you asked. The key is now in your git history.&lt;/p&gt;

&lt;p&gt;Once a secret reaches a remote, deleting it is not enough: forks, clones, mirrors and caches may already have it. The only real fix is rotating the key, and the only cheap fix is never letting it leave your machine.&lt;/p&gt;

&lt;p&gt;This guide sets that up so it holds even when the agent is the one pushing.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why the usual safeguards don't hold
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;.gitignore&lt;/code&gt;&lt;/strong&gt; keeps &lt;code&gt;.env&lt;/code&gt; out of git, but the agent didn't put the key in &lt;code&gt;.env&lt;/code&gt;. It put it in &lt;code&gt;config.go&lt;/code&gt;, a test fixture, or a README example.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A pre-commit hook&lt;/strong&gt; scans for keys, but it runs on the same machine as the agent, as the same user. One &lt;code&gt;git commit --no-verify&lt;/code&gt; and it's skipped. Hooks also aren't versioned by git, so a fresh clone or a new worktree has none.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GitHub push protection&lt;/strong&gt; does block many key types before they land, and on public repositories it's on by default. But anyone with write access can bypass it by picking a reason like "used in tests", on private repositories it's part of the paid GitHub Secret Protection add-on, and it only exists on GitHub - not on Gitea, a self-hosted GitLab or anything else.&lt;/p&gt;

&lt;p&gt;The common problem: every one of these either sits where the agent can switch it off, can be waved through, or doesn't cover the repo you care about.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Already covered?&lt;/strong&gt; If your repo is public on GitHub and nobody would bypass a warning, push protection already does much of this. The rest of this guide is for private repos without the add-on, other git hosts, and anyone who wants a check with no bypass option.&lt;/p&gt;

&lt;h2&gt;
  
  
  A newer leak: the agent's own settings file
&lt;/h2&gt;

&lt;p&gt;Agents keep their own config inside the repo, and that config can hold secrets too. When you approve a command in Claude Code with "Yes, and don't ask again", it saves that exact command to &lt;code&gt;.claude/settings.local.json&lt;/code&gt; so it can match it next time. If the command had a password or token in it, the secret is now in that file. Claude Code sets git to ignore the file when it creates it, but that doesn't help once the file is already tracked. &lt;a href="https://apiiro.com/blog/coding-agents-leaking-secrets-github-dont-ask-again" rel="noopener noreferrer"&gt;Apiiro scanned 104,185 public copies&lt;/a&gt; of the file on GitHub and found 1,122 with at least one real secret. Two widely used secret scanners, Gitleaks and TruffleHog, each missed hundreds of those files, and 215 slipped past both. Most of the misses were passwords typed into commands (&lt;code&gt;PGPASSWORD=&lt;/code&gt;, &lt;code&gt;sshpass -p&lt;/code&gt;, &lt;code&gt;mysql -p&lt;/code&gt;), which carry no prefix for a scanner to recognise.&lt;/p&gt;

&lt;p&gt;Check yours:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git ls-files .claude/settings.local.json   &lt;span class="c"&gt;# prints the path if git tracks it&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If it prints the path, untrack it and keep it ignored:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git rm --cached .claude/settings.local.json
&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s1"&gt;'.claude/settings.local.json'&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; .gitignore
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Any secret in it that was ever pushed is leaked: rotate it (see "Already leaked?" below). To keep new ones out, pass secrets through environment variables rather than typing them into commands you approve.&lt;/p&gt;

&lt;h2&gt;
  
  
  The fix: a check the agent can't route around
&lt;/h2&gt;

&lt;p&gt;Put the check on a separate machine between the agent and GitHub, and take away the agent's direct route to GitHub.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  YOUR COMPUTER            THE GATEWAY                 GITHUB
  (you + the agent)        (checks every push)         (your real repo)

  git push ──────────────► checks against rules ────► forwarded if clean
                           rejected if not
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two rules make this a real boundary:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Your computer only pushes to the gateway.&lt;/strong&gt; Your &lt;code&gt;origin&lt;/code&gt; points at the gateway, not at GitHub.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Only the gateway can write to GitHub.&lt;/strong&gt; It holds the GitHub token. Your computer, and so the agent, doesn't have one.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now &lt;code&gt;--no-verify&lt;/code&gt; changes nothing: the check runs on the gateway, on the server side of the push, where the agent can't reach it.&lt;/p&gt;

&lt;p&gt;This is what &lt;a href="https://github.com/nimblegate/nimblegate" rel="noopener noreferrer"&gt;nimblegate&lt;/a&gt; does. It's self-hosted, runs as one Docker container, and nothing in it phones home. The steps below use it; the ten-minute version is the &lt;a href="https://nimblegate.com/docs/quick-start" rel="noopener noreferrer"&gt;quick start&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Prefer to watch? The whole setup, start to finish, in 6 minutes:&lt;/p&gt;

&lt;p&gt;  &lt;iframe src="https://www.youtube.com/embed/MWgIxambCX0" width="710" height="399"&gt;
  &lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: Run the gateway
&lt;/h2&gt;

&lt;p&gt;On any small server, VM or home-lab box with Docker (not your laptop):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl -O https://raw.githubusercontent.com/nimblegate/nimblegate/main/compose.yaml
docker compose up -d
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The admin dashboard is on port 7900 (bound to localhost) and git pushes go to port 2222. Claim your admin login with the setup token from the logs, add your SSH public key, and register the repo with its GitHub URL and a GitHub token. The token is stored on the gateway only.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: Point your repo at the gateway
&lt;/h2&gt;

&lt;p&gt;On your computer, add a shortcut to &lt;code&gt;~/.ssh/config&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ssh"&gt;&lt;code&gt;&lt;span class="nc"&gt;Host&lt;/span&gt; &lt;span class="n"&gt;nimblegate&lt;/span&gt;
  &lt;span class="nc"&gt;Hostname&lt;/span&gt;  &lt;span class="mf"&gt;192.0&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mf"&gt;2.10&lt;/span&gt;        &lt;span class="c1"&gt;# your gateway's address&lt;/span&gt;
  &lt;span class="nc"&gt;Port&lt;/span&gt;      &lt;span class="mi"&gt;2222&lt;/span&gt;
  &lt;span class="nc"&gt;User&lt;/span&gt;      &lt;span class="n"&gt;git&lt;/span&gt;
  &lt;span class="nc"&gt;IdentityFile&lt;/span&gt;   &lt;span class="o"&gt;~/&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ssh&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;nimblegate&lt;/span&gt;
  &lt;span class="nc"&gt;IdentitiesOnly&lt;/span&gt; &lt;span class="n"&gt;yes&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then switch the repo's remote:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git remote set-url origin nimblegate:myapp.git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;From here on, &lt;code&gt;git push&lt;/code&gt; goes to the gateway, and clean pushes are forwarded to GitHub byte for byte: same commits, same SHAs, same signatures.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: Close the side door
&lt;/h2&gt;

&lt;p&gt;The gateway only protects you if the agent can't push to GitHub directly. On the machine where the agent runs:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# remove stored HTTPS credentials for GitHub&lt;/span&gt;
rm -f ~/.git-credentials
git config --global --unset credential.helper

&lt;span class="c"&gt;# check this machine's SSH key isn't accepted by GitHub directly&lt;/span&gt;
ssh -o &lt;span class="nv"&gt;BatchMode&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;yes -T git@github.com 2&lt;span class="o"&gt;&amp;gt;&amp;amp;&lt;/span&gt;1 &lt;span class="o"&gt;|&lt;/span&gt; grep -q &lt;span class="s2"&gt;"Permission denied"&lt;/span&gt; \
  &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"OK: github refused"&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"BYPASS: this key works on github directly"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you see &lt;code&gt;BYPASS&lt;/code&gt;, remove that key from your GitHub account (or use a different key for the gateway). Also check for a logged-in &lt;code&gt;gh&lt;/code&gt; CLI (&lt;code&gt;gh auth status&lt;/code&gt;) - it's another way around the gate.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: Test it with a fake key
&lt;/h2&gt;

&lt;p&gt;Generate a random fake AWS key (it matches the real format but was never issued), commit it and push:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"AWS_KEY=AKIA$(LC_ALL=C tr -dc 'A-Z0-9' &amp;lt; /dev/urandom | head -c 16)"&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; leak-test.env
git add leak-test.env &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; git commit -m &lt;span class="s2"&gt;"test: leak a fake key"&lt;/span&gt;
git push
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The push is refused before anything reaches GitHub:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;remote: error: push rejected by repository policy:
remote:   refs/heads/main: BLOCK [security/no-hardcoded-credentials] credentials detected (raw bytes redacted): leak-test.env:1 - AWS access key
 ! [remote rejected] main -&amp;gt; main (pre-receive hook declined)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The key itself is redacted from the message. Undo the test commit with &lt;code&gt;git reset --hard HEAD~1&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The same message is what an agent sees when it pushes a key. It names the file and line, so the agent can remove the key and push again, and the clean push goes through.&lt;/p&gt;

&lt;p&gt;(Don't test with AWS's documented example key, &lt;code&gt;AKIAIOSFODNN7EXAMPLE&lt;/code&gt;. It's exempt on purpose, because it appears in documentation everywhere.)&lt;/p&gt;

&lt;h2&gt;
  
  
  Already leaked? Rotate first, then clean the history
&lt;/h2&gt;

&lt;p&gt;If a key has already reached GitHub, the order matters:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Revoke or rotate the key at the provider, now.&lt;/strong&gt; Deleting it from git does not un-leak it: automated scanners watch public GitHub and find new keys within minutes. Assume it was copied.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Then remove it from the history,&lt;/strong&gt; if the repo should be clean. With &lt;a href="https://github.com/newren/git-filter-repo" rel="noopener noreferrer"&gt;git filter-repo&lt;/a&gt;, either drop the file from every commit:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   git filter-repo --invert-paths --path config/secrets.env
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;or replace the key text wherever it appears (a file with one &lt;code&gt;old-text==&amp;gt;***REMOVED***&lt;/code&gt; line per secret):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   git filter-repo --replace-text replacements.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This rewrites history, so it needs a force-push and everyone re-clones.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Forks and cached views may keep the old commits.&lt;/strong&gt; GitHub's guide "Removing sensitive data from a repository" covers asking them to purge those.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If your repo sits behind a gate that blocks force-pushes to the main branch, as it should, the rewrite is a deliberate operator action rather than something an agent can do. That is the point.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it catches, and what it doesn't
&lt;/h2&gt;

&lt;p&gt;Blocked out of the box: keys with a recognisable issuer prefix. That covers AWS, GitHub tokens (&lt;code&gt;ghp_&lt;/code&gt;, &lt;code&gt;github_pat_&lt;/code&gt; and the rest), Stripe secret keys, Anthropic, OpenAI, Hugging Face, Groq, xAI, Slack and Google API keys, and private key files. These patterns almost never match anything innocent, so they don't slow you down with false alarms. The full list is on the &lt;a href="https://nimblegate.com/docs/frames/no-hardcoded-credentials" rel="noopener noreferrer"&gt;hardcoded credentials check&lt;/a&gt; page.&lt;/p&gt;

&lt;p&gt;Also blocked: passwords where the surrounding text gives them away. That means a password in a connection string (&lt;code&gt;postgres://app:...@db&lt;/code&gt;), one passed to a command (&lt;code&gt;mysql -p...&lt;/code&gt;, &lt;code&gt;sshpass -p&lt;/code&gt;, &lt;code&gt;curl -u user:...&lt;/code&gt;), or one in a credential file such as &lt;code&gt;.pgpass&lt;/code&gt;, &lt;code&gt;.netrc&lt;/code&gt; or &lt;code&gt;.npmrc&lt;/code&gt;. That covers the settings-file leak above too. See the &lt;a href="https://nimblegate.com/docs/frames/no-plaintext-passwords" rel="noopener noreferrer"&gt;plaintext passwords check&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Not blocked: a random-looking string with no prefix and nothing around it that marks it as a secret. Detecting those means guessing from randomness, which flags hashes and IDs all day, so the Security strict kit only warns about them (&lt;a href="https://nimblegate.com/docs/frames/possible-secret" rel="noopener noreferrer"&gt;possible secret&lt;/a&gt;). Keep secrets in environment variables or a secret manager, and don't hand the agent more than it needs.&lt;/p&gt;

&lt;h2&gt;
  
  
  Not ready to block yet?
&lt;/h2&gt;

&lt;p&gt;Turn on &lt;strong&gt;observe mode&lt;/strong&gt; for the repo. Every push is checked and recorded on the dashboard, but nothing is rejected. Run it for a week, see what it would have caught, then switch to enforce. Before you switch, the repo's Policy page shows what the next push would block under the current rules, so the first enforced push holds no surprises.&lt;/p&gt;




&lt;p&gt;nimblegate is free for non-commercial use; commercial use needs a &lt;a href="https://github.com/nimblegate/nimblegate/blob/main/COMMERCIAL.md" rel="noopener noreferrer"&gt;license&lt;/a&gt;. Questions: &lt;a href="mailto:contact@nimblegate.com"&gt;contact@nimblegate.com&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://nimblegate.com/blog/stop-ai-agents-pushing-secrets" rel="noopener noreferrer"&gt;nimblegate.com&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>security</category>
      <category>ai</category>
      <category>git</category>
      <category>github</category>
    </item>
    <item>
      <title>Running AI coding agents in parallel on one repo</title>
      <dc:creator>nimblegate</dc:creator>
      <pubDate>Tue, 10 Nov 2026 19:36:17 +0000</pubDate>
      <link>https://dev.to/nimblegate/running-ai-coding-agents-in-parallel-on-one-repo-2k09</link>
      <guid>https://dev.to/nimblegate/running-ai-coding-agents-in-parallel-on-one-repo-2k09</guid>
      <description>&lt;p&gt;Running one coding agent is useful. Running three or four at once, each on its own branch, is where it gets genuinely fast: one agent on checkout, one on the coupon logic, one on tests, and a fourth fixing whatever the gate rejected.&lt;/p&gt;

&lt;p&gt;It works well right up to merge time. Then two branches that each passed on their own turn out to have changed the same file, and you spend the next twenty minutes untangling work you never saw overlap.&lt;/p&gt;

&lt;p&gt;I wanted to know how often that really happens, what actually helps, and whether the collision can be seen while the agents are still working instead of after. Here is what I found.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why parallel agents collide
&lt;/h2&gt;

&lt;p&gt;Giving each agent its own branch or git worktree isolates its &lt;em&gt;working copy&lt;/em&gt;. It does not isolate the files the branches will eventually be merged into. Agents working on related tasks gravitate to the same places:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Append-only files&lt;/strong&gt; such as &lt;code&gt;CHANGELOG.md&lt;/code&gt;, where every agent adds a line in the same spot.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Registries and route tables&lt;/strong&gt; where every new feature registers itself.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Shared config and fixtures&lt;/strong&gt; that every change touches a little.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In my own repo's history, &lt;code&gt;CHANGELOG.md&lt;/code&gt; was touched in about one commit in five. With several agents running at once, that file alone guarantees a conflict on almost every merge.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I measured
&lt;/h2&gt;

&lt;p&gt;To get numbers instead of guesses, I ran a small simulation on a throwaway copy of the nimblegate repo: 4, 8 and then 16 synthetic agents, each branching from the same point and making a realistic change, with three problems planted on purpose - two agents appending to the same file, a pair that breaks only when combined, and a pair whose tests pass alone but fail together. Every branch passed its own tests. It is a small synthetic test, not a benchmark, but the shape was clear:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;One file caused most of the conflicts.&lt;/strong&gt; With git's default merge, the shared &lt;code&gt;CHANGELOG.md&lt;/code&gt; alone blocked 3 of 4 agents. Switching that one file to git's union merge driver left only the single genuine conflict.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Most "conflicts" in code were not real.&lt;/strong&gt; Two agents adding different functions at the end of the same file is a textual conflict for git, but a syntax-aware merge driver merged it cleanly - while still refusing the one case where both changed the same line.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Testing the combined result matters.&lt;/strong&gt; The pairs that broke only together were invisible when each branch was tested alone, and caught every time the merged result was tested.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Batching scales, one-at-a-time does not.&lt;/strong&gt; Landing 16 branches one after another took 655 seconds on this repo; testing them in batches took 170.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Fixes that work today
&lt;/h2&gt;

&lt;p&gt;None of these need special tooling.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Let append-only files merge themselves.&lt;/strong&gt; A two-line &lt;code&gt;.gitattributes&lt;/code&gt; entry tells git to keep both sides instead of conflicting:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;CHANGELOG.md merge=union
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use it only for files where the order of added lines does not matter. See &lt;a href="https://git-scm.com/docs/gitattributes#_built_in_merge_drivers" rel="noopener noreferrer"&gt;git's merge attributes&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Try a syntax-aware merge driver.&lt;/strong&gt; &lt;a href="https://mergiraf.org" rel="noopener noreferrer"&gt;Mergiraf&lt;/a&gt; merges at the level of functions and statements, which clears the "two agents appended different things in the same place" conflicts that are most of the noise.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Split the work by files, not just by task.&lt;/strong&gt; The cheapest conflict is the one that never happens. If you know two tasks will touch the same module, run them one after the other.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Name branches so you can tell agents apart&lt;/strong&gt;, for example &lt;code&gt;agent/claude/checkout-tax&lt;/code&gt; and &lt;code&gt;agent/cursor/checkout-coupons&lt;/code&gt;. It costs nothing and makes every later question - who changed what, whose branch collided - easy to answer.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Have agents push checkpoints&lt;/strong&gt;, not only finished work. Anything that watches for overlap can only see what has been pushed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Seeing the overlap while the agents work
&lt;/h2&gt;

&lt;p&gt;The fixes above reduce conflicts. What I still wanted was to &lt;em&gt;know&lt;/em&gt; about an overlap the moment it appears, not at merge time.&lt;/p&gt;

&lt;p&gt;That is a natural fit for &lt;a href="https://nimblegate.com/how-it-works" rel="noopener noreferrer"&gt;nimblegate&lt;/a&gt;, the gate my agents already push through. It holds every pushed branch, so on each accepted push it compares the files that branch changed since the default branch with the other open branches. When two share a file:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the push gets an &lt;strong&gt;overlap&lt;/strong&gt; pill in the dashboard feed,&lt;/li&gt;
&lt;li&gt;an &lt;strong&gt;Overlaps&lt;/strong&gt; page lists what overlaps right now and what was recorded, with both commits,&lt;/li&gt;
&lt;li&gt;and, if you turn it on, a &lt;code&gt;push.overlap&lt;/code&gt; &lt;strong&gt;webhook&lt;/strong&gt; tells whatever runs your agents immediately, so it can pause one, reorder the work, or let both carry on knowingly.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It is advisory by design. Two agents touching one file can be deliberate, so nothing is blocked, and the agent that pushed is told nothing - the signal goes to you and your orchestrator. You can click through it on the &lt;a href="https://demo.nimblegate.com/overlaps/" rel="noopener noreferrer"&gt;live demo&lt;/a&gt;, where two agents are working on the same checkout file.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I have not built (yet)
&lt;/h2&gt;

&lt;p&gt;The simulation made a proper merge queue tempting: land branches in batches, test the combined result, and keep a losing edit instead of discarding it. I have deliberately not built it. Detecting the overlap covers most of the pain for a fraction of the complexity, and I would rather see real overlap data from real agent swarms before deciding what the next step should be.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;p&gt;If you run agents in parallel, start with the &lt;code&gt;.gitattributes&lt;/code&gt; line - it is free and it removes the most common conflict outright. If you want to see overlaps as they happen, the &lt;a href="https://demo.nimblegate.com" rel="noopener noreferrer"&gt;demo&lt;/a&gt; shows the whole dashboard over sample data, the &lt;a href="https://nimblegate.com/docs/quick-start" rel="noopener noreferrer"&gt;quick start&lt;/a&gt; installs it in about ten minutes, and the source is at &lt;a href="https://github.com/nimblegate/nimblegate" rel="noopener noreferrer"&gt;github.com/nimblegate/nimblegate&lt;/a&gt;. The earlier post, &lt;a href="https://nimblegate.com/blog/agent-loops" rel="noopener noreferrer"&gt;I loop AI agents on my repos&lt;/a&gt;, covers why the gate sits where it does.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://nimblegate.com/blog/parallel-ai-coding-agents" rel="noopener noreferrer"&gt;nimblegate.com&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>git</category>
      <category>productivity</category>
      <category>devops</category>
    </item>
  </channel>
</rss>
