Amp
Make Amp follow an instruction: copy instruction.md's plugin file, and each thread gets the instruction at its first turn and a new version at your next prompt. The same setup for other tools, and how each one takes a new version, is on Other coding agents.
At a glance
| How it follows | a plugin |
|---|---|
| A new version arrives | at your next prompt |
| Set up | a file to copy |
| Checked against | Amp's plugin interface (@ampcode/plugin); not yet run inside Amp |
| Systems | Wherever the tool and Node.js 20.19 or later run |
What you need: Node.js 20.19 or later, the instruction.md package
(npm i -g instruction.md, 0.11.0 or later) and @instruction.md/agents 0.4.1 or later, which
instruction agents … runs. Every instruction agents … command also runs, without installing
anything, as npx -y @instruction.md/agents …, and every instruction … command as
npx -y instruction.md ….
Set up
instruction.md's plugin for Amp is one file, amp/instruction-md.ts at github.com/instruction-md/plugins. Copy it into one of Amp's plugin folders:
.amp/plugins/in your project, for that project;~/.config/amp/plugins/(or$XDG_CONFIG_HOME/amp/plugins/), for every project on your computer.
Then run plugins: reload from Amp's command palette, or restart Amp. The project names what it follows in .instruction/follow.json:
{
"follow": "instruction://acme/support-agent@stable"
} What happens
At each turn, the plugin runs npx -y @instruction.md/agents turn amp --session <thread> [--start] --cwd <workspace> and adds what it prints after your prompt, unseen. A thread gets the instruction at its first turn, a new version at your next prompt after a release, and nothing while it is unchanged. Amp tells you when a new version arrives.
turn reads the way the hooks do: at most every refreshSeconds, within 1.5 seconds, else the last good copy. Signed in, it reports the version a thread applied, as Amp.
Caveats and what isn't verified
- The plugin is checked against Amp's plugin interface, but not yet run inside Amp itself.
- Whether what the plugin adds stays in a thread's history is not verified.
Check it worked
Run the command the plugin runs. It prints JSON with the context a first turn gets, or nothing:
npx -y @instruction.md/agents turn amp --session test --start --cwd . Stop following
- Delete
instruction-md.tsfrom the plugin folder, then plugins: reload. - Delete
.instruction/follow.jsonif nothing else uses it.
If it doesn't work
| What you see | Why | What to do |
|---|---|---|
| A private instruction isn't read | The command isn't signed in | instruction login (--device on a machine without a browser) |
| Still stuck | Ask us |
Related
- Other coding agents: every tool at a glance
- How following works: the follow file, the hooks, offline behaviour
- Live updates