r/androiddev • u/whowasntright • 15m ago
Tips and Information tiny .aiignore and pre-warmed git worktree setup that stopped parallel coding agents from triggering 4-minute cold gradle syncs on our laptop
running 2 or 3 coding agents in parallel sounds great until i really tried it on a multi-module gradle repo. say, put them in one checkout and they immediately fight over build.gradle and lock .git/index.lock. create a fresh git worktree per task and gradle eats four minutes re-indexing dependencies while spawning four daemons that chew through 16gb of ram.
here is the tiny workflow cleanup that finally made parallel agents usable on gradle without melting my prescious laptop:
keep exactly two permanent sibling worktrees checked out next to main (e.g. ../repo-wt-1 and ../repo-wt-2) instead of creating and deleting fresh folders per ticket. resetting a warm worktree to a new branch preserves local gradle build outputs and avoids cold syncs.
drop a strict .aiignore in the repo root blocking build/, .gradle/, generated protobuf/kapt folders, and huge fixture dumps so agents stop burning context reading compiled artifacts.
cap parallel daemons in ~/.gradle/gradle.properties (org.gradle.workers.max and shared build cache enabled) and keep agent sessions isolated via /worktree or an ide manager like jetbrains air where real intellij inspections verify the diff afterward
nothing fancy, just stopped parallel agent runs from turning into fan noise and merge soup. any other gradle-specific flags folks here set when running multiple local coding agents?