Court Date Watcher
Reads your inbox for court dates and deadlines. Emails you the list, soonest first.
James built this. 20+ years in ops, 3 at Meta. More →
This is a reading aid, not a docketing system. It helps you catch dates that slip past you in the inbox — it does not replace your calendar of record. Keep docketing the way you do today and let this be a second pair of eyes.
A small assistant that reads your email every morning and sends you one list: every court date and deadline it spotted, soonest first. It only sees what lands in your inbox; the alert comes to you, and you act on it. You set it up once, you own it, and it runs on your own Google account.
What you’ll need
- A Gmail / Google Workspace account.
- An Anthropic API key (this is what powers the reading). You add a few dollars of credit once; the running cost is in the table further down.
- A spare half hour and the willingness to copy and paste.
Step 1 — Get your AI key
Go to console.anthropic.com, sign in, open API Keys, and click Create Key. Copy the key it gives you (starts with sk-ant-) and keep it for a minute. Add a small amount of billing credit while you’re there. If you’ve never made an Anthropic account before, this step is most of the build time.
Step 2 — Open the script editor
Go to script.google.com, click New project. Delete the placeholder code already in the box so it’s empty.
Step 3 — Paste this in
Paste the whole block below into the empty editor.
// ============================================================
// COURT DATE WATCHER - by autohmate
// Reads your email each morning, lists court dates & deadlines.
// ============================================================
// 1) PASTE YOUR ANTHROPIC API KEY BETWEEN THE QUOTES:
const API_KEY = "PASTE-YOUR-KEY-HERE";
// 2) IN PLAIN ENGLISH, TELL IT WHAT TO WATCH FOR:
const WATCH_FOR = `
You are reading a lawyer's work email. Flag any message that
mentions a court-related date or deadline, including:
- hearing, trial, or conference dates
- filing or response deadlines
- discovery / disclosure cut-offs and depositions
- statute-of-limitations or limitation-period dates
Capture the date, the matter or client, the court or case
number if given, and what is due.
Ignore newsletters, marketing, and routine admin.
`;
// 3) HOURS TO LOOK BACK EACH RUN (24 = since yesterday):
const LOOKBACK_HOURS = 24;
// ----- leave everything below this line alone -----
function sendCourtDateBrief() {
var cutoff = new Date(Date.now() - LOOKBACK_HOURS * 3600 * 1000);
var query = "in:inbox after:" + Math.floor(cutoff.getTime() / 1000);
var threads = GmailApp.search(query, 0, 50);
var me = Session.getActiveUser().getEmail();
var emails = [];
threads.forEach(function (t) {
t.getMessages().forEach(function (m) {
if (m.getDate() >= cutoff) {
emails.push(
"FROM: " + m.getFrom() +
"\nSUBJECT: " + m.getSubject() +
"\nBODY: " + m.getPlainBody().slice(0, 1200)
);
}
});
});
if (emails.length === 0) {
GmailApp.sendEmail(me, "Court-Date Brief - nothing new",
"No emails matched your criteria today.");
return;
}
var prompt =
WATCH_FOR +
"\n\nList only emails with a court date or deadline, sorted " +
"by that date, soonest first. Each line: DATE - matter/client " +
"- what's due. If a date is ambiguous or relative, say so.\n\n" +
emails.join("\n\n---\n\n");
var res = UrlFetchApp.fetch("https://api.anthropic.com/v1/messages", {
method: "post",
contentType: "application/json",
headers: { "x-api-key": API_KEY, "anthropic-version": "2023-06-01" },
muteHttpExceptions: true,
payload: JSON.stringify({
model: "claude-haiku-4-5-20251001",
max_tokens: 1000,
messages: [{ role: "user", content: prompt }]
})
});
var data = JSON.parse(res.getContentText());
var brief = (data.content && data.content[0])
? data.content[0].text
: "Couldn't generate a brief - check your API key.";
GmailApp.sendEmail(me, "Court-Date Brief - " + new Date().toDateString(), brief);
}Step 4 — Tune it to your practice
The only part that’s really yours is the WATCH_FOR text near the top. Edit it to match how you work. A solo litigator who only wants what’s imminent might write:
Only flag dates in the next 30 days, and only for my active
litigation matters. Ignore scheduling chatter where no firm
date is set yet. If opposing counsel proposes a date that
is not yet confirmed, list it separately under "Proposed".Write it the way you’d brief a new paralegal on their first day. That’s the whole skill.
Step 5 — Paste your key and run it once
Put the key from Step 1 between the quotes on the API_KEY line. Click Save, then Run. Google will ask permission to read and send your mail. Click through Allow (it’s your own account giving your own script access). Check your inbox: you should have a brief.
Step 6 — Make it run every morning
On the left, click the clock icon (Triggers) → Add Trigger. Choose function sendCourtDateBrief, event source Time-driven, type Day timer, and a time like 6–7am. Save. It now runs on its own.
What this version doesn’t do
This is the demo, on purpose. It reads your inbox and lists what it finds, which already saves you a scan every morning. Here’s where an off-the-shelf script stops, and for a lawyer these matter:
- It only reads plain text. The dates that matter most (hearings, filing deadlines, e-service) usually arrive as PDF court notices and attachments. This version walks straight past them.
- It doesn’t watch the court’s calendar. It reads your inbox. A date that never arrives by email never shows up in the list.
- It reads, it doesn’t act. It won’t put anything in your calendar or docketing system. It hands you a list; you enter the dates.
- No confirmation, no redundancy. If the script errors one morning, nothing tells you it didn’t run.
The real build is the part that reads the attachments, pulls the date off the actual notice, and puts it into your calendar or docket with a confirm-before-it-saves step and a check that it actually ran. Auto-entering a court date from an AI-read PDF without a checkpoint is exactly the kind of thing that has to be done properly — that care is what I mean by applied AI. This free version proves the reading works. Making it safe enough to rely on is the conversation.
The real one goes the way every build goes: I learn your week, we agree the target, I ship it, and I check it stuck.
Same deal as everything I build: if it doesn’t land, you don’t pay for it.
Talk to me →