Scheduled SEC Analysis with Claude Code
Claude Code can run scheduled tasks using cron skills, combining the OMNI Datastream API with AI-powered analysis on a recurring cadence. In this tutorial you will set up a weekly 13F portfolio comparison report that runs every Friday evening and summarizes how major funds changed their positions.Prerequisites
- An Omni Datastream API key (set as
OMNI_DATASTREAM_API_KEY) - Claude Code installed and authenticated
- Familiarity with Custom Skills (recommended)
- (Optional) Familiarity with the Monitor 13F Holdings tutorial
What you will build
A scheduled Claude Code skill that:- Runs every Friday at 6:00 PM
- Fetches the latest 13F filings for a list of funds
- Compares current holdings to previous quarter
- Generates a summary of new positions, exits, and significant changes
- Saves the report as a Markdown file
Step 1 --- Create the analysis skill
Create a skill file that defines the 13F comparison workflow. Save it as.claude/skills/weekly-13f-review.md in your project:
-
Fetch the previous quarter 13F for comparison:
-
Compare holdings between quarters:
- New positions (in current but not previous)
- Exited positions (in previous but not current)
- Increased positions (shares up >10%)
- Decreased positions (shares down >10%)
-
Calculate portfolio concentration:
- Top 10 holdings by market value
- Percentage of total portfolio in top 10
- Generate a formatted report with sections for each fund.
Output Format
Save the report asreports/13f-weekly-{date}.md with this structure:
Guidelines
- Only flag changes where share count moved more than 10%
- Include dollar values where available
- Note the filing date and period of report for each 13F
- If a fund has not filed a new 13F since last run, note that
weekly-13f-review in the output.
Step 3 --- Test the skill manually
Run the skill once to verify it works:- Call the OMNI Datastream API for each fund
- Compare current and previous quarter holdings
- Generate the report
- Save it to
reports/13f-weekly-2024-12-13.md
Step 4 --- Set up the cron schedule
Create a cron skill configuration to run the analysis on a schedule. Add this to.claude/skills/cron-13f-review.md:
Step 5 --- Configure the environment
Make sure your API key is available to scheduled runs. Add it to your shell profile or a.env file:
.env file in your project root:
Step 6 --- Verify the schedule
Check that the cron skill is registered:Example report output
After the skill runs, you will find a report like this inreports/13f-weekly-2024-12-13.md:
Extending the workflow
Add email delivery
Modify the skill to send the report via email after generation:Add Slack posting
Add a step to post the executive summary to Slack:Compare across quarters
Extend the skill to look at trends over multiple quarters instead of just the most recent change:Troubleshooting
| Problem | Solution |
|---|---|
| Skill not found | Verify the file is in .claude/skills/ and the frontmatter name field is correct. Run claude skill list to confirm. |
| API key not available in cron | Make sure OMNI_DATASTREAM_API_KEY is exported in your shell profile, not just the current session. |
| Report is empty | Check that the CIKs in the watchlist are correct. Test with a single fund first using curl directly. |
| Cron not firing | Verify the cron expression 0 18 * * 5 is correct for your timezone. Check claude skill list --scheduled. |
| Stale data | 13F filings are quarterly. If no new filing has been published since the last run, the report will show no changes. This is expected. |
Next steps
- Add more funds: Expand the watchlist in the skill file with additional CIKs.
- Combine with insider data: Cross-reference 13F changes with insider trading patterns for a complete ownership picture.
- Track specific stocks: Create a variant skill that monitors which funds hold a specific ticker and alerts when ownership changes.