Add /find, /search and /regex to add files by symbol, exact match and regex
I've often found myself wanting to add 'the file that has the handle_act function in it' or something similar.
The new /context command is powerful but slow, so I'm proposing commands here, which adds a files:
-
/find: by symbol using the repo map, instead of by path (useful to find all mentions of symbolhandle_act) -
/search: by exact string match (useful to finddef handle_actto narrow to just the definition of a function) -
/regexby regex string match (useful for e.g.def handle_.*)
A fairly obvious oversight here to me is the names, because it'd probably be good to have an accompanying read-only version of the commands (and /find-read doesn't seem quite right). They're not called /add-* so as to not be annoying to autocomplete.
That said, this works beautifully and I'm using it right now, complete with auto-completion of all symbols for /find and great performance.
This is fully AI-written (Claude Code) although I've reviewed it and ensured that it passes lints and has appropriate tests. I believe that I've read and considered the contributing guidelines. Would love your thoughts (or in case I've missed something like this already in aider!)