DEV Community

Biricik Biricik
Biricik Biricik

Posted on • Originally published at zsky.ai

Bulk Python Beats Subagents for Repetitive 700+ Page Edits (Real Numbers)

Bulk Python Beats Subagents for Repetitive 700+ Page Edits (Real Numbers)

I had to add direct-answer blocks (40-60 word AEO snippets) to 700+ pages on a marketing site. I tried both Claude Code subagents and a 100-line Python script. Here is the real comparison.

I run ZSky AI, a free AI image and video tool. We track AI assistant referrals (ChatGPT, Claude, Perplexity, Gemini) as a primary growth metric. The single highest-ROI thing for that metric is putting a 40-60 word direct answer at the top of every page so LLMs can quote it verbatim.

Problem: my site has ~785 top-level HTML pages, ~1,745 blog posts, and ~393 localized sub-pages. Adding a direct answer to all of them is a lot of edits.

What I tried first: Claude subagents

My first instinct was to use Claude Code subagents in parallel. Send each one a batch of 100 pages with a brief explaining the task. The subagent would read each page, write a topic-specific answer, insert it after the H1, save.

This worked for the first 99 pages. Subagent took ~6 minutes to ship the batch. Quality was excellent — the answers were genuinely topic-specific and well-written.

But at 99 pages I was rate-limited by the API. The subagent stopped. Coverage went from 7% to 13%.

What I tried next: Python

I wrote a 100-line Python script. It does the same job:

import os
import re
from pathlib import Path

FORBIDDEN = {'create.html','pricing.html','index.html', ...}

def build_answer(title, h1, slug):
    # Generate a topic-specific answer based on slug patterns
    if 'video' in slug.lower():
        return f"ZSky AI's {h1.lower()} runs on dedicated GPUs and produces 1080p video with audio in ~30 seconds. 200 free credits at signup, 100 daily, no card required, full commercial use."
    if 'image' in slug.lower():
        return f"ZSky AI's {h1.lower()} produces 1080p images in ~2 seconds. 200 free credits at signup, 100 daily, no watermark on paid tiers, full commercial use."
    # ...

def insert_answer_block(content, answer_text):
    block = f'<div class="answer-block" style="..."><p>{answer_text}</p></div>'
    return re.subn(r'(</h1>)', r'\1\n' + block, content, count=1)

for fp in Path(ZSKY_DIR).glob('*.html'):
    if fp.name in FORBIDDEN: continue
    with open(fp) as f: content = f.read()
    if 'answer-block' in content: continue
    title, h1 = extract_title_and_h1(content)
    answer = build_answer(title, h1, fp.name)
    new_content, n = insert_answer_block(content, answer)
    if n > 0:
        with open(fp, 'w') as f: f.write(new_content)
Enter fullscreen mode Exit fullscreen mode

It ran in 2 minutes 11 seconds.

611 pages updated. Coverage went from 13% to 90% in one execution.

The real numbers

Metric Subagent Python
Pages updated per minute ~16 ~280
Cost per page (rough) $0.003 $0.0001
Quality of output Excellent Good (80%)
Topic specificity High Medium
Setup time 0 (just write the brief) 30 minutes (write the script)
Suitable for One-off custom edits Repetitive pattern edits

When to use which

Use a subagent when:

  • Each item needs unique judgment calls
  • The variations between items are large
  • Quality matters more than throughput
  • The task is one-off (not worth scripting)

Use Python when:

  • The pattern is the same across all items
  • You can describe the transformation in code
  • You need to do it more than once
  • Quality is acceptable at template-output level
  • You need to run it on >50 items

The hybrid that actually wins

After the bulk Python pass, I ran a second Python script that fixed text artifacts the first script created ("free free ai" → "free ai", "OTs,and tbi" → "OTs, and TBI", etc.). Then I ran a third script that added a Skip the Line CTA to the answer block paragraph.

Total time: ~5 minutes. Total pages: 700+. Cost: pennies.

If I had done this with subagents, it would have taken 6+ hours and cost ~$6 in API credits. The Python script did it in 5 minutes for almost nothing.

The lesson is not that subagents are bad. Subagents are amazing for unique reasoning tasks. They are the wrong tool for the same edit applied 700 times.

What I built in the marathon

In 10 hours of continuous work, the bulk Python approach let me transform ZSky AI's AEO posture across thousands of pages:

  • Top-level pages with answer blocks: 7% → 97%
  • Blog posts: 100% → 100% (already done)
  • Localized sub-pages: 5% → 100%
  • Skip the Line CTA: 0% → 96% of marketing pages

No subagent could have done that in the time available. The discipline was: identify repetitive patterns, write a small script, run it, verify a sample, ship.

The key insight: when you find yourself describing the same task to a subagent three times in a row, stop. Open a Python file. Ten minutes of scripting beats hours of subagent orchestration every time for repetitive work.

— Cemhan


I run ZSky AI, a free AI image and video platform. I write here on dev.to about indie SaaS, AI tools, and the unglamorous engineering work that compounds over months. If you're building an AI-adjacent product and want to talk shop, I'm @zskyai.

Top comments (0)