/openfoia:foia-investigatefrom openfoia
Opens a FOIA investigation case: searches DocumentCloud and other sources, fetches records, reads passages for key terms, records cited findings with tiered notes, links entities, exports a report, and optionally drafts a FOIA request.
Ships in openfoia. Installing the plugin adds it to Claude Code.
Investigate: $ARGUMENTS
The argument is a claim ("the PAS was given to schoolchildren") or a topic ("Palantir contracts, El Cajon"). Turn it into one question and keep every step inside one case.
Before any network call, say in one sentence which source will see the query from the user's real IP, and get a go-ahead once per source.
Open the case
openfoia case new "<short question>" -d "<the claim as stated>"
Search, then triage. Start with DocumentCloud (it mirrors the CIA CREST archive); add other sources when the topic calls for them.
openfoia records search "<phrase>" -s documentcloud -n 100 --json --rank <keyword,keyword>
Save the output to hits.json. Run two or three phrasings and the names that appear in the first hits. Show the user the top ranked hits and ask which to fetch; if they say "all", fetch all.
Fetch into the case
openfoia records fetch --from hits.json
Report fetched / skipped / failed and name any failures.
Read every passage for the key terms. This is the investigation.
openfoia docs grep '"<key phrase>"' -C 300
openfoia docs grep '<term> OR <term> OR <term>' -n 200
Open full pages with openfoia docs show <doc-id> --page N when a passage needs context. Do not conclude until you have read the passages for every key term.
Record findings as you go, with the tier kept honest.
openfoia docs grep '"<phrase>"' --save --note "<what this shows>"
openfoia case note "<finding>" --doc <id> --page N --quote "<verbatim>" --tier says
openfoia case note "<inference>" --tier infer
Link entities (offline tiers unless the user wants the LLM)
openfoia analyze extract <doc-id> --tier gliner
openfoia analyze graph --name <slug> --no-text --view
openfoia analyze graph --mentions "<A>" "<B>"
Export and write up
openfoia case export -f md -o report.md
Lead with the verdict (found, not found, partly found), then what was searched (sources, phrasings, document count), the hits with document id and page, the dead ends, and what a FOIA request could close. Keep "the document says", "reasonable inference" and "speculation" in separate paragraphs. If a source failed, say so; a dead source is not a null result.
Offer the FOIA draft when a named gap exists:
openfoia template generate standard -a <agency> -s "<records sought>" -n "<name>" -e <email> -o draft.txt
What the command file sets; muted values are Claude Code's defaults
foia, investigation, document-search, case-management, report-generation
7-day visitors to each command page
npx claudepluginhub jordancoin/openfoia --plugin openfoia4 commands in this plugin
/foia-graphStep-by-stepBuild or open an investigation graph from extracted entities/foia-installStep 1 — Check what's already thereInstall or initialize the openfoia CLI — bootstraps everything the plugin needs to function/foia-searchFoia SearchSearch DocumentCloud, MuckRock, OpenCorporates, and SEC for existing records on a topic before filing a new FOIAOther plugins' commands for the same job