Add Tencil to your Next.js app.
Run npx tencil to set it up, then click an element in your browser and describe the change. Fast Refresh updates the page as your agent edits the code.
npx tencilapp/layout.tsx
import { Tencil } from 'tencil/react'; <body> {children} <Tencil /> </body>One component in your root layout
npx tencilfinds your Next.js app and adds<Tencil />as the last child of<body>. It renders nothing outside development, so the change is safe to commit.pages/_document.tsx
import { Tencil } from 'tencil/react'; <body> <Main /> <NextScript /> <Tencil /> </body>App router and pages router
With the pages router, the component goes into
pages/_documentinstead.initpicks the right file, andnpx tencil init --dry-runshows the change before it writes anything.Your agent gets the source file
In React 19, Tencil can identify the component behind an element and the components that render it, including their source files and line numbers.
Match the page to its project
The daemon matches your page to its project through the port
next devlistens on, so several Next.js apps on one machine each get their own pins and agent. In Docker or on a remote dev server, the overlay asks once which project the page belongs to.
Frequently asked questions
Using Tencil with Next.js.
Yes. init adds <Tencil /> to pages/_document for the pages router, and to app/layout.tsx for the app router.
No. <Tencil /> renders nothing outside development, and the overlay itself is a script your machine's daemon serves while you develop.
Yes. Tencil doesn't hook into the bundler for Next.js: the component loads the overlay from the daemon in the browser, whatever builds your app.
More integrations
Tencil works the same everywhere: point at an element, say what should change.
- ViteA Vite plugin for React, Vue, Svelte, TanStack Start and Astro: click any element of your dev site and tell your coding agent what should change.
- ReactIn React apps, Tencil hands your coding agent the component you clicked and the components that render it, each with its file and line. Next.js, Vite, TanStack Start and more.
- Any dev serverNot on Next.js or Vite? Load one script in your development HTML and point at any element of your Rails, Laravel, Django, Phoenix or static site to prompt your coding agent.
- Claude CodeClick any element of your running app and Claude Code makes the change, under your own login. Every pin is a Claude Code session you can resume in a terminal.
- T3 CodeClick any element of your running app and T3 Code makes the change. Every pin is a real T3 Code thread in your project, so you can continue it there.
- CodexClick any element of your running app and Codex makes the change, under your own login. Every pin is a Codex thread you can continue outside Tencil. Free, local, no account.
- EnsembleClick any element of the app an Ensemble thread is running and its agent makes the change. Every pin is a chat on that thread’s checkout, on any model Ensemble runs.