AI News Briefing
Automated daily AI news research agent that searches the web, compiles a structured briefing, publishes it to Notion and/or Obsidian, and delivers a styled summary to Microsoft Teams and Slack -- powered by Claude Code, Codex, Gemini, or Copilot CLIs with automatic fallback. Supports both macOS (launchd) and Windows (Task Scheduler). Includes an on-demand Custom Brief mode for deep multi-agent research on any topic. Obsidian integration enables graph visualization of topic relationships across briefings. Fully automated pipeline with zero manual intervention required after setup.
[!NOTE] Live AI News Notion page: https://hoangsonw.notion.site/9c34d052d9354beda82a3423e2d2f404?v=d43c53fe405c4896bfd95ad0cc22246f
Overview
AI News Briefing is a fully automated pipeline that runs every morning on your machine. It supports four AI CLI engines -- Claude Code, Codex (OpenAI), Gemini (Google), and Copilot (GitHub) -- with automatic fallback if your preferred engine is unavailable. The selected engine runs in headless mode as a news research agent: searching the web across 9 AI-related topics, compiling the results into a two-tier briefing (TL;DR + full report), writing the finished page directly to a Notion database, optionally publishing to an Obsidian vault with graph-ready wikilinks, and optionally posting a styled Adaptive Card summary to Microsoft Teams and Slack.
The entire process -- from triggering to publishing -- requires zero human intervention. You wake up, open Notion or Obsidian (or Teams or Slack), and your daily AI briefing is already there.
Custom Brief extends this with on-demand deep research: pick any topic, and 5 parallel research agents investigate it from different angles (breaking news, technical analysis, industry impact, trends, and policy). Results publish to Notion, Obsidian, Teams, and/or Slack -- or just print to your terminal.
Why it exists
Keeping up with AI news across models, tools, policy, funding, and open source is a full-time job. This project compresses that into an automated daily digest that covers 9 topic areas in a consistent format, delivered to your Notion workspace before you start your workday. When you need to go deeper on a specific topic, the custom brief gives you a comprehensive research report on demand.
Research Ops Plugin Ecosystem
Beyond the automated daily briefing, this project has evolved into a Unified Research Ops Ecosystem containing 10 deeply integrated intelligence plugins available natively for Claude Code, OpenAI Codex, and Gemini CLI.
The ecosystem includes 10 production-ready agents covering News & Media (ai-news, last30days, podcast-summarizer), Tech & Dev (trend-spotter, paper-reader, repo-auditor), and Business (earnings, competitor-intel, startup-scout, crypto-tracker). These plugins and skills enable AI agents to perform a wide range of research tasks -- from tracking social media trends to analyzing financial filings to summarizing technical papers.
See PLUGINS.md for the complete developer manual.
Architecture
We leverage the scheduling capabilities of the OS (launchd on macOS, Task Scheduler on Windows) to trigger a shell script at a specific time each day. The script reads a prompt template, selects an AI CLI engine (via the AI_BRIEFING_CLI env var or automatic fallback: claude → codex → gemini → copilot), and invokes it in headless mode. The agentic prompt performs web searches, compiles results, and calls the Notion MCP tool to create a new page in the database.
flowchart TD
subgraph Schedulers
A1[macOS launchd]
A2[Windows Task Scheduler]
end
A1 -->|8 AM Pacific daily| B1[briefing.sh]
A2 -->|8 AM Pacific daily| B2[briefing.ps1]
B1 -->|Reads| C[prompt.md]
B2 -->|Reads| C
B1 -->|Invokes| D[AI Engine - Claude/Codex/Gemini/Copilot]
B2 -->|Invokes| D
D -->|Step 1: Search| E[WebSearch Tool]
E -->|9 topics x multiple queries| F[Web Results]
F -->|Step 2: Compile| G[Two-Tier Briefing]
G -->|Step 3: Write| H[Notion MCP]
H -->|Creates page| I[Notion Database]
D -->|Step 4: Write card| J2[logs/YYYY-MM-DD-card.json]
D -->|Step 5: Write obsidian md| J3[logs/YYYY-MM-DD-obsidian.md]
B1 -->|If Teams webhook set| T[notify-teams.sh]
B2 -->|If Teams webhook set| T2[notify-teams.ps1]
T -->|POST card.json| V[Teams Webhook]
T2 -->|POST card.json| V
V --> W[Teams Channel]
B1 -->|If Slack webhook set| S1[notify-slack.sh]
B2 -->|If Slack webhook set| S2[notify-slack.ps1]
S1 -->|Convert + POST| SV[Slack Webhook]
S2 -->|Convert + POST| SV
SV --> SW[Slack Channel]
B1 -->|If Obsidian vault set| OB1[publish-obsidian.sh]
B2 -->|If Obsidian vault set| OB2[publish-obsidian.ps1]
OB1 -->|Copy + create topics| OBV[Obsidian Vault]
OB2 -->|Copy + create topics| OBV
B1 -->|Logs output| J[logs/YYYY-MM-DD.log]
B2 -->|Logs output| J
J -->|Auto-cleanup| K[Delete logs older than 30 days]
Data flow summary:
- The platform scheduler fires the entry point script (
briefing.shon macOS,briefing.ps1on Windows) at the configured time each day. - The script reads the prompt from
prompt.mdand passes it to the selected AI CLI engine in headless mode. - The AI engine executes the prompt as an agentic task -- performing web searches, compiling results, and calling the Notion MCP tool.
- Notion receives the finished briefing as a new database page.
- Claude also writes an Obsidian-formatted markdown file with
[[wikilinks]]for graph visualization. - If the
AI_BRIEFING_TEAMS_WEBHOOKenvironment variable is set, the entry point script callsnotify-teams.sh/notify-teams.ps1, which validates and POSTs the pre-builtlogs/YYYY-MM-DD-card.jsonfile (written by Claude in Step 4) to the configured Teams webhook. - If the
AI_BRIEFING_SLACK_WEBHOOKenvironment variable is set, the entry point script callsnotify-slack.sh/notify-slack.ps1, which converts the Teams card to Slack Block Kit format and POSTs it to the configured Slack webhook. - If the
AI_BRIEFING_OBSIDIAN_VAULTenvironment variable is set, the entry point script callspublish-obsidian.sh/publish-obsidian.ps1, which copies the briefing to the vault and creates topic stub pages for graph nodes. - Logs are written to a date-stamped file and automatically pruned after 30 days.
Prerequisites
Installation
1. Clone the project
git clone https://github.com/hoangsonww/AI-News-Briefing
cd AI-News-Briefing
2. Platform-specific setup
macOS (launchd)
# Make the shell script executable
chmod +x ~/ai-news-briefing/briefing.sh
# Install the launchd plist
cp ~/ai-news-briefing/com.ainews.briefing.plist ~/Library/LaunchAgents/
launchctl load ~/Library/LaunchAgents/com.ainews.briefing.plist
# Verify the agent is registered
launchctl list | grep ainews
Optionally, set up the manual trigger command:
mkdir -p ~/.local/bin
cat > ~/.local/bin/ai-news << 'EOF'
#!/bin/bash
echo "Starting AI News Briefing..."
launchctl kickstart "gui/$(id -u)/com.ainews.briefing"
echo "Running. Check Notion or: tail -f ~/ai-news-briefing/logs/$(date +%Y-%m-%d).log"
EOF
chmod +x ~/.local/bin/ai-news
Make sure ~/.local/bin is in your PATH (add export PATH="$HOME/.local/bin:$PATH" to your ~/.zshrc if needed).
Windows (Task Scheduler)
Open PowerShell and run the installer script:
cd $env:USERPROFILE\ai-news-briefing
.\install-task.ps1
This registers a Task Scheduler task named AiNewsBriefing that runs daily at 8:00 AM Pacific (PST/PDT) under the current user account. Task Scheduler triggers fire in the host's local time and have no timezone field, so the task repeats every 30 minutes and briefing.ps1 -Catchup gates the run to 08:00 in AI_BRIEFING_TZ (default Pacific) -- so it lands at 8 AM Pacific no matter what zone the machine is set to. See Change the timezone.
To customize the time:
.\install-task.ps1 -Hour 7 -Minute 30
Configuration
Change the schedule
The briefing fires at 8:00 AM Pacific (PST/PDT) by default, regardless of the host machine's clock or timezone. Neither launchd nor Task Scheduler has a timezone field, so the time is pinned inside the entry script: it polls frequently and --catchup / -Catchup only runs once the clock passes 08:00 in AI_BRIEFING_TZ. To run in a different zone, see Change the timezone; to change the hour, adjust the trigger and the 08:00 gate as below.
macOS: Edit com.ainews.briefing.plist and modify the StartCalendarInterval entries, then reload:
launchctl unload ~/Library/LaunchAgents/com.ainews.briefing.plist
launchctl load ~/Library/LaunchAgents/com.ainews.briefing.plist
The
StartCalendarIntervalis an array of host-local times that map to 08:00 Pacific (e.g. on a UTC+7 host,22:00= 8 AM PDT and23:00= 8 AM PST). Both fire; the Pacific guard runs only the one at/after 08:00 Pacific. TheStartInterval(every 30 min) is the sleep/wake catch-up -- it runsbriefing.sh --catchup, which only acts when today's briefing hasn't run yet and it's past 08:00 Pacific. Leave it in place; it recovers a run missed because the Mac was asleep at 8 AM.
Windows: Re-run the installer with a new host-local anchor time (the 30-min poll + Pacific guard still apply):
.\install-task.ps1 -Hour 9 -Minute 0
Change the timezone
The briefing's notion of "today" and its 08:00 schedule both follow AI_BRIEFING_TZ. The default is Pacific. Set it to any zone -- DST is handled automatically.
# macOS / Linux -- use an IANA zone id
export AI_BRIEFING_TZ=America/New_York
# Windows -- use a Windows zone id ("Eastern Standard Time" covers EST/EDT)
setx AI_BRIEFING_TZ "Eastern Standard Time"
On macOS the scheduled job reads it from the plist's EnvironmentVariables. Set it in one step (edits the installed plist in place and reloads):
./scripts/update-schedule.sh --tz America/New_York
Or add/edit the AI_BRIEFING_TZ key in com.ainews.briefing.plist by hand and reload. On Windows, setx persists it to your user environment and briefing.ps1 picks it up on the next run. (PowerShell 7+ also accepts IANA ids like America/New_York; Windows PowerShell 5.1 requires the Windows id.)
Change the AI engine
Set the AI_BRIEFING_CLI environment variable to choose which engine to use:
export AI_BRIEFING_CLI=codex # or: claude, gemini, copilot
If not set, the daily briefing tries engines in fallback order: claude → codex → gemini → copilot, using the first one found. For custom briefs, pass --cli:
./custom-brief.sh --cli gemini --topic "AI safety"
Change the model
Set the AI_BRIEFING_MODEL environment variable to override the default model for any engine:
export AI_BRIEFING_MODEL=opus
Or edit the entry point script for your platform:
- macOS:
briefing.sh-- change the--model sonnetflag - Windows:
briefing.ps1-- change the--model sonnetargument
Model trade-offs (Claude Code):
Change the budget cap
Edit the --max-budget-usd value in briefing.sh (macOS) or briefing.ps1 (Windows). The default is 2.00 (USD per run). This acts as a safety cap -- if the agent's token usage would exceed this amount, the run stops.
Change the topics
Edit prompt.md and modify the "Topics to Search" list. You can add, remove, or rename topics. If you change the number of topics, also update the "Topics": 9 value in the Notion properties section at the bottom of the prompt.
Usage
Automatic (scheduled)
Once installed, the briefing runs automatically every day at the scheduled time (default: 8:00 AM Pacific, PST/PDT). No action needed.
Manual trigger
Using Make (recommended, cross-platform):
make run # Run in foreground (auto-detects engine)
make run-bg # Run in background
make run-scheduled # Trigger via OS scheduler
make run CLI=codex # Use a specific engine
Platform-native:
# macOS
ai-news
# or: launchctl kickstart "gui/$(id -u)/com.ainews.briefing"
# Windows (PowerShell or cmd)
schtasks /run /tn AiNewsBriefing
Watch the progress
make tail # Cross-platform: tail today's log
Or platform-native:
# macOS
tail -f ~/ai-news-briefing/logs/$(date +%Y-%m-%d).log
# Windows (PowerShell)
Get-Content "$env:USERPROFILE\ai-news-briefing\logs\$(Get-Date -Format 'yyyy-MM-dd').log" -Wait
A typical successful run takes 2-4 minutes and ends with a message like:
2026-03-09 14:08:08 Briefing complete. Check Notion for today's report.
Makefile Reference
The project includes a cross-platform Makefile that auto-detects your OS and routes commands to the correct platform tools. Requires GNU Make.
Utility Scripts Reference
The scripts/ directory contains 21 cross-platform pairs (.sh for macOS/Linux + .ps1 for Windows) plus 12 bash-only utilities for Unix-only concerns (POSIX shells, launchctl, open/xdg-open, shellcheck, git hooks). Grouped by concern below. For per-script deep-dives, flags, mermaid diagrams, and conventions, see scripts/README.md.
Pipeline operations
Delivery (Teams / Slack / Obsidian)
Quality eval harness operations
Plugin authoring
Windows equivalents use the same names with .ps1 extension and PowerShell parameter syntax — for example .\scripts\health-check.ps1, .\scripts\eval-summary.ps1 -Judge claude-haiku-4-5-20251001, .\scripts\plugin-validate.ps1 -Strict, or .\scripts\scaffold-plugin.ps1 -Name my-plugin -Description "..." -WithAgent reviewer. Every eval and plugin script is also wrapped by a Makefile target (make eval-summary, make plugin-validate, make scaffold-plugin NAME=... DESC=..., etc.) that auto-routes to the correct platform.
Bash-only utilities (macOS / Linux)
These scripts target Unix-only concerns (POSIX shells, launchctl, open/xdg-open, shellcheck, git hooks, etc.) and intentionally have no PowerShell mirror. Every one of them ships a --help flag and a --json flag where applicable, and most are wrapped by a make target for convenience.
Notion Setup
Database schema
The prompt expects a Notion database with at least these properties:
You can add additional properties to the database (tags, priority, etc.), but the three above are what the agent writes to.
Data source ID
The prompt references a specific Notion data source ID:
856794cc-d871-4a95-be2d-2a1600920a19
To use your own database, replace this value in prompt.md (in the Step 3 section). To find your data source ID:
- Open Claude Code and ensure the Notion MCP is connected.
- Ask Claude: "List my Notion data sources" or use the
notion-searchMCP tool. - Copy the
data_source_idfor the database you want to use. - Replace the ID in
prompt.md.
Page format
Each generated page contains:
- TL;DR -- 10-15 bullet points covering the biggest stories (roughly a 1-minute read)
- Divider
- Full Briefing -- 9 sections (one per topic), each with 3-8 detailed bullet points and source attribution
- Key Takeaways table -- a summary table of major trends and signals
Delivery Integrations (Teams + Slack)
The notification system supports both Microsoft Teams and Slack after a successful briefing run. Both channels are optional and can be enabled independently.
- Shared source artifact: Claude writes one card file,
logs/YYYY-MM-DD-card.json, in Step 4. - Teams path:
notify-teams.sh/.ps1validates JSON and POSTs the payload directly to Teams webhook URL(s). - Slack path:
notify-slack.sh/.ps1converts the same card file to Slack Block Kit usingscripts/teams-to-slack.py, then POSTs to Slack webhook URL(s). - Fan-out support: Both channels support semicolon-separated webhook URLs.
flowchart LR
A["Claude writes logs/YYYY-MM-DD-card.json"] --> B{"Channel"}
B --> C["notify-teams.sh / notify-teams.ps1"]
B --> D["notify-slack.sh / notify-slack.ps1"]
C --> E["POST Adaptive Card JSON to Teams webhooks"]
D --> F["teams-to-slack.py conversion"]
F --> G["POST Block Kit JSON to Slack webhooks"]
Teams Setup
- Create a Teams webhook (Power Automate workflow).
Full guide: NOTIFY_TEAMS.md - Set
AI_BRIEFING_TEAMS_WEBHOOK. - Run the briefing or call
notify-teamsdirectly.
Slack Setup
- Create a Slack app incoming webhook at api.slack.com/apps.
- Set
AI_BRIEFING_SLACK_WEBHOOK. - Run the briefing or call
notify-slackdirectly.
Set Webhook URL(s) Persistently
macOS / Linux
# Teams
export AI_BRIEFING_TEAMS_WEBHOOK="https://first-teams-webhook"
# Slack
export AI_BRIEFING_SLACK_WEBHOOK="https://hooks.slack.com/services/T.../B.../..."
# Obsidian vault
export AI_BRIEFING_OBSIDIAN_VAULT="/path/to/your/obsidian/vault"
Windows (PowerShell)
[Environment]::SetEnvironmentVariable("AI_BRIEFING_TEAMS_WEBHOOK", "https://first-teams-webhook", "User")
[Environment]::SetEnvironmentVariable("AI_BRIEFING_SLACK_WEBHOOK", "https://hooks.slack.com/services/T.../B.../...", "User")
[Environment]::SetEnvironmentVariable("AI_BRIEFING_OBSIDIAN_VAULT", "C:\path\to\your\obsidian\vault", "User")
Multiple Webhooks and --all / -All
Configure multiple URLs with semicolons:
export AI_BRIEFING_TEAMS_WEBHOOK="https://teams-webhook-1;https://teams-webhook-2"
export AI_BRIEFING_SLACK_WEBHOOK="https://slack-webhook-1;https://slack-webhook-2"
notify-teams/notify-slackdefault: send to first URL only.--all(bash) /-All(PowerShell): send to all configured URLs.- Current
briefing.shandbriefing.ps1call both notifiers with all URLs.
# First URL only
bash scripts/notify-teams.sh
bash scripts/notify-slack.sh
# All configured URLs
bash scripts/notify-teams.sh --all
bash scripts/notify-slack.sh --all
Test Delivery Directly
macOS / Linux
bash scripts/notify-teams.sh --all --card-file logs/2026-03-24-card.json
bash scripts/notify-slack.sh --all --card-file logs/2026-03-24-card.json
Windows (PowerShell)
.\scripts\notify-teams.ps1 -All -CardFile .\logs\2026-03-24-card.json
.\scripts\notify-slack.ps1 -All -CardFile .\logs\2026-03-24-card.json
For full setup and troubleshooting:
Custom Brief: Deep Topic Research
In addition to the daily automated briefing, you can run a deep research briefing on any topic on demand. This spawns 5 parallel research agents that investigate the topic from different angles, then synthesizes findings into a comprehensive news briefing.
flowchart LR
subgraph "Input"
A["--topic 'AI in healthcare'"]
B["--notion --obsidian --teams --slack"]
end
A --> C[custom-brief.sh / .ps1]
B --> C
C -->|5 parallel agents| D[Deep Research]
D --> E[Structured Briefing]
E --> F[Terminal Output]
E -->|optional| G[Notion]
E -->|optional| G2[Obsidian Vault + Graph]
E -->|optional| H[Teams]
E -->|optional| I[Slack]
Quick start
# Full research with all destinations
./custom-brief.sh --topic "AI in healthcare" --notion --obsidian --teams --slack
# Terminal + Notion + Obsidian
./custom-brief.sh -t "quantum computing" -n -o
# Obsidian only (for graph visualization)
./custom-brief.sh -t "AI coding tools" -o
# Use a specific engine
./custom-brief.sh --cli codex --topic "AI safety" --notion
# Interactive mode (prompts for topic, engine, and destinations)
./custom-brief.sh
# PowerShell
.\custom-brief.ps1 -Topic "AI regulation EU" -Notion -Obsidian -Teams
# PowerShell with engine override
.\custom-brief.ps1 -Cli gemini -Topic "AI regulation EU" -Notion
# Make
make custom-brief T="open source LLMs" NOTION=1 OBSIDIAN=1 TEAMS=1
make custom-brief T="AI safety" CLI=codex NOTION=1
What it produces
- TL;DR -- 5-10 bullet points with key findings
- Thematic sections -- 3-6 sections organized by theme with linked citations and dates
- Key Trends & Outlook -- strategic implications table
- Sources -- numbered list of every URL cited
Every finding includes a clickable source link and publication date. Full details: CUSTOM_BRIEF.md
How the Prompt Works
The prompt (prompt.md) instructs Claude to execute four sequential steps within a single agentic session:
Step 1: Search for News
Claude uses the WebSearch tool to perform multiple searches per topic, targeting news from the past 24-48 hours. The search strategy includes date-qualified queries like "[topic] news today 2026-03-09" and company-specific queries.
Step 2: Compile the Briefing
Search results are synthesized into a two-tier format:
- Tier 1 (TL;DR): 10-15 one-sentence bullet points covering the top stories across all topics. Designed as a quick-scan summary.
- Tier 2 (Full Briefing): 9 sections with detailed coverage, source attribution, and a closing Key Takeaways table.
Step 3: Write to Notion
Claude checks whether a page for today already exists (captured during Step 0b). If one exists, it updates the page in place. If not, it creates a new page in the target database. This prevents duplicate pages when the briefing runs multiple times in a day.
Step 4: Generate Teams Card JSON
Claude writes a complete Adaptive Card JSON payload to logs/YYYY-MM-DD-card.json. This is the exact file that gets POSTed to the Teams webhook -- no parser or transformation sits between the AI output and Teams. The card includes a styled header, TL;DR bullets, topic sections, and an action button linking to the full Notion page.
Here is what a card looks like in Teams: And in Slack:
Topic Coverage
Logs
Location
All logs are stored in the logs/ directory within the project:
Additionally, the logs/YYYY-MM-DD-card.json file contains the raw Adaptive Card JSON generated by Claude for Teams notifications.
Reading logs
macOS:
cat ~/ai-news-briefing/logs/$(date +%Y-%m-%d).log
tail -f ~/ai-news-briefing/logs/$(date +%Y-%m-%d).log
Windows:
Get-Content "$env:USERPROFILE\ai-news-briefing\logs\$(Get-Date -Format 'yyyy-MM-dd').log"
Get-Content "$env:USERPROFILE\ai-news-briefing\logs\$(Get-Date -Format 'yyyy-MM-dd').log" -Wait
Auto-cleanup
Logs older than 30 days are automatically deleted at the end of each run on both platforms. The macOS-specific launchd-stdout.log and launchd-stderr.log files are not date-stamped and may need periodic manual cleanup.
Tests
460 non-blocking bash tests across 7 suites (plus 91 PowerShell tests and an offline Python eval-harness suite) verify syntax, structure, arg handling, template substitution, card JSON, notification error paths, Obsidian publishing, cross-platform portability, and every utility-script contract. No external services are called.
# All bash tests (macOS / Linux / Git Bash)
bash tests/run-all.sh
# Individual suites
bash tests/test-bash-only-scripts.sh
bash tests/test-utility-scripts.sh
bash tests/test-daily-brief.sh
bash tests/test-custom-brief.sh
bash tests/test-obsidian.sh
bash tests/test-notifications.sh
bash tests/test-portability.sh
# PowerShell (Windows)
powershell -ExecutionPolicy Bypass -File tests\test-all.ps1
Auto-discovery: tests/run-all.sh runs every tests/test-*.sh it finds, so dropping a new suite into tests/ wires it in automatically.
Full documentation: TESTS.md
Quality Eval Harness
Every published briefing is silently judged by an LLM-as-judge on a 5-axis rubric so we can detect quality drift before readers notice it. The harness lives in eval/ and is fully offline-testable via a stub backend that exercises the full pipeline without burning API credits.
Axes (composite = weighted mean):
Pipelines provided:
- Score —
make eval D=YYYY-MM-DD JUDGE=claudewrites a row toeval/store.sqlite. - Backfill —
make eval-backfillscores every card underexample-cards/. - Regression —
make eval-regressionre-scores the golden set ineval/golden/and fails if any card drops more than 0.5 composite points vs. its pinned baseline. - Drift —
make eval-drift D=YYYY-MM-DD ALERT_EXIT=1alerts when the trailing-7d median falls more than 1.5 MADs below the trailing-30d median for two consecutive days. - Report —
make eval-report D=YYYY-MM-DD W=7emits a Markdown weekly digest. - Interactive dashboard —
make eval-dashboard OPEN=1buildseval/dashboard/index.html, a single-file offline UI with trend, axis radar, composite histogram, per-card stacked bars, and a sortable/filterable card table backed byeval/store.sqlite+eval/golden/. - Publish gate (optional) — invoke
runner.py score --gate --gate-threshold 3.0ahead of the publish step to block low-quality briefings. Judge backends shell out to the existing CLIs (claude/codex/gemini) so no new auth is required. Default judge model isclaude-haiku-4-5-20251001(~$0.002/card). The store schema is keyed on(card_date, prompt_version, judge_model), so bumping the rubric or switching judges keeps history rather than overwriting it.
Full documentation: eval/README.md.
Troubleshooting
"Claude Code cannot be launched inside another Claude Code session"
This error occurs when the CLAUDECODE environment variable is set, which happens if you trigger the script from inside a Claude Code terminal session. Both briefing.sh and briefing.ps1 unset this variable automatically, but if you see this error:
- Make sure you are running the briefing from a regular terminal, not from within Claude Code.
- Verify the entry point script contains the
unset CLAUDECODE/$env:CLAUDECODE = $nullline.
Scheduled task does not run at the expected time
macOS (launchd):
- Mac was asleep at 8 AM: The job is registered with both
StartCalendarInterval(8 AM) andStartInterval(every 30 min). If the Mac sleeps through 8 AM, launchd fires the missed interval on the next wake, andbriefing.sh --catchupruns that day's briefing as long as it is at/after 08:00 and the briefing has not already run. So a sleep-through-8 AM is covered automatically on the next wake the same day. - Mac stayed asleep until a later day: The missed day is treated as gone --
--catchupalways targets the current date and never back-fills. Whenever the Mac next wakes (past 08:00) it runs that day's briefing only. - Already ran today: Catch-up exits immediately if
logs/YYYY-MM-DD-card.jsonalready exists, so the 30-min interval never double-posts. - Powered off at scheduled time: Same as above -- the job runs once on next boot/wake for the current day; earlier days are skipped.
- Agent not loaded: Verify with
launchctl list | grep ainews. If missing, reload the plist. - Path issues: The plist sets a custom
PATHandHOME. If Claude is installed in a non-standard location, update thePATHin the plist.
Windows (Task Scheduler):
- Machine was off/asleep:
StartWhenAvailableis enabled, so the task runs as soon as the machine wakes or the user logs in. - Task not registered: Verify with
schtasks /query /tn AiNewsBriefing. If missing, re-runinstall-task.ps1. - Execution policy: The task action uses
-ExecutionPolicy Bypass. If this is overridden by group policy, contact your IT admin or runbriefing.ps1manually.
Run succeeds but no Notion page appears
- Check that the Notion MCP is configured in Claude Code's MCP settings.
- Verify the data source ID in
prompt.mdmatches a database your Notion integration has access to. - Look at the log output -- Claude typically prints a Notion URL on success.
Budget exceeded
If the log shows the run stopped mid-way, the --max-budget-usd cap may have been reached. Increase the budget in the entry point script or switch to a cheaper model.
Multiple runs in the same day
Running the briefing multiple times in a day updates the existing Notion page rather than creating a duplicate. The agent checks for an existing page during Step 0b and updates it if found. Logs append to the same date-stamped file, so all runs for a given day are captured in one log.
Out of quota / CLI unavailable
If the configured engine is unavailable (not installed, quota exceeded, or authentication expired), the system handles it differently depending on the mode:
- Daily briefing (automatic fallback): When
AI_BRIEFING_CLIis not set, the entry script tries each engine in order:claude→codex→gemini→copilot. If an engine is not found onPATH, it is skipped. If all engines fail, the run is logged as a failure. - Daily briefing (explicit engine): When
AI_BRIEFING_CLIis set to a specific engine, only that engine is tried. If it fails, no fallback occurs and the run is logged as a failure. - Custom brief: In interactive mode, the REPL shows which engines are available (✓/✗) so you can pick one that works. In non-interactive mode, pass
--cli <engine>to choose explicitly.
To see which engines are installed on your machine:
make info
Cost Estimate
With the default configuration (opus model, 9 topics):
Actual costs vary based on the volume of news, number of search queries, and briefing length. The --max-budget-usd 2.00 cap ensures no single run exceeds $2.00.
Project Structure
ai-news-briefing/
├── index.html # Landing page / project wiki
├── wiki/ # Landing page assets
│ ├── style.css # Styles
│ └── script.js # Interactions
├── Makefile # Cross-platform task runner (45 targets)
├── scripts/ # Utility scripts (21 sh+ps1 pairs + 12 bash-only)
│ │ # ── Pipeline ops (cross-platform pairs) ────────────────────
│ ├── health-check.sh/.ps1 # Verify full setup
│ ├── log-summary.sh/.ps1 # Summarize recent runs
│ ├── log-search.sh/.ps1 # Search across all logs
│ ├── dry-run.sh/.ps1 # Test without writing to Notion
│ ├── test-notion.sh/.ps1 # Test Notion MCP connectivity
│ ├── cost-report.sh/.ps1 # Estimate API costs from logs
│ ├── export-logs.sh/.ps1 # Archive logs to tar.gz/zip
│ ├── backup-prompt.sh/.ps1 # Version and restore prompt.md
│ ├── topic-edit.sh/.ps1 # Add/remove/list topics
│ ├── update-schedule.sh/.ps1 # Change daily run time
│ ├── notify.sh/.ps1 # Send native OS notifications
│ │ # ── Delivery (cross-platform pairs) ─────────────────────────
│ ├── notify-teams.sh/.ps1 # Post briefing to Microsoft Teams
│ ├── notify-slack.sh/.ps1 # Post briefing to Slack
│ ├── publish-obsidian.sh/.ps1 # Publish briefing to Obsidian vault
│ ├── test-obsidian.sh/.ps1 # Test Obsidian vault connectivity
│ ├── teams-to-slack.py # Convert Teams Adaptive Card → Slack Block Kit
│ ├── build-teams-card.py # Legacy card builder (not used in current flow)
│ │ # ── Eval harness (cross-platform pairs) ─────────────────────
│ ├── eval-summary.sh/.ps1 # Print eval store summary (median, drift, gates)
│ ├── eval-watch.sh/.ps1 # Tail eval scores as they land
│ ├── eval-compare.sh/.ps1 # Compare two judges over a date range
│ │ # ── Plugin authoring (cross-platform pairs) ─────────────────
│ ├── plugin-validate.sh/.ps1 # Lint plugins + Gemini extensions
│ ├── scaffold-plugin.sh/.ps1 # Bootstrap a new claude-plugins/<n>
│ │ # ── Bash-only utilities (Unix only) ─────────────────────────
│ ├── stats.sh # Project state overview (LOC, files, plugins)
│ ├── shell-lint.sh # bash -n + shellcheck wrapper for all .sh
│ ├── mcp-doctor.sh # Diagnose MCP server config (Claude/Codex/Gemini/Copilot)
│ ├── render-card.sh # Pretty-print a daily Adaptive Card to terminal
│ ├── brief-diff.sh # Diff two daily briefings (with delta/colordiff)
│ ├── prune-artifacts.sh # Remove orphaned card/obsidian/dry-run artifacts
│ ├── open-brief.sh # Open log/card/obsidian/Notion via open/xdg-open
│ ├── bench-cli.sh # Benchmark installed AI CLIs (wall-clock + size)
│ ├── weekly-digest.sh # N-day rollup: success, engine mix, cost, topics
│ ├── topic-stats.sh # Tally [[wikilink]] frequency across briefings
│ ├── git-hooks-install.sh # Install pre-commit hook (bash -n + plugin-validate)
│ ├── quiet-hours.sh # macOS launchctl pause/resume for the daily job
│ ├── README.md # Full scripts/ reference (this dir's deep-dive)
│ └── uninstall.sh/.ps1 # Full cleanup and removal
├── briefing.sh # Daily briefing entry point (bash)
├── briefing.ps1 # Daily briefing entry point (PowerShell)
├── prompt.md # Daily briefing agent prompt
├── custom-brief.sh # Custom topic briefing entry point (bash)
├── custom-brief.ps1 # Custom topic briefing entry point (PowerShell)
├── prompt-custom-brief.md # Custom briefing deep research prompt
├── commands/
│ ├── ai-news-briefing.md # Claude Code skill: daily briefing
│ └── custom-brief.md # Claude Code skill: custom topic briefing
├── com.ainews.briefing.plist # macOS launchd schedule definition
├── install-task.ps1 # Windows Task Scheduler installer
├── tests/ # 460 non-blocking bash tests + 91 PowerShell tests
│ ├── run-all.sh # Bash test runner (auto-discovers test-*.sh)
│ ├── test-bash-only-scripts.sh# 164 tests: 12 bash-only utilities (stats, lint, doctor, render-card, ...)
│ ├── test-utility-scripts.sh # 79 tests: eval-summary/watch/compare, plugin-validate, scaffold-plugin
│ ├── test-daily-brief.sh # 88 tests: daily briefing prompt + entry scripts
│ ├── test-custom-brief.sh # 56 tests: custom brief args + template
│ ├── test-obsidian.sh # 30 tests: vault simulation + wikilink stubs
│ ├── test-portability.sh # 26 tests: bash 3.2 compat, awk, date, ANSI
│ ├── test-notifications.sh # 17 tests: Adaptive Card + Slack converter
│ └── test-all.ps1 # 91 PowerShell tests (Windows parity)
├── logs/ # Run logs (git-ignored)
├── backups/ # Prompt backups (git-ignored)
├── eval/ # Quality eval harness (LLM-as-judge)
│ ├── README.md # Harness documentation
│ ├── rubric.md # 5-axis rubric + weights + thresholds
│ ├── judge_prompt.md # Versioned judge prompt
│ ├── schema.sql # SQLite schema for eval_runs
│ ├── extract.py # Adaptive-card JSON -> text/headlines/URLs
│ ├── judge.py # Backends: stub/claude/codex/gemini
│ ├── store.py # Upsert + fetch + composite formula
│ ├── runner.py # CLI: score / backfill / regression / show
│ ├── drift.py # Trailing-window drift detector
│ ├── report.py # Weekly Markdown report builder
│ ├── seed_golden.py # Re-baseliner: lift store rows to golden/
│ ├── export_dashboard.py # Export store + golden -> dashboard/data.js
│ ├── golden/ # Pinned baseline composites per card
│ ├── dashboard/ # Interactive offline HTML dashboard
│ │ ├── index.html # Chart.js trend + radar + histogram + table
│ │ └── data.js # Generated from store.sqlite (window.EVAL_DATA)
│ └── tests/ # Unit tests for the harness
├── .gitignore
├── ARCHITECTURE.md # Detailed architecture documentation
├── E2E_FLOW.md # End-to-end pipeline walkthrough
├── CUSTOM_BRIEF.md # Custom topic briefing documentation
├── TESTS.md # Test suite documentation
├── LOGS.md # Log tailing and management guide
├── SETUP.md # Full setup guide
├── NOTIFY_TEAMS.md # Teams integration setup guide
├── NOTIFY_SLACK.md # Slack integration setup guide
└── README.md # This file
Author
Created by Son Nguyen -- AI researcher and developer focused on building tools that empower people to harness the power of AI in their daily lives.
Thanks for checking out the project! If you have any questions, suggestions, or want to contribute, feel free to open an issue or submit a pull request.