How to Run 30 Agents That Research While You Sleep
You watched the video about the 30-agent knowledge map. This is the guide to run it yourself. 10 minutes of setup, ~$4 in tokens, zero time at the keyboard while it runs. At the end you'll have 30-40 organized research files and an interactive graph that connects them all.
What you'll have at the end
- 30-40 deep markdown files (40-100KB each) on your topic
- An interactive D3 graph connecting every file across 9 clusters
- Index files (INDEX.md, MAP.md, REFERENCES.md) that update themselves
- An hourly cron loop that spots gaps and fills them on its own
- Everything lives in
~/Desktop/projects/your-topic/research/
Prerequisites
- Claude Code installed (check with
claude --version) - A Tavily account with an API key (free up to 1000 searches per month)
- ~$5 in Anthropic API credits
- 10 minutes of setup time
- A full night where your computer won't sleep (or run it on a server)
Steps
Set up your environment
Before you start, make sure Claude Code is installed and working. That's what runs the agents in parallel.
claude --versionVerify: you should see a version number. If not, check out my Claude Code Installer which installs everything in one command.
Install Tavily CLI
Tavily is the search engine your agents will use to pull information from the web. You'll need to open an account at tavily.com and grab an API key.
npm install -g @tavily/cli
tvly auth loginVerify: run tvly search "test" --json and you should get search results in JSON.
Create the project folder
All the research goes into one dedicated folder. Name it after your topic (for example smart-investor, longevity, ecommerce-analytics).
mkdir -p ~/Desktop/projects/YOUR-TOPIC/research
cd ~/Desktop/projects/YOUR-TOPIC
claudeVerify: Claude Code opens inside the new folder.
The initial prompt that decomposes your topic
This prompt asks Claude to break your topic into 10-15 sub-topics, and each one becomes its own research agent. Swap YOUR-TOPIC with whatever you're researching.
I want you to do overnight parallel research on YOUR-TOPIC.
Step 1: Ask me 8-13 scoping questions (I can say "I don't know" to any of them).
Step 2: Break the topic into 7-15 research sub-topics, each becomes one markdown file of 40-100KB.
Step 3: Launch parallel background Agents (one per sub-topic) that use Tavily CLI (`tvly search "query" --json`) to research and write to research/NN-topic-name.md.
Step 4: Build INDEX.md, MAP.md, REFERENCES.md.
Step 5: Set up an hourly cron loop that does gap analysis and launches new agents.
Step 6: Generate a D3.js knowledge graph at research/MAP.html.
Launch all initial agents in a SINGLE message with parallel Agent tool calls.
No em dashes in any output.Verify: Claude should fire back a round of questions about your topic (goal, audience, depth).
Launch agents in parallel
Once you've answered the questions, Claude will say something like “Launching 10 agents in parallel...”. That's where the magic happens. Each agent gets one topic, runs 20-30 Tavily searches, and writes a 40-100KB markdown file. Within 3-5 minutes you should see the first files land.
ls -la research/Verify: you should see files like 01-topic.md, 02-topic.md... showing up. Each file should be 40-100KB.
Automatic file organization
After the first batch of agents finishes, Claude launches an index-builder agent that produces 3 index files. INDEX.md is a table of contents with summaries, MAP.md shows the relationships between concepts, REFERENCES.md collects every link.
cat research/INDEX.mdVerify: INDEX.md includes a short summary of each research file and groups them by cluster.
Hourly cron loop (optional but recommended)
This loop runs every hour, spots gaps in the research, and launches new agents to fill them. That's what turns the research from “good” into “comprehensive” over 8 hours.
# Inside Claude Code, ask it to:
Set up an hourly CronCreate that:
1. Inventories research/ files
2. Rebuilds INDEX.md/MAP.md/REFERENCES.md if new files added
3. Identifies 2-3 gaps still missing
4. Launches new background Agents for those gaps
Use cron expression "7 * * * *"Verify: the loop should produce new research files every hour. By morning you'll have 30-40 files instead of the initial 10-15.
D3 visualization
This is the file you saw in the video: an interactive D3.js graph with a center node, 9 colored clusters, and every research file as a node around them. Click a node to open a panel with the content.
# Ask Claude:
Generate an interactive D3.js knowledge graph at research/MAP.html:
- Orange center node (project name)
- 9 colored cluster nodes
- File nodes with numbers
- Solid lines for hierarchy, dashed curves for cross-concept relationships
- Click any node for detail panel with file content
- Drag to rearrange, scroll to zoom
Then: open research/MAP.htmlVerify: the browser opens with the interactive graph. You can click any node to read the file content.
Troubleshooting
“Tavily command not found”
Tavily CLI isn't installed. Run npm install -g @tavily/cli then tvly auth login.
Research files are too small (5-10KB)
The agents hit their research limit. Ask Claude: “Expand each research file to 40-80KB with 7-10 required sub-sections.”
The hourly loop isn't running on time
Check that CronCreate registered with CronList. On macOS, if the computer sleeps, the loop won't fire. Plug in and adjust Energy Saver settings.
“Rate limit exceeded” from Tavily
You launched too many agents at once. The free plan caps at 1000 searches per month. Upgrade or drop the agent count to 5-7.
API costs are higher than expected
A full overnight run with 30+ agents usually costs $3-5. If you're seeing more, the loop probably ran longer than planned, or you set more than 5 agents per round. Check CronList and stop the loop in the morning.
Next steps
- Swap the topic for something you care about: biohacking, e-commerce, health, personal finance, anything
- Tweak the agent count: 10 for a quick run, 30+ for a full night
- Customize the cluster colors in MAP.html to match your topic
- Pipe the research into /content-engine if you're building content
- Save the research in Notion or Obsidian for quick access