Overview
This project shows how to build an AI agent using the Claude Agent SDK that explores GitHub commits, selectively fetches diffs for ambiguous changes, and writes a categorized, developer- friendly changelog — all streamed to the frontend in real time.Tech stack
- Next.js — frontend using the App Router
- Claude Agent SDK — Anthropic’s SDK for building AI agents with custom tools
- Trigger.dev — workflow orchestration, real-time streaming, and observability
- Octokit — GitHub API client for fetching commits and diffs
Demo video
GitHub repo
View the changelog generator repo
Fork this repo to use it as a starting point for your own changelog automation.
How it works
List commits
Claude calls the
list_commits tool to fetch all commits in the date range via the GitHub API.Analyze each commit
Claude categorizes each commit:
- Skip trivial commits (typos, formatting)
- Include obvious features or improvements directly
- Fetch the full diff for ambiguous commits before deciding
trigger.config.ts
The Claude Agent SDK must be marked as external to prevent it from being bundled:trigger.config.ts
Adding a package to
external prevents it from being bundled into the task. This is required for
the Claude Agent SDK. See the build configuration docs for more
details.Key task code
The main task uses the Claude Agent SDK with two custom tools:list_commits and get_commit_diff.
Claude calls these autonomously to gather the information it needs.
trigger/generate-changelog.ts
Features
- Two-phase analysis — lists all commits first, then selectively fetches diffs only for ambiguous ones (saves API tokens)
- Real-time streaming — the changelog streams to the frontend as it’s generated via Trigger.dev Realtime
- Live observability — agent phase, turn count, and tool calls are broadcast via run metadata
- Private repo support — pass an optional GitHub token for private repositories
Relevant code files
| File | Description |
|---|---|
trigger/generate-changelog.ts | Main agent task with custom tools |
trigger/changelog-stream.ts | Stream definition for real-time output |
app/api/generate-changelog/route.ts | API endpoint that triggers the task |
app/response/[runId]/page.tsx | Streaming display page |
Learn more
AI Agents overview
Comprehensive guide for building AI agents with Trigger.dev
Trigger.dev Realtime
Stream task progress and output to your frontend
Scheduled tasks
Automate changelog generation on a schedule
Build configuration
Learn how to use the external option to avoid bundling certain packages