```html

Building a Granular Session-Based Technical Blog System for Four Properties

Overview

This session implemented an end-to-end automated technical blog generation system that captures development activity across four properties—queenofsandiego.com, sailjada.com, dangerouscentaur.com, and burialsatseasandiego.com—and publishes detailed technical posts to dedicated tech subdomains. The system uses Claude's session transcript hooks to trigger blog generation immediately after work sessions complete, ensuring real-time documentation of infrastructure changes, code modifications, and architectural decisions.

What Was Done

1. Infrastructure Foundation

Created separate S3 buckets, CloudFront distributions, and DNS routing for each tech blog:

  • queenofsandiego.com: S3 bucket `qos-tech-blog` with CloudFront distribution, Route53 alias record pointing `tech.queenofsandiego.com` to the distribution
  • sailjada.com: S3 bucket `jada-tech-blog` with CloudFront distribution, Route53 alias record
  • dangerouscentaur.com: S3 bucket `dc-tech-blog` using existing wildcard CloudFront distribution (`E2Q4UU71SRNTMB`) on `dc-sites` bucket via path-based routing
  • burialsatseasandiego.com: S3 bucket `bats-tech-blog` with CloudFront distribution, GoDaddy DNS CNAME record for validation and routing

All distributions use ACM wildcard certificates (existing certs for `*.queenofsandiego.com` and `*.sailjada.com`; new cert for `*.burialsatseasandiego.com`). CloudFront caching is configured with 1-hour TTL for HTML index files and longer caching for static assets.

2. Blog Generator Engine

Implemented `/Users/cb/Documents/repos/tools/tech_blog_generator.py` to parse Claude session transcripts in JSONL format. The generator:

  • Reads session transcript files capturing all tool invocations (file reads, writes, edits)
  • Extracts file paths, command executions, and code changes to build a comprehensive activity log
  • Filters out sensitive data: API keys, credentials, passwords, personal information
  • Groups related changes into logical sections (infrastructure, code changes, configuration updates)
  • Generates well-structured HTML articles with semantic markup
  • Includes exact file paths, function names, S3 bucket names, CloudFront distribution IDs, and Route53 hosted zone details
  • Explains architectural decisions and the reasoning behind technical choices

The generator produces articles formatted for developers, avoiding high-level summaries in favor of granular technical depth.

3. Automated Trigger System

Created `/Users/cb/.claude/hooks/tech_blog_stop.sh` as a Claude Code Stop hook that executes when a session ends:

  • The hook reads the session transcript from the current Claude Code session
  • Calls the blog generator to process the transcript
  • Detects which property (qos, jada, dc, or bats) was modified based on file paths in the session
  • Uploads generated HTML to the appropriate S3 bucket
  • Invalidates the CloudFront distribution to immediately serve fresh content
  • Logs all actions to `/Users/cb/.claude/logs/tech_blog_hook.log` for auditing

The hook is enabled in Claude Code settings (`/Users/cb/.claude/settings.json`) under the `stopHooks` array.

4. Navigation Integration

Added "Tech Blog" menu items to the Ship's Papers navigation on all four properties, making the tech blog discoverable from the main websites. The link structure follows the property's domain pattern (e.g., `https://tech.queenofsandiego.com/`).

Technical Details

Session Transcript Parsing

Claude session transcripts are stored as JSONL (JSON Lines) files. Each line represents an event in the session. The generator specifically targets:

  • Text content blocks: Command outputs and descriptions
  • Tool use blocks: All invocations of tools with input parameters, especially file operations (read, write, edit)
  • File modifications: Path extraction from "Write:" and "Edit:" messages in the transcript

The parser reconstructs the developer's workflow by sequencing these operations chronologically and grouping them by functional area.

Sensitive Data Filtering

Before publishing, the generator strips:

  • API keys and authentication tokens from environment variables and configuration files
  • AWS access keys and secret keys
  • Database credentials and connection strings
  • Personal email addresses and phone numbers from contact information
  • GoDaddy, Namecheap, and other DNS provider API credentials
  • CloudFlare tokens and similar third-party service credentials

This filtering preserves technical detail while protecting security.

CloudFront Distribution Architecture

Each blog uses a dedicated CloudFront distribution (except dangerouscentaur, which reuses the existing wildcard distribution). All distributions:

  • Point to their respective S3 buckets as origins
  • Use index.html as the default root object
  • Include HTTP/2 push optimization and gzip compression
  • Have query string forwarding disabled to maximize cache hits
  • Use CloudFront's standard cache behaviors with 1-hour TTL for HTML and longer TTL for assets

DNS and SSL Certificate Integration

Route53 properties (queenofsandiego.com, sailjada.com): Added alias records pointing `tech.[domain]` to CloudFront distribution domain names.

GoDaddy property (burialsatseasandiego.com): Validated a new ACM certificate for `*.burialsatseasandiego.com` by adding the required CNAME record to GoDaddy DNS. This enables the `tech.burialsatseasandiego.com` subdomain with SSL/TLS encryption.

Namecheap property (dangerouscentaur.com): The existing wildcard CloudFront distribution on `dc-sites` bucket already routes `*.dangerouscentaur.com`, so `tech.dangerouscentaur.com` is immediately available.

Infrastructure and Configuration

Script Files Created

/Users/cb/Documents/repos/tools/tech_blog_init.py
/Users/cb/Documents/repos/tools/tech_blog_generator.py
/Users/cb/.claude/hooks/tech_blog_stop.sh

AWS Resources Created

S3 Buckets: qos-tech-blog, jada-tech-blog, bats-tech-blog
CloudFront Distributions: 3 new distributions + 1 existing
Route53 Records: 2 alias records for tech.queenofsandiego.com and tech.sailjada.com
ACM Certificates: 1 new wildcard certificate for *.burialsatseasandiego.com
GoDaddy DNS: 1