Setup
How It Works
Amp stores conversation threads as JSON files in~/.local/share/amp/threads/. The adapter:
- Watches
~/.local/share/amp/threads/for file changes - Detects new thread files → emits
session.start - Detects when a thread stops updating (1s idle) → emits
task.completeif the last message is from the assistant with text content
Thread State Detection
The adapter parses each thread JSON and checks the last message:Event Mapping
| Amp Event | CESP Category | Trigger |
|---|---|---|
| New thread file created | session.start | T-*.json appears in threads dir |
| Thread idle + assistant text | task.complete | Thread stops updating, last message is assistant with text content |
Configuration
Environment variables:| Variable | Default | Description |
|---|---|---|
AMP_DATA_DIR | ~/.local/share/amp | Amp data directory |
AMP_THREADS_DIR | $AMP_DATA_DIR/threads | Threads directory to watch |
AMP_IDLE_SECONDS | 1 | Seconds of no changes before emitting Stop |
AMP_STOP_COOLDOWN | 10 | Minimum seconds between Stop events per thread |
Stopping the Adapter
If running in the background, find the process and kill it:pkill:
Limitations
- No permission prompt detection — Amp doesn’t expose tool approval events, so
input.requiredsounds won’t play - No error detection — Tool failures aren’t visible in thread files
- Idle timer accuracy — Very short tasks (under 1 second) might not trigger a sound
Windows Support
Use the PowerShell adapter (amp.ps1) on native Windows:
FileSystemWatcher instead of fswatch.