Skip to content

Commit b842c31

Browse files
klocusCopilot
andcommitted
feat: skip instruction injection on read operations
Instructions are only relevant when the AI edits or writes files, not when it reads them. Remove 'read' from FILE_TOOLS and update docs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent a0e876a commit b842c31

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ The plugin will handle the rest, notifying you via the tool output whenever path
5959

6060
### Injection
6161

62-
When the AI performs a `read`, `edit`, or `write` operation on a file, the plugin:
62+
When the AI performs an `edit` or `write` operation on a file, the plugin:
6363

6464
1. Finds all `*.instructions.md` files whose `applyTo` patterns match the target file path.
6565
2. Injects them **once per session** — subsequent operations on matching files won't repeat the injection.

src/path-instructions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ interface InstructionFile {
3030
}
3131

3232
/** File tools that operate on file paths */
33-
const FILE_TOOLS = new Set(['read', 'edit', 'write'])
33+
const FILE_TOOLS = new Set(['edit', 'write'])
3434

3535
/** Marker format used to track injected instructions in message history */
3636
const MARKER_PREFIX = 'path-instruction'

0 commit comments

Comments
 (0)