Prompting
How to Prompt
For the best results, follow these guidelines:
- Be explicit with what you want. Instead of “can you do X?”, try “do X.”
- Use one thread per task. (By task we mean the casual definition of “something you need to do”.) Threads and tasks can go on forever but shouldn’t. Do not ask the agent to write database migrations in the same thread as it previously changed CSS for an unrelated documentation page.
- Don’t try to make the model guess. If you know something about how to achieve what you want the agent to do — which files to look at, which commands to run — put it in your prompt.
- If you want the model to not write any code, but only to research and plan, say so: “Do not edit any files.”
- Use
AGENTS.mdfiles to guide Amp on how to run your tests and build steps and to avoid common mistakes. - Tell the agent how to best review its work: what command or test to run, what URL to open, which logs to read. Feedback helps agents as much as it helps us.
Here are some examples of prompts we’ve used with Amp:
If you’re in a workspace, use Amp’s workspace thread sharing to learn from each other.
Referencing Other Threads
You can reference other Amp threads by thread URL (e.g., https://ampcode.com/threads/T-7f395a45-7fae-4983-8de0-d02e61d30183) or thread ID (e.g., @T-7f395a45-7fae-4983-8de0-d02e61d30183) in your prompt.
In the CLI, type @@ to search for a thread to mention.
For each mentioned thread, Amp will read and extract relevant information to your current task. This is useful to continue work from or reuse techniques from a previous thread.
Examples:
Finding Threads
Amp can search through your past threads and your workspace members’ threads to find relevant conversations. Ask Amp to find threads by keyword, file path, repository, author, date, or task.
The web feed also supports URL filters you can bookmark or share. Use /feed?time=7d to
change the activity window (24h, 72h, 7d, or all). Use /feed?q=label:bug to search
with the thread query syntax: bare words or quoted phrases, plus filters like id:, label:, file:, parent:, project:, repo:, ref:, author:, archived:, snoozed:, pinned:, commit:, pr:, after:, and before:. For example, /feed?q=label:bug%20after:7d shows recent threads
with the bug label.
The parent: filter accepts a thread ID or Amp thread URL and returns that thread’s direct children.
It does not include grandchildren or other descendants. Other filters can narrow those children.
Use pinned:true|false for pin status, commit:true|false or commit:<SHA> for linked commits,
and pr:true|false or pr:<number> for linked pull requests.
The after: and before: filters use the thread’s update time. You can also use the explicit
names updated_after: and updated_before:. For example, updated_before:7d finds threads with
no activity in the last week. These filters accept ISO dates, relative days, or relative weeks.
Examples:
Archiving Threads
When you archive a thread, it no longer appears in your list of active threads but can still be viewed on the web and referenced by URL.
To archive a thread, from the command palette, run thread: archive in the CLI.
Attaching Images
You can attach images (such as screenshots and diagrams) to your messages.
In the CLI, press Ctrl+V to paste an image from the clipboard. Note that you must use Ctrl+V, not Cmd+V, even on macOS. On Windows, if Ctrl+V does not work, press Ctrl+O and run paste image from clipboard in the Amp command palette.
On Windows, image pasting is more reliable in WezTerm or Alacritty than in Windows Terminal.
You can also @-mention images by file path.
Voice Input
By default, press Cmd+Shift+D on macOS or Ctrl+Shift+D elsewhere to start dictating. You can change this in Keyboard Shortcuts. Press the shortcut again to stop. You can also press the icon. Press and hold the shortcut or icon to dictate and send when you release it.
The portal review widget also supports dictation and uses your saved dictation shortcuts. It records from the portal hostname whether the portal is embedded in Amp or open in a separate tab, so your browser may ask for microphone permission for each portal hostname. Portal transcription sends only the recorded audio. It does not use thread messages, the comment draft, the selected page element, or your saved vocabulary as context.
Add terms that Amp mishears to your custom vocabulary. You can also run amp config vocabulary add <term>, or ask Amp to run it for you.
Mentioning Files
Type @ to search for a file to mention.
Edit
To edit a prior message in the CLI, press Tab to navigate to prior messages, then press e.
Queueing Messages
If you send a message when the agent is still working, your message is queued and will be sent when the agent is done.
Press Enter Enter to steer it sooner, which sends the message when the agent is done with its current step (such as a command or thinking block).
Press Esc Esc to forcibly stop the agent and send your message immediately, when you want to interrupt its work.