aws / aws/amazon-q-developer-cli

Make Q aware of changes I make to files that Q has edited

Open
#2,874 2 comments 4 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
2k
Forks
439
PR merge metrics
No merged PRs in 30d

Description

Here's a common scenario: Q will make changes to a file, I'll revise the file, then when I prompt Q to do something else with that file, it'll overwrite my changes.

I've gotten in the habit of explicitly saying "I've made some changes" at the start of my prompt to hint to Q that it should read the file again and treat the changes there as coming from me. (If it reads the file when I haven't said anything, it seems to assume that the changes were introduced by mistake.) I also include this paragraph in my global context:

> Any code changes I make during our session should be considered feedback. If you aren't sure why I made a change, please stop and ask. Avoid overwriting my changes without confirming with me first.

But even with that, Q still frequently ignores or overwrites my changes.

In theory one could use [hooks](https://github.com/aws/amazon-q-developer-cli/blob/main/docs/agent-format.md#hooks-field) to run `git diff` on every `userPromptSubmit`, but that would quickly flood the context with irrelevant changes. What I really want is:

1. A mechanism that informs Q of changes to files it's edited (perhaps with a tool to request a diff), and
2. Tweaks to the system prompt to make Q more inclined to respect those changes.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.