thiagowfx's avatar

Β¬ just serendipity πŸ€ (not just serendipity)

Claude Code: swarm mode (agent teams)

β€’ 1242 words β€’ 6 min

Goodness.

Who asked for a feature to burn tokens?

Orchestrate teams of Claude Code sessions:

Coordinate multiple Claude Code instances working together as a team, with shared tasks, inter-agent messaging, and centralized management.

Demo running in the git repository of this blog:


 β–β–›β–ˆβ–ˆβ–ˆβ–œβ–Œ   Claude Code v2.1.37
β–β–œβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–›β–˜  Opus 4.6 Β· Claude Team
  β–˜β–˜ ▝▝    ~/Workspace/perrotta.dev

❯ swarm mode to analyze my blog

⏺ I'll set up a team of agents to analyze your blog from multiple angles in parallel.

⏺ Now let me spawn 4 agents to work in parallel on each analysis task.

⏺ 4 agents launched (ctrl+o to expand)
   β”œβ”€ @content-analyst (Explore)
   β”‚  ⎿  Analyze blog content and trends (shift+↑ to manage)
   β”œβ”€ @tech-analyst (Explore)
   β”‚  ⎿  Analyze Hugo technical setup (shift+↑ to manage)
   β”œβ”€ @structure-analyst (Explore)
   β”‚  ⎿  Analyze site structure and linking (shift+↑ to manage)
   └─ @quality-analyst (Explore)
      ⎿  Analyze code quality and practices (shift+↑ to manage)

⏺ 4 analysis agents are now running in parallel:
  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
  β”‚       Agent       β”‚               Focus Area                β”‚ Status  β”‚
  β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
  β”‚ content-analyst   β”‚ Posts, topics, tags, writing trends     β”‚ Running β”‚
  β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
  β”‚ tech-analyst      β”‚ Hugo config, layouts, shortcodes, theme β”‚ Running β”‚
  β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
  β”‚ structure-analyst β”‚ Internal linking, assets, navigation    β”‚ Running β”‚
  β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
  β”‚ quality-analyst   β”‚ Templates, CSS/JS, code quality         β”‚ Running β”‚
  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
  I'll compile the results as they come in.

✒ Analyzing Hugo technical setup… (2m 0s Β· 0 tokens)

    ╒═ team-lead Β· shift + ↑/↓ to select
    β”œβ”€ @content-analyst: Running Get recent and oldest posts with metadata… Β· 19 tool uses Β· 34.3k tokens
    β”œβ”€ @quality-analyst: Reading 5 files… Β· 24 tool uses Β· 70.6k tokens
    β”œβ”€ @structure-analyst: Reading 5 files… Β· 26 tool uses Β· 38.5k tokens
    └─ @tech-analyst: Searching for 2 patterns, reading 3 files… Β· 73 tool uses Β· 95.9k tokens

Lesson learned: start Claude in YOLO mode:

shell
% which claudey
claudey: aliased to claude --dangerously-skip-permissions

Some folks are starting to suggest to alias this invocation to cc, but I find it to be poor taste. cc is the C compiler.

…otherwise you’ll be nagged to death with permissions prompts from multiple agents. Decision fatigue is real, folks.

@tech-analyst❯ Complete Hugo technical setup analysis

⏺ Great, the tech analyst has finished. Let me update its task and wait for the others.

⏺ Excellent analysis from the tech analyst. Waiting on the other 3 agents to finish their analysis...


⏺ The tech analyst is idle now β€” its work is already captured. Waiting on content, structure, and quality
  analysts to report back.


⏺ Still waiting on the other 3 agents (content, structure, quality) to complete their analysis...


@quality-analyst❯ Complete code quality analysis report

⏺ Quality analyst is done too. Let me update its task.

⏺ 2 of 4 analyses complete. Still waiting on content-analyst and structure-analyst...


⏺ Waiting on content-analyst and structure-analyst to finish...


⏺ Still waiting on the last 2 agents...


⏺ Waiting for content-analyst and structure-analyst to complete their reports.


@content-analyst❯ Complete blog content analysis: 1041 posts, trends, tags, topics

⏺ Content analyst is done with a thorough report. Let me update its task.

⏺ 3 of 4 complete. Just waiting on structure-analyst now...


⏺ Waiting on structure-analyst to finish the last report...


⏺ Still waiting on the structure-analyst...


@structure-analyst❯ Complete site structure analysis report

⏺ All 4 agents have reported back! Let me update the last task and shut down the team.

✻ Baked for 5m 17s

