Skip to content
All guides
Agents·10 min read·English

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

Prerequisites

Steps

  1. 01.Set up your environment
  2. 02.Install Tavily CLI
  3. 03.Create the project folder
  4. 04.The initial prompt that decomposes your topic
  5. 05.Launch agents in parallel
  6. 06.Automatic file organization
  7. 07.Hourly cron loop
  8. 08.D3 visualization
STEP 01

Set up your environment

Before you start, make sure Claude Code is installed and working. That's what runs the agents in parallel.

claude --version

Verify: you should see a version number. If not, check out my Claude Code Installer which installs everything in one command.

STEP 02

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 login

Verify: run tvly search "test" --json and you should get search results in JSON.

STEP 03

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
claude

Verify: Claude Code opens inside the new folder.

STEP 04

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).

STEP 05

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.

STEP 06

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.md

Verify: INDEX.md includes a short summary of each research file and groups them by cluster.

STEP 07

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.

STEP 08

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.html

Verify: 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

Related