Hacker news Agent
December 19, 2025 ยท View on GitHub
Overview
This service fetches AI-related topics from various sources hourly and sends a formatted summary email. The system uses claude code to gather, analyze, and format content into a visually appealing HTML email.

How It Works
Workflow
- Fetch Data - Claude code sub agent (you can see prompt in .claude/agents/fetch-agent.md) fetches AI-related topics from various sources
- Process Content - Agent analyzes and selects 10 relevant topics
- Generate Email - Node.js service formats content into HTML and plain text
- Send Email - Email sent via Resend API to configured recipients
Execution Flow
The system runs on a scheduled cron job that executes run_task.sh, which triggers the AI agent workflow and email delivery process.
Architecture
Core Components
- task_prompt.md - Detailed instructions for the AI agent workflow
- run_task.sh - Main execution script that triggers the AI agent
- send-email/ - Node.js email service for sending formatted emails
index.ts- TypeScript source codebuild/index.js- Compiled JavaScript for execution.env.local(cp .env.local.example .env.local)- Environment configurationpackage.json- Node.js dependencies
Usage
Init
- Install Claude code, nodejs(lts version is fine), npm, uv
- Add exec permission
chmod +x ./run_task.sh
Updating Configuration
get your resend api key here:https://resend.com/api-keys and then
# Edit environment variables
nano send-email/.env.local
# Rebuild the Node.js service after changes
cd send-email && npm install && npm run build
Run
./run_task.sh