Uploaded August 2026 | Updated September 2026, 2 weeks ago
Giving an AI agent database access has an obvious problem: experimenting means DDL. Creating indexes, dropping them, testing migrations — all destructive, all irreversible. So the usual answer is to not let the agent touch anything real, and you lose most of the value.
Forking fixes it. In this video, Claude Code spins up five copy-on-write forks of a 389,561-row. applies a different index strategy for each, races them, keeps the winner and deletes the rest.
No psql, no dashboard, , nothing at risk. The whole thing takes minutes.
00:00 Intro
00:55 Reading the schema straight from the CLI
03:50 Forking the database
05:35 Stories vs comments across June
06:50 Charting it in the browser
08:20 Forking five ways in parallel
09:45 Five index strategies
10:10 The race: EXPLAIN ANALYZE BUFFERS
12:00 The results
13:00 Keeping the winner, deleting the rest
15:45 Wrap-up
➡️ Ghost — managed Postgres forking: https://ghost.build
➡️ Claude Code — claude.com
➡️ Data: Hacker News items, June 2026 (389,561 rows)
Giving an AI agent database access has an obvious problem: experimenting means DDL. Creating indexes, dropping them, testing migrations — all destructive, all irreversible. So the usual answer is to not let the agent touch anything real, and you lose most of the value.
Forking fixes it. In this video, Claude Code spins up five copy-on-write forks of a 389,561-row. applies a different index strategy for each, races them, keeps the winner and deletes the rest.
No psql, no dashboard, , nothing at risk. The whole thing takes minutes.
00:00 Intro
00:55 Reading the schema straight from the CLI
03:50 Forking the database
05:35 Stories vs comments across June
06:50 Charting it in the browser
08:20 Forking five ways in parallel
09:45 Five index strategies
10:10 The race: EXPLAIN ANALYZE BUFFERS
12:00 The results
13:00 Keeping the winner, deleting the rest
15:45 Wrap-up
➡️ Ghost — managed Postgres forking: https://ghost.build
➡️ Claude Code — claude.com
➡️ Data: Hacker News items, June 2026 (389,561 rows)










