Find every Claude session whose tool calls touched a file or directory, scanning the raw session logs directly with no ingest and no model calls.
pks brain scan filepath <path> [options]$ pks brain scan filepath ./src/foo.csList sessions that edited one file
$ pks brain scan filepath ./src/ --format jsonlScan a directory and emit one JSON object per line
$ pks brain scan filepath ./src/foo.cs --include-bashAlso match Bash commands mentioning the path
Scan answers one question: which Claude sessions touched this file, when, and with which tool. It walks every session JSONL under ~/.claude/projects looking for tool-use entries against the path you name. No model is called and nothing is billed.
It is lower-level and slower than pks brain commit-plan, which prefers the pre-ingested firehose. The trade is that scan needs no ingest at all — it reads the raw logs on every invocation.
~/.claude/projects, or another directory passed via --projects-dir.pks brain scan filepath ./src/foo.cs
Matching sessions print with their timestamps and the tool that touched the path.
pks brain scan filepath ./src/
A directory argument matches every tool-use entry beneath it.
pks brain scan filepath ./src/foo.cs --include-bash
pks brain scan filepath ./src/foo.cs --since 2026-07-01
--include-bash also matches Bash tool-use entries whose command text contains the path as a substring. That is a plain substring test, so it can match a command that merely mentions the path in a comment or an unrelated argument.
--since skips sessions whose first entry predates the given date. It requires a parseable ISO date — the relative 7d and 24h shorthand accepted by other brain commands exits with code 1 here.
pks brain scan filepath ./src/ --format jsonl
--format accepts text (default), json, or jsonl.
Pick a file you edited today and scan it. The most recent session in the output should be the one you remember. If the list is empty, confirm --projects-dir points at real session logs.
| Flag | Default | Description |
|---|---|---|
--include-bash | false | Also match Bash tool-use entries whose command contains the path as a substring. |
--since <date> | — | Skip sessions whose first entry is older than this ISO date. |
--projects-dir <path> | ~/.claude/projects | Override the Claude projects directory. |
--format <name> | text | Output format: text, json, or jsonl. |
The positional argument <path> is required and accepts a file or a directory.
Exit code 1 on --since 7d. This command needs an ISO date. Relative windows are accepted by ingest, extract, refresh, and search, but not here.
Unexpected Bash matches. --include-bash is a substring test against raw command text. Drop the flag for edit-only results.
The scan is slow. Every JSONL under the projects directory is read on every invocation — there is no cursor or cache. For repeated queries, ingest once and use pks brain search or commit-plan instead.