Overview
This demo how to build an AI agent using the Claude Agent SDK that explores GitHub commits, investigates unclear changes by fetching diffs on demand, and generates developer-friendly changelogs.Tech stack
- Next.js – Frontend framework using App Router
- Claude Agent SDK – Anthropic’s agent SDK for building AI agents with custom tools
- Trigger.dev – workflow orchestration with real-time streaming, observability, and deployment
- Octokit – GitHub API client for fetching commits and diffs
Demo video
GitHub repo
View the changelog generator repo
Click here to view the full open source code for this project in our examples repository on
GitHub. You can fork it and use it as a starting point for your own project.
How it works
The agent workflow:- Receive request – User provides a GitHub repo URL and date range
- List commits – Agent calls
list_commitsMCP tool to get all commits - Analyze commits – Agent categorizes each commit:
- Skip trivial commits (typos, formatting)
- Include clear features/improvements directly
- Investigate unclear commits by fetching their diffs
- Generate changelog – Agent writes a categorized markdown changelog
- Stream output – Changelog streams to the frontend in real-time
Features
- Two-phase analysis – Lists all commits first, then selectively fetches diffs only for ambiguous ones
- Custom tools –
list_commitsandget_commit_diffcalled autonomously by Claude - Real-time streaming – Changelog streams to the frontend as it’s generated via Trigger.dev Realtime
- Live observability – Agent phase, turn count, and tool calls broadcast via run metadata
- Private repo support – Optional GitHub token for private repositories
Relevant code
| File | Description |
|---|---|
trigger/generate-changelog.ts | Main 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 |
trigger.config.ts
You need to mark the Claude Agent SDK as external in your trigger.config.ts file.trigger.config.ts
Adding packages to
external prevents them from being bundled, which is necessary for the Claude
Agent SDK. See the build configuration docs for more details.Learn more
- Building agents with Claude Agent SDK – Comprehensive guide for using Claude Agent SDK with Trigger.dev
- Realtime – Stream task progress to your frontend
- Scheduled tasks – Automate changelog generation on a schedule