⏺ ---
  Blog Analysis: perrotta.dev

  Here's the consolidated analysis from all 4 agents.

  At a Glance
  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
  β”‚        Metric        β”‚        Value        β”‚
  β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
  β”‚ Total posts          β”‚ 1,041               β”‚
  β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
  β”‚ First post           β”‚ Sep 2014            β”‚
  β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
  β”‚ Unique tags          β”‚ 27                  β”‚
  β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
  β”‚ Top tag              β”‚ dev (902 posts)     β”‚
  β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
  β”‚ Median post length   β”‚ 44 lines            β”‚
  β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
  β”‚ Internal cross-links β”‚ 207 (bidirectional) β”‚
  β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
  β”‚ Graph nodes/edges    β”‚ 1,039 / 213         β”‚
  β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
  β”‚ Template files       β”‚ 33                  β”‚
  β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
  β”‚ Pre-commit hooks     β”‚ ~40                 β”‚
  β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
  β”‚ External theme       β”‚ None (fully custom) β”‚
  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
  ---
  Content Profile

  Growth trajectory is dramatic β€” from 1 post in 2014 and a 5-year hiatus (2017-2021) to 598 posts in 2025
  and 153 already in Feb 2026. The coding section (LeetCode, ByteByteGo, AoC) drives the volume surge, with
   batch publishing days hitting 43 posts in a single day.

  Two distinct voices: 87% of posts are tagged dev (technical), while 19% are tagged serenity
  (philosophical, short reflections β€” some just 9 lines). The bestof tag (148 posts, 14%) provides a
  curated recommendation layer.

  Top topics: LeetCode solutions (201), serenity reflections (194), bestof picks (148), AI/LLM (50), git
  (48), privacy (43), macOS (41), Kubernetes (35).

  Writing style: Overwhelmingly short-form (median 44 lines, longest 367). Text-only β€” only 3 posts contain
   images.

  ---
  Technical Architecture

  Fully custom Hugo setup β€” no external theme, all 33 templates in layouts/. Catppuccin color scheme
  (Latte/Mocha) with modern CSS (light-dark(), view transitions, prefers-reduced-motion). All CSS inlined
  (~1200 lines), JS deferred and fingerprinted.

  Standout features for a static site:
  - Client-side full-text search with lazy-loaded JSON index
  - D3.js interactive force-directed graph (full site + per-post mini-graphs)
  - Precomputed backlinks, related posts, and "Previously" chains (via Python script)
  - Keyboard navigation (j/k, arrows, f for fullscreen)
  - IndieWeb microformats (h-card, h-entry, h-feed)
  - Multiple output formats: HTML, RSS, Markdown, OPML, llms.txt, JSON
  - Multilingual (EN/PT) with conditional language switcher

  Build pipeline is robust: Justfile with 19 recipes, Python precomputation step, and the most thorough
  pre-commit setup I've seen for a personal blog (40 hooks covering formatting, security, content quality,
  and Hugo-specific validation).

  ---
  Site Structure

  External links heavily favor GitHub (517), LeetCode (204), Wikipedia (84), and StackOverflow (45).
  Internal cross-referencing centers on the Advent of Code hub post (28 inbound links).

  SEO is comprehensive: JSON-LD, OpenGraph, Twitter Cards, canonical URLs, custom robots.txt blocking AI
  crawlers, sitemap pinging, llms.txt.

  Privacy-first: No analytics, no cookies, no ads, no tracking. Email-based replies. EXIF stripping on
  images. Warrant canary page.

  ---
  Strengths

  1. Performance β€” Inlined CSS, deferred JS, lazy loading, no external fonts, 512KB Club green team member
  2. Automation β€” 40 pre-commit hooks enforce quality, formatting, security, and Hugo-specific rules
  automatically
  3. Rich features β€” Search, graph, backlinks, related posts, keyboard nav, fullscreen β€” all on a static
  site
  4. Privacy β€” Zero tracking, no third-party dependencies for core functionality
  5. Content curation β€” bestof tagging and disciplined taxonomy (only 27 tags for 1,041 posts)

  Potential Improvements

  1. D3.js weight β€” d3.v7.min.js (~270KB) loads on every post page for the mini-graph; could be lazy-loaded
  2. Inline styles in templates β€” Several partials use inline style attributes instead of CSS classes
  3. Chroma CSS always inlined β€” ~78 syntax highlighting rules load even on pages without code blocks
  4. Hugo CI version drift β€” Deploy uses 0.152.2, prek uses 0.140.0, local is 0.155.3
  5. Portuguese content β€” Only 8 PT posts despite multilingual setup; could be expanded or streamlined

✻ Cooked for 36s


⏺ All 4 agents have shut down. Let me clean up the team.

⏺ 4 teammates shut down gracefully

⏺ Team cleaned up. The full analysis is in my summary above β€” let me know if you'd like to dig deeper into
  any specific area, or if you want actionable recommendations on any of the improvement areas identified.

Lesson learned: launch tmux before activating the swarm.

You’ll be able to see in multiple tmux panes at a glance all agents working simultaneously. This feature is supported out-of-the-box.