/workflows:court-docketsfrom workflows
Retrieves court filings (complaints, docket entries, opinions) from Lex Machina, Docket Alarm, and Bloomberg Law using live browser sessions. Includes resumable harvest scripts and per-vendor endpoint quirks.
Ships in workflows. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
What this skill carries — grep references/ for any subject the names below miss:
!d=${CLAUDE_SKILL_DIR}; command -v skill-toc >/dev/null 2>&1 && exec skill-toc "$d"; s=$HOME/.claude/skills/plugin-utils/bin/skill-toc; [ -x "$s" ] && exec "$s" "$d"; echo "(skill-toc unavailable: references and scripts are NOT listed here — install the plugin-utils plugin, or start a new session so its bin/ reaches PATH)"
Three commercial platforms, one job: turn a list of cases into a directory of PDFs plus a manifest you can defend. Verified end to end on 1,597 Delaware Chancery cases — ~4,000 documents retrieved across all three.
Auth is the user's live browser session on CDP 9222. None of these needs a password. Read the
cookie with scripts/lm_cookie.py; never log in, and never touch stored credentials unless the
user explicitly says to.
Full endpoint chains, request/response shapes and per-vendor quirks:
${CLAUDE_SKILL_DIR}/references/endpoints.md — read it before writing any fetch code.
Do not hand-roll a harvester. These are working, resumable and manifest-writing:
| script | does |
|---|---|
scripts/lm_cookie.py | reads the live session cookie for any host over CDP |
scripts/harvest_complaints.py | Lex Machina: docket-search → tag-257 complaint → signed PDF |
scripts/da_grab.py | Docket Alarm: serial, boring, survives hanging documents |
scripts/fetch_opinion_pdfs.py | opinion/decision PDFs from a plan parquet |
scripts/bl_docket_list.py | Bloomberg Law: every docket matching facets + term, as a list (no PDFs) |
Copy them into the project and adapt. Rewriting from the reference doc reproduces bugs that took hours to find.
## The Iron Law of Identification vs RetrievalA document that is IDENTIFIED is not a document that is RETRIEVED. Never mark a substitute ok.
Every vendor names the complaint far more often than it serves the file. Measured on the same 1,597 cases: Lex identified 99.6% and served 81.0%; Docket Alarm identified 96.4% and served 81.7%. A fallback that takes "the first document that has a file" silently returns a Rule 5.1 certification, a cover letter or a verification page — and reports success.
Conflating the two overstates coverage by 15-20 points. That is not a rounding error: it is a fabricated denominator under every downstream rate, and shipping it is more harmful than returning nothing, because nobody downstream can see it happened.
## The Iron Law of AbsenceNever record a document as unavailable because YOUR SELECTION RULE failed. Enumerate the docket entries and look for a later substantive version before concluding it is not public.
This is the mirror of the law above. That one catches substitutes passed off as complaints; this one catches real complaints recorded as absent — and it is the more expensive failure, because a substitute is visible in the data while an absence looks like a fact about the world.
Delaware Chancery files the complaint confidentially, then files a redacted PUBLIC VERSION days later as a SEPARATE docket entry (Ct. Ch. R. 5.1). Every vendor rule that stops at the first complaint-tagged entry sees no document and reports failure. The public version sits typically around entry 10-15, measured as deep as entry 91, on dockets running to 277 entries.
Measured on two independent Delaware populations:
| population | "unavailable" cases | had a public version | rate |
|---|---|---|---|
| DGCL 220 complaints | 253 | 229 | 90.5% |
| fiduciary-duty follow-on suits | 80 | 73 | 91.2% |
Recovering them moved coverage 82.2% -> 95.3% and added 195 confirmed cases to a study population. The pre-recovery write-up asserted "~18% of complaints are not publicly retrievable — a finding about practice, not a collection defect." That sentence was wrong in both halves.
The correct statement is "~18% are filed confidentially, and ~90% of those are publicly available as a redacted version elsewhere on the same docket." Genuine unavailability is ~4%.
Public Version of Answer to Verified Complaint and Motion to Extend Deadline to File Public Version of the Verified Complaint both contain "public version" and "complaint". Requiring only those two terms
returned the wrong document on 10.6% (23/218) and 10.0% (7/73) of cases across two
populations — a stable rate, so expect it. Exclude answer|affirmative defense|motion|letter| certificat|opposition|brief|reply|response|stipulation|notice|transcript|order.already_present, because the wrong document
from the first pass sat on disk under the same name. Quarantine before re-fetching.Redaction does not degrade extraction. Measured on the recovered set: misconduct_category,
plaintiff_law_firm and requester_type all came back at 0% missing, identical to the
unredacted baseline. Captions, parties, statutory citations, prayer for relief and signature
blocks survive; body allegations may be blacked out. Carry a source flag and check the
not_stated rate before using them for content coding.
scripts/bl_docket_list.py collects the docket LIST (ids, parties, judge, case type) for any
facet + term search, sliced past both silent caps and asserted equal to the API's remote_count.
Run --discover first to learn the facet codes (Nevada=29, Clark=84, Washoe=85), then
--count-only, then collect; --csv adds the 41-column export and asserts its id set matches.
Flags and examples are in the script header.
--term is sent verbatim, and quoting changes the result set: "Business Court" returns
3,690 dockets, Business Court 17,180. Write the quoted form into the project's methods note.
files[] on ~18.7% of cases (298/1,597) —
which means it was filed confidentially, NOT that it is unavailable; see the Iron Law of
Absence above. The
document id and title are present; only the file is withheld. That is file_withheld, a
recoverable fact worth recording — not "not found", and not a reason to substitute another
document.ThreadPoolExecutor.map is indistinguishable from a deadlocked process. Use a
45-90 s timeout.accessToken is HttpOnly with an ~8 minute TTL, refreshed by the page's own SPA
on a timer — not by your requests. The tab must stay open; a cookie snapshot into any external
store authenticates for minutes, not hours.remote_count and date-slice below the cap.fetch() in a logged-in tab. Per-docket pages are fine outside. Do not fight it.Memorandum Opinion; the
grant/deny is inside the PDF. Only ~15/152 opinion entries mention an outcome word at all.Granted ([Proposed] Order Implementing the Court's Post-Trial Bench Ruling). Searching only
for Memorandum Opinion / Letter Decision missed 34% of cases with a decision (169 found
vs 257 that exist). Always include: final report, master's report, post-trial ruling,
bench ruling, opinion and order, final order and judgment.| About to | Why wrong | Do instead |
|---|---|---|
| About to record a complaint as unavailable because the first entry has no file | The Rule 5.1 public version sits further down the docket ~90% of the time | Enumerate the entries and search for a later substantive version |
| Matching a public version on "public version" + "complaint" | Also matches answers, motions and briefs ABOUT the complaint — 10% wrong-document rate on two populations | Exclude answer/motion/brief/letter/certificate terms |
| Re-fetching after a selection fix without clearing the old files | A filename-keyed resume guard reports already_present and keeps the known-bad document | Quarantine, then re-fetch |
| Report "session expired" because the cookie read came back empty | An empty cookie name (['']) is a parsing failure, not an absent session. Picking the first CDP page target returns nothing when that tab is blob:/chrome:// — this cost hours and triggered a needless credential hunt | Use scripts/lm_cookie.py, which selects a page on the requested host; verify by fetching one document |
Pin the session cookie into a Cookie: header | It goes stale mid-run when the vendor rotates it, and the resulting 401s look exactly like rate limiting | Put cookies in the requests cookie jar; re-read from the browser on a 401 |
| Retry a Docket Alarm HTTP 500 | Reproducible "document not held"; the backoff dominates the run | Record it and move on |
Take documents[0] when no title matches the entry text | That is how a sealing motion becomes a "complaint" | Mark is_substitute, never ok |
Run pdftotext/pdfinfo inside the download loop | A long timeout on one malformed PDF stalls a worker and looks like a hang | Compute page/text metrics in a post-pass |
kill $! after setsid, or pkill -f a pattern matching your own shell | Kills the wrong PID and leaves crawlers running — three concurrent copies hit one vendor this way | ps -eo pid,cmd | awk '/[d]a_grab/' then kill the real pid |
| Trust a vendor's case-type tag as ground truth | Tags put a judicial letter, a §225 petition and a notary page in a books-and-records population | Screen from the document text |
| Conclude coverage is complete without checking the whole population | Every widening of the net raised the count: 6.5% → 10.7% → 16.1% written decisions | Scan all cases, all document-type spellings |
references/endpoints.md (opens in a new tab)scripts/bl_docket_list.py (opens in a new tab)scripts/da_grab.py (opens in a new tab)scripts/fetch_opinion_pdfs.py (opens in a new tab)scripts/harvest_complaints.py (opens in a new tab)scripts/lm_cookie.py (opens in a new tab)tests/test_bl_docket_list.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Claude Code refuses to install this plugin
As a github or url source: Failed to clone repository: fatal: clone of '[email protected]:edwinhu/bmll-skill.git' into submodule path 'skills/bmll' failed
Checked against Claude Code 2.1.332's install rules. The listing below is what the repository ships; Claude Code cannot install it as published.
86 skills in this plugin
/afkUse when the user says '/afk', 'afk', 'going to bed', 'I'm going to sleep', 'work autonomously', 'work on this overnight', 'don't ask me questions', 'while I'm away', or 'do whatever you think is best'. NOT for questions about overnight returns, rates or anything financial; NOT for asking how the mode works./ai-anti-patternsALWAYS load before finalizing ANY written prose, and whenever text is suspected of being machine-written - "does this sound like AI", "make this sound human", "clean up the AI-isms", "did a bot write this", "check this draft before I send it", "review this for AI tells", "this reads like ChatGPT", "review this for mannered prose", "is this too writerly", "is this student paper AI-generated", or before handing back any draft, memo, email, or article you wrote. Use proactively even if the user never mentions AI writing./batch-routerUse when the user says 'bulk LLM job', 'batch job', 'submit a batch job', 'run this prompt over all the documents', 'process thousands of PDFs', 'extract fields from every filing', 'code each filing', 'label / annotate these documents', 'hand-code these', 'have agents read each document', 'which batch provider', 'cheapest way to run this over N rows', 'spend my API credits', 'Claude or OpenAI or Gemini for this batch', or needs any per-row LLM extraction, classification or enrichment over many inputs./bib-manageALWAYS use when a manuscript's BIBLIOGRAPHY is the thing being fixed, or when a cite's PDF turns out to be wrong — 'link my bib entries to the PDFs', 'which sources am I missing a PDF for', 'audit my sources.bib', 'my bib entry has no file field', 'fetch the Federal Register PDFs', 'why can't pincite find this source'. WRONG FILE: 'is this PDF the published version or the preprint', 'this PDF is a book review, not the book', 'the file field points at the wrong paper', 'the PDF doesn't match the citation'. METADATA: 'reconcile my bib against Paperpile', 'these entries were extracted by a model, check them', 'fix the metadata in sources.bib', 'my bib has no DOIs and the fields look wrong', 'pull the real author/journal/volume from my library', 'where did this bib entry's metadata come from'. PAGE RANGES: 'does my bib have page ranges', 'my bib only has start pages', 'backfill the page ranges', 'pull the pages from the DOI', 'add DOIs to my bibliography'. Use proactively before any pincite run — pincite resolves footnotes through `file = {...}` and silently skips entries that lack one. NEGATIVE ROUTING: the page number inside a footnote is pincite, but whether that footnote's PDF is the version of record or the wrong document is THIS skill, mid-pincite-run included; whether a cited source says what the footnote claims is source-verify; Bluebook FORM is bluebook or bluebook-audit; finding or downloading a paper is fetch-paper or paperpile./blaw-edgar-searchUse when the user wants to search SEC filings or exhibits on Bloomberg Law — 'search EDGAR on Bloomberg Law', 'BLAW EDGAR search', 'find exhibits with this clause', 'which 8-Ks attach a consulting agreement', 'pull the Bloomberg Law results list', 'capture the BLAW results' — or needs exhibit-level phrase search with proximity operators that the SEC and WRDS full-text routes handle badly./bluebookALWAYS use for ANY legal citation question, even if the user never says 'Bluebook' - 'cite this case', 'how do I cite a statute', 'is this footnote formatted right', 'id. or supra here', 'cite a law review article', 'what signal goes here', 'format these footnotes', 'short form for this cite', 'block quote this', 'where does the ellipsis go', 'is this quote altered right', or writing or checking any citation or quotation in a legal manuscript. NOT for auditing a whole manuscript's footnotes (use bluebook-audit) and NOT for rendering these rules in Typst (use docx-typst).Other plugins' skills for the same job