Use Tern with a coding agent
3 min read
A coding agent on your Mac, such as Claude Code, the Claude app or Codex, can work in the Spaces you choose: read their pages and page errors, and click and type there. It asks in Tern before anything that has an effect, as Tern's own agent does. Because those apps run on your Claude or ChatGPT plan, this is also how to use Tern with a plan instead of an API key.
Turn it on
- Open Settings › Agents.Under Coding agents, turn on Let coding agents use Tern. It's off until you do.
- Add Tern to your app.For the Claude app, click Add to the Claude App, then quit and reopen it. Tern adds itself to the app's settings and leaves the rest as it was. For Claude Code or Codex, copy the line Tern shows and run it in Terminal, in the folder you work in.
- Choose its Spaces.The first time the app asks Tern for anything, Tern shows a card with your Spaces. Tick the ones it may see and click Allow. Its other Spaces stay out of its reach.
What it can do
It can list the tabs in its Spaces, read a page, find things on it, take a picture of it, read its errors and failed requests, open pages, and click, scroll and type, much as Tern's own agent does. Everything a page says reaches it marked as the page's words, not as instructions, and text a page hides to give an AI agent instructions is taken out first, as it is for Tern's own agent. See Agent safety.
Anything that would pay, send, post, delete or submit, or send your details to another site, waits for your OK on a card in Tern, with a notification when you're in another app. It never types passwords or card numbers. With Rehearsal, which is on unless you turn it off, it works as Tern's own agent does: the steps that need an OK are held, and you approve them together on one card in Tern, which then does them itself. See Approvals.
NoteYour plan, not an API key: the coding agent's own app does the thinking, on the plan you have with Anthropic or OpenAI. Tern gives it your pages and asks you before it acts.
For building a website
- Catch Page Errors, in a Space's menu, keeps its pages' errors and failed requests, and a tab with errors says how many.
- Copy Page for Agent (⌥⇧⌘C) copies the page as text to paste into any coding agent: its address, a picture, its errors and its text. Copy for Agent in a page's menu copies just the element you clicked.
Take it back
Settings › Agents › Coding agents lists each app with the Spaces it may use, whether it's connected now, and what it did lately. Remove takes its Spaces back; if it asks again, Tern asks you again. Turning the setting off disconnects every app at once.
Something missing or out of date? Write to hello@ternbrowser.com.