
follow for coding-agent receipts: what worked, what broke, what i'd redo. ai-powered engineering, not vibe coding. founder of beyond digital.
Ahmedabad, India
Joined March 2024
- Tweets1.7K
- Following689
- Followers334
- Likes1.7K
postgres 19 shipped on nov 19 with native fixes for three hacks a lot of us still run: pg_repack, "read from the primary after a write", and the fake `DO UPDATE` just to get an id back.
everyone's posted the feature list. this is the setup, plus the warnings buried at the bottom of the docs.
bloat: REPACK
• `REPACK (CONCURRENTLY) orders;` rewrites the table while reads and writes keep going. the ACCESS EXCLUSIVE lock is only taken for the final file swap
• it replaces VACUUM FULL and CLUSTER (both still work). `REPACK orders USING INDEX orders_created_idx;` is the new CLUSTER
• watch it with `SELECT * FROM pg_stat_progress_repack;`
• CONCURRENTLY needs a primary key (or index replica identity), a non-partitioned heap table, and free disk at least the size of the table plus its indexes
read-your-writes: WAIT FOR LSN
• on the primary, after the commit: `SELECT pg_current_wal_insert_lsn();`
• on the replica, before the read: `WAIT FOR LSN '0/0306EE20' WITH (TIMEOUT '200ms', NO_THROW);`
• NO_THROW returns success / timeout / not in recovery instead of erroring, so on timeout you just send that read to the primary
get-or-create: ON CONFLICT DO SELECT
• `INSERT INTO tags (name) VALUES ('pg19') ON CONFLICT (name) DO SELECT RETURNING id;`
• you get the existing row back without a no-op update writing a new row version. add `FOR UPDATE` if you need it locked
start here
on a pg19 staging box, pick your most bloated table and run `REPACK (CONCURRENTLY, VERBOSE) that_table;` while your test suite hammers it.
gotchas
• REPACK (CONCURRENTLY) is not MVCC-safe. a transaction whose snapshot predates the repack sees the table as empty once it commits, so drain long repeatable-read jobs first
• run WAIT outside a transaction or as its first statement. if your session already holds a snapshot or a lock, it gets rejected. and with no TIMEOUT it waits forever
which hack are you deleting first?
1
2
51
git shipped the fix for running coding agents in parallel back in 2015. it's called `git worktree`.
three agents, three folders, one repo, and nobody edits the file another agent is testing.
in one checkout, agents share a working tree. one runs tests while another is mid-edit, and you can't tell whose diff is whose.
setup
• `git worktree add -b agent/auth ../app-auth main` makes a new folder on a new branch, same repo
• one agent per folder, one terminal per agent
• worktrees share one object store, so it's not a full clone. each gets its own HEAD and index
the loop
• `git worktree list` shows every folder and its branch
• review each branch like a PR: `git diff main...agent/auth`
• git refuses to check out a branch that's already checked out in another worktree. that's your guardrail
when it breaks
• a new worktree only gets tracked files. no node_modules, no .env, so install and copy env per folder
• two dev servers on port 3000. give each agent its own port in the first prompt
• deleted a folder by hand? `git worktree prune` clears the stale entry
before you merge
• `git worktree remove ../app-auth` once the branch lands
• long agent run? `git worktree lock --reason "agent running" ../app-auth` so prune leaves it alone
start here: next time you open a second agent, run `git worktree add -b try/agent ../repo-try` and point it at that folder.
what i don't do
• two agents on one branch. the second one stacks its diff on the first one's half-done edit
• one local database shared across worktrees while agents run migrations. separate code, same data, same mess
how many agents do you run at once before review becomes the bottleneck?
3
1
92
1,000 commits since it last worked? git bisect finds the one that broke it in about 10 test runs.
it's binary search over your history. all it needs is a command that says pass or fail.
setup
• `git bisect start HEAD v1.4.0` (bad first, then the last known good)
• keep the check script outside the repo, like /tmp/check.sh, so old checkouts can't change or delete it
the loop
• `git bisect run /tmp/check.sh`
• exit 0 = good, 1–127 = bad, 125 = "can't test this one, skip it"
• old commits that don't build? `git bisect run sh -c "make || exit 125; /tmp/check.sh"`
when history is messy
• `git bisect start --first-parent` walks only the main branch, so you land on the merge (the PR), not a wip commit inside it
• chasing a slowdown, not a bug? `--term-old=fast --term-new=slow` so the labels make sense
• `git bisect log > bisect.txt` saves the session, `git bisect replay bisect.txt` picks it back up
where the coding agent helps
• ask it for the repro script, not the fix: "write a script that exits 1 if this bug happens, 0 if it doesn't". small task, easy to check
• let bisect do the search. the agent then reads one diff instead of guessing across 1,000
start here
next time something "used to work", run `git bisect start HEAD <last good tag>` and mark 5 commits by hand with `git bisect good` / `git bisect bad`. once it clicks, script it.
what i don't do
• bisect with a flaky test. one wrong answer sends the search down the wrong half
• forget `git bisect reset`. you stay on a detached HEAD until you run it
what's the worst regression you've had to hunt down?
1
44
same rule runs my browser agents: one brief, one job ("post these 4 replies, nothing else"). what went sideways today was two agents sharing a tab, not the narrow brief. how small do you slice tasks?
The strongest AI coding workflow may be the one that produces the smallest useful change.
There is a temptation to ask an agent to improve everything around a feature. It may rename unrelated functions, reorganise folders, update packages and rewrite components while solving the original request.
The result can be difficult to review.
I prefer a narrow task with a clear boundary. Fix the reported bug. Add the required behaviour. Update the relevant tests. Explain anything that had to change outside the expected area.
Small changes are easier to understand and easier to reverse. They also make it clearer whether the task was successful.
A coding agent should not be rewarded for the size of its diff. It should be rewarded for solving the problem with the least unnecessary disruption.
22



