Skip to main content
← Back to list
01Issue
FeatureOpenSwamp CLI
AssigneesNone

Relationships

#1452 Add `amp` (Amp Code) as a built-in --tool for repo init/upgrade/audit

Opened by jasonbarnett · 7/29/2026

Problem

Amp (Amp Code, https://ampcode.com — Sourcegraph's coding agent, amp CLI) is not a built-in AI tool. Today:

$ swamp help init | jq -r '.root.options[] | select(.flags|test("tool")) | .description'
... Built-in: claude, cursor, opencode, codex, copilot, kiro, none.

So swamp init --tool amp, swamp repo upgrade --tool amp, and swamp doctor audit --tool amp all reject Amp, and the "no AI tool configured" error text tells an Amp user to pick a harness they aren't running.

Amp users end up with one of three unsatisfying setups: a per-repo swamp agent setup custom tool that has to be re-declared in every repo's .swamp-custom-tools.yaml and duplicates a definition swamp would otherwise maintain; or enrolling --tool claude/--tool opencode and living with a harness label that doesn't match what is actually running (misreported in .swamp.yaml tools:, audit recording, and the AiTool harness detection added in #292); or nothing at all.

Proposed solution

Add amp to the built-in tool table. Amp's conventions are documented in the Amp owner's manual:

Field Value
instructionsFile AGENTS.md (repo root; Amp also falls back to AGENT.md, then CLAUDE.md)
instructionsMode shared — already the default for root-level AGENTS.md
skillsDir (project) .agents/skills/ (Amp also reads .claude/skills/)
skillsDir (global) ~/.config/amp/skills/, ~/.config/agents/skills/, ~/.agents/skills/ (Amp also reads ~/.claude/skills/)
skillReferenceStyle path — Amp resolves a skill as a directory containing SKILL.md with YAML frontmatter, same shape swamp already ships
settings user: ~/.config/amp/settings.json[c]; workspace: nearest .amp/settings.json[c]; MCP servers under amp.mcpServers
audit hook TypeScript plugins in .amp/plugins/*.ts (or ~/.config/amp/plugins/*.ts)
non-interactive CLI amp -x "<prompt>" (--execute) — for nextSteps text and any scripted invocation

This should be close to a table entry rather than new machinery, because the built-in that Amp needs already exists under other names. swamp repo init --tool opencode --tool codex produces exactly Amp's expected layout — a shared managed section in root AGENTS.md whose rules already point at .agents/skills/swamp/SKILL.md:

$ swamp repo init amp-probe --tool opencode --tool codex --json
{ "instructionsFileCreated": true, "tools": ["opencode", "codex"], ... }
$ find amp-probe -maxdepth 3 -not -path '*/.swamp/*'
amp-probe/AGENTS.md
amp-probe/.opencode/plugins/swamp-audit.ts
...

An amp entry reusing that instructions file and skills dir, plus an amp value in the AiTool/harness-detection enum so telemetry and swamp doctor audit identify the harness correctly, covers the request.

Alternatives considered

  1. swamp agent setup custom tool — works, and is what an Amp user has to do today, but it is repo-scoped (.swamp-custom-tools.yaml), so every new repo repeats it; it never becomes a recognized AiTool for telemetry/audit; and it pins a copy of conventions that upstream would otherwise keep current as Amp changes.
  2. Enroll --tool claude and symlink AGENTS.md -> CLAUDE.md — Amp does read CLAUDE.md as a fallback, so this half-works, and it is what we're doing now. It breaks down as soon as the repo has both harnesses: two managed sections compete for one file, and the enrolled-tool label is wrong.
  3. Enroll --tool opencode (or codex) as an Amp stand-in — closest fit on-disk, per the probe above, and precisely why the marginal cost of a real amp entry looks small. Still mislabels the harness everywhere swamp reports it, and would ship an OpenCode plugin (@opencode-ai/plugin) that Amp cannot load.

Open questions for whoever implements

  • Does Amp's .amp/plugins/*.ts API expose pre/post tool-execution hooks equivalent to OpenCode's tool.execute.before / tool.execute.after? That determines whether swamp doctor audit --tool amp can record a bash timeline the way the OpenCode plugin does, or whether Amp starts audit-less like other harnesses without a hook surface.
  • Which global skills dir should swamp update sync into for an amp-enrolled repo? Amp searches several; ~/.config/amp/skills/ is the Amp-owned one and the least likely to collide, given #1051/#943 already tightened global sync so it doesn't create directories for unconfigured tools.

Environment

  • swamp 20260727.193526.0-sha.03dabbb5
  • amp CLI installed at ~/.local/bin/amp; ~/.config/amp/settings.json present
  • Linux (Coder workspace), Node/Deno toolchain per swamp defaults
02Bog Flow
OPENTRIAGEDIN PROGRESSSHIPPED

Open

7/29/2026, 3:12:04 AM

No activity in this phase yet.

03Sludge Pulse

Sign in to post a ripple.