Desired outcome
Passing both --file and --dir is rejected instead of silently ignoring one of them.
Why it matters
_load() in agentrace/cli.py:
if args.file:
sessions = [parse_session(Path(args.file))]
else:
sessions = parse_all(Path(args.dir) if args.dir else None)
--file wins and --dir is discarded without a word. Both are defined as plain top-level options in main(), so nothing stops a user from writing:
agentrace check --dir ./transcripts --file ./transcripts/session.jsonl
and this is a natural thing to type when narrowing down from a directory run to a single file: you add --file and leave the --dir you already had in your shell history. The output then describes one file while the user believes it covers the directory. For a tool whose whole purpose is telling you which agent results not to trust, quietly analysing a different input than the one requested is a bad failure mode.
The empty-result message compounds it: _load prints "Looked in ~/.claude/projects unless --dir was given" even on the --file path, so a typo'd filename reports the wrong location.
Steps
-
In main(), put --file and --dir in a mutually exclusive group:
src = p.add_mutually_exclusive_group()
src.add_argument("--dir", ...)
src.add_argument("--file", ...)
argparse then errors out with a clear message and no code in _load needs to change.
-
Make the "no runs found" message name the actual source: the file path when --file was used, the directory otherwise.
-
Consider erroring when --file points at something that does not exist, rather than letting it surface from parse_session.
Claiming this
Comment below to claim it. A reply usually comes within a day.
Desired outcome
Passing both
--fileand--diris rejected instead of silently ignoring one of them.Why it matters
_load()inagentrace/cli.py:--filewins and--diris discarded without a word. Both are defined as plain top-level options inmain(), so nothing stops a user from writing:and this is a natural thing to type when narrowing down from a directory run to a single file: you add
--fileand leave the--diryou already had in your shell history. The output then describes one file while the user believes it covers the directory. For a tool whose whole purpose is telling you which agent results not to trust, quietly analysing a different input than the one requested is a bad failure mode.The empty-result message compounds it:
_loadprints "Looked in ~/.claude/projects unless --dir was given" even on the--filepath, so a typo'd filename reports the wrong location.Steps
In
main(), put--fileand--dirin a mutually exclusive group:argparse then errors out with a clear message and no code in
_loadneeds to change.Make the "no runs found" message name the actual source: the file path when
--filewas used, the directory otherwise.Consider erroring when
--filepoints at something that does not exist, rather than letting it surface fromparse_session.Claiming this
Comment below to claim it. A reply usually comes within a day.