Skip to content

Commit d956b94

Browse files
fix: emit stderr hint when no filter matches to prevent LLM confusion
When an LLM runs "snip mkdir" (no matching filter), snip silently passes through, reinforcing the wrong mental model. Now prints: snip: no filter for "mkdir", passing through — you can run "mkdir" directly This helps LLMs self-correct instead of looping on the snip prefix. Closes #21
1 parent 1a88695 commit d956b94

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

internal/engine/pipeline.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,9 @@ func (p *Pipeline) Run(command string, args []string) int {
3333
// Match filter
3434
f := p.Registry.Match(command, subcommand, filterArgs)
3535

36-
// No filter found: passthrough
36+
// No filter found: passthrough with hint so LLMs know snip is unnecessary
3737
if f == nil {
38+
fmt.Fprintf(os.Stderr, "snip: no filter for %q, passing through — you can run %q directly\n", command, command)
3839
return p.Passthrough(command, args)
3940
}
4041

0 commit comments

Comments
 (0)