← Back to AAI for MerusCase

Schedule Brief

The skill that turns the morning brief from a typed command into a passive feed. Cron job at 7:00 AM, macOS Launch Agent, or a shell script you can wire into anything — the brief shows up in a file or your inbox every morning before you sit down. Recipes for Mac, Linux, and Windows. Doesn’t auto-install anything; gives you the exact commands so you can review before running.

The example paths, email addresses, and times in this page are demonstration data. Substitute your own when copying the recipes.

On this page

What it is

At the prompt:

aaicase> schedule brief
aaicase> email me the brief
aaicase> auto brief

The skill prints the recipe for your platform — cron line, LaunchAgent plist, Task Scheduler command — and tells you exactly what to do with it. It does not run the recipe for you. You copy, paste, and execute manually so nothing gets installed in the background that you didn’t see.

Once installed, the morning brief runs automatically at the scheduled time. Output goes to ~/.aaicase/exports/ by default; with a small modification you can email it to yourself, post to a Slack webhook, or pipe to anywhere you want.

Why the skill doesn’t auto-install

AAI does not modify your crontab, install LaunchAgents, or register Task Scheduler jobs without you running the commands yourself. The skill is intentionally a recipe printer, not an installer.

Reasoning:

This is the rule across AAI’s system-touching skills: print the command, explain what it does, let the attorney run it.

Option 1: Cron (Mac/Linux/servers)

The simplest option. Works on macOS, Linux, and any Unix-like system. Edit your crontab:

crontab -e

Add this line (runs Monday–Friday at 7:00 AM):

0 7 * * 1-5 /usr/local/bin/aaicase -p "morning brief" > ~/.aaicase/exports/daily-brief-$(date +\%Y\%m\%d).md 2>&1

Breakdown:

The \% escapes are required — % in crontab is a special character that means “end of command + standard input.” Without escaping, the date +%Y%m%d portion would truncate the line.

Option 2: macOS Launch Agent

The macOS-native way. Create ~/Library/LaunchAgents/com.aaicase.brief.plist:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
  "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Label</key>
    <string>com.aaicase.brief</string>

    <key>ProgramArguments</key>
    <array>
        <string>/usr/local/bin/aaicase</string>
        <string>-p</string>
        <string>morning brief</string>
    </array>

    <key>StandardOutPath</key>
    <string>/Users/YOU/.aaicase/exports/daily-brief.md</string>

    <key>StartCalendarInterval</key>
    <dict>
        <key>Hour</key>
        <integer>7</integer>
        <key>Minute</key>
        <integer>0</integer>
    </dict>
</dict>
</plist>

Load it:

launchctl load ~/Library/LaunchAgents/com.aaicase.brief.plist

Advantages over cron on macOS:

Substitute /Users/YOU with your actual home directory. If aaicase is installed somewhere other than /usr/local/bin, update ProgramArgumentswhich aaicase tells you the right path.

Option 3: Windows Task Scheduler

Windows users can use Task Scheduler from the GUI or PowerShell:

$Action = New-ScheduledTaskAction `
  -Execute "aaicase" `
  -Argument '-p "morning brief"' `
  -WorkingDirectory "$env:USERPROFILE\.aaicase\exports"

$Trigger = New-ScheduledTaskTrigger `
  -Daily -At 7am

$Settings = New-ScheduledTaskSettingsSet `
  -StartWhenAvailable

Register-ScheduledTask `
  -TaskName "AAICASE Morning Brief" `
  -Action $Action `
  -Trigger $Trigger `
  -Settings $Settings

The PowerShell version captures the brief into the working directory but doesn’t pipe to a date-stamped file (PowerShell’s redirection syntax is different from bash). Wrap it in a small .ps1 script if you want per-day output files.

Option 4: Wrapper scripts — multi-skill morning reports

For attorneys who want more than just the brief, wrap multiple skills in a script and schedule the script instead of aaicase directly. Example daily-report.sh:

#!/bin/bash
DATE=$(date +%Y%m%d)
DIR=~/.aaicase/exports
mkdir -p "$DIR"

echo "=== MORNING BRIEF ===" >  "$DIR/report-$DATE.md"
aaicase -p "morning brief"   >> "$DIR/report-$DATE.md"

echo -e "\n=== DEADLINES THIS WEEK ===" >> "$DIR/report-$DATE.md"
aaicase -p "what deadlines this week" >> "$DIR/report-$DATE.md"

echo -e "\n=== STATUS ==="    >> "$DIR/report-$DATE.md"
aaicase -p "status"           >> "$DIR/report-$DATE.md"

echo -e "\n=== WHICH CASES NEED ATTENTION ===" >> "$DIR/report-$DATE.md"
aaicase -p "which cases need attention"          >> "$DIR/report-$DATE.md"

echo "Full report: $DIR/report-$DATE.md"

Make it executable (chmod +x daily-report.sh), then schedule it instead of aaicase directly. The result is a single Markdown file each morning with brief + this-week deadlines + status + attention-list in one document.

Emailing the brief to yourself

Pipe to mail instead of (or in addition to) writing to a file:

0 7 * * 1-5 /usr/local/bin/aaicase -p "morning brief" | \
  mail -s "Morning Brief $(date +\%m/\%d)" attorney@aai.dev

Requires mail command configured on the machine (most Macs and Linux servers have mail via Postfix or sendmail; check with which mail).

For richer formatting, pipe to a small script that wraps the output in HTML and sends via the firm’s preferred mail relay or SMTP:

0 7 * * 1-5 /usr/local/bin/aaicase -p "morning brief" | ~/.aaicase/scripts/email-brief.sh

The script is the attorney’s to write — SMTP config varies enormously by firm and isn’t something AAI can prescribe.

Picking a time

The morning brief is the typical use case but the time depends on the attorney’s habit:

Use caseRecommended timeCron line prefix
Read with morning coffee6:30 or 7:00 AM0 7 * * 1-5 (7:00 weekdays)
On laptop before commute5:30 or 6:00 AM30 5 * * 1-5
Before lunch (afternoon brief)11:00 AM0 11 * * 1-5
End of day recap (yesterday)5:00 PM0 17 * * 1-5 — use what changed today instead
Weekend cleanupSunday afternoon0 14 * * 0

Multiple schedules are fine — one for the morning brief, one for the end-of-day what-changed-today, one for the Friday this-week deadlines run. Each gets its own line in crontab or its own plist.

Disabling or removing the schedule

MethodDisableRemove
CronComment out the line in crontab -eDelete the line in crontab -e
LaunchAgentlaunchctl unload ~/Library/LaunchAgents/com.aaicase.brief.plistUnload first, then delete the .plist file
Windows Task SchedulerRight-click task → DisableUnregister-ScheduledTask -TaskName "AAICASE Morning Brief"

Verify removal: crontab -l | grep aaicase should show nothing; launchctl list | grep aaicase should show nothing.

Authentication considerations

Scheduled runs need the same Merus token the interactive aaicase uses. The token is stored in ~/.aaicase/config.json on the user account that ran aaicase --setup.

If the cron job runs as a different user (e.g. via sudo crontab -e or a system-wide crontab), it won’t find the token. Always install the cron line in the user’s own crontab (crontab -e without sudo) so it inherits the same home directory.

Claude authentication is via the Anthropic API (browser-based on first run, then cached). If the cache expires, the scheduled job will fail until the attorney re-authenticates interactively. Schedule a manual re-auth quarterly if you want to avoid silent failures.

Troubleshooting

The cron job runs but produces no output

Most likely a PATH issue. Cron runs with a minimal PATH that may not include /usr/local/bin or /opt/homebrew/bin where aaicase lives. Use the full path to the aaicase binary in the cron line (which aaicase tells you).

“Merus token not found” in the output

The cron job is running as a different user than the one that ran aaicase --setup. Run the cron as your own user (not root), or copy the token file to the cron-running user’s home (not recommended — copies of tokens proliferate the risk).

The brief produces empty output

Probably an authentication issue with either Merus or Claude. Try running the exact command manually in a terminal (aaicase -p "morning brief"); if it works there but fails in cron, the difference is environment. Check env output between a regular shell and the cron environment.

LaunchAgent doesn’t fire

Common causes: laptop was asleep at the scheduled time (LaunchAgent doesn’t wake the system), the plist has a typo (use plutil -lint ~/Library/LaunchAgents/com.aaicase.brief.plist to validate), or the agent wasn’t loaded after the .plist was created (run launchctl load).

The output file is being overwritten daily

Both the cron and LaunchAgent recipes append to the same filename. If you want per-day files, use the date-stamped form in the cron line (daily-brief-$(date +\%Y\%m\%d).md), or wrap the LaunchAgent in a small shell script that handles the date suffix.

Output has terminal color codes

aaicase’s interactive mode uses ANSI color escapes. The -p one-shot mode typically suppresses them, but if you see \x1b[ in the output file, pipe through sed to strip:

aaicase -p "morning brief" | sed 's/\x1b\[[0-9;]*m//g' > brief.md

Part of AAI for MerusCase — code-guarded AI case intelligence for California Workers’ Comp attorneys.