Using Contral
Teaching on AI edits from other agents
Get teaching cards for code written by Cursor, Copilot, Claude Code, Codex and other AI agents.
Contral explains code that other AI agents write. When Cursor, GitHub Copilot, Claude Code, Codex CLI or another agent edits a file in your workspace, Contral shows a teaching card explaining what changed and why. This is sometimes called auto-teach.
Which AI agents Contral can teach on#
Contral watches for AI edits from these agents, among others:
- Cursor (Composer and agent)
- GitHub Copilot
- Claude Code
- Codex CLI
- Cline, Kilo Code and Roo Code
- Windsurf (Cascade)
- Google Antigravity
- Continue, Aider, OpenCode, Cody, Tabnine, Codeium and Amazon Q
You don't need to change how you use your agent. Keep the Contral extension installed and signed in, and work as usual.
How Contral detects AI edits#
Contral keeps a private copy of your workspace's files in memory and watches for changes. When a burst of changes arrives faster than a person types, Contral treats it as an AI edit and works out which agent made it, using:
- The
contral.preferredAgentsetting, if you've set one - The AI extensions installed in your editor
- The editor itself (for example Cursor or Windsurf)
- Events from the optional terminal hooks for Claude Code and Codex CLI
It ignores your own typing, git operations (checkout, pull, merge), and folders like node_modules, .git, dist, build and .next.
To understand what you asked for, Contral can read your agent's chat history from local files on your machine (for example Cursor's, Cline's, Continue's, Aider's, Claude Code's and Codex's local logs). These files are read on your machine only and never uploaded. Turn this off with the contral.harvestAgentPrompts setting.
What's on a teaching card#
A teaching card can include:
- What it does and Why this way
- A line-by-line walkthrough
- Key concepts, alternatives, and security or debugging notes
- A quick quiz, Socratic questions or a small task
- The prompt you gave the agent ("Asked the agent")
- A Deep dive button for a longer explanation (Pro and above, all AppSumo tiers)
When an agent edits several files at once, Contral walks you through them card by card.
Teaching on Claude Code and Codex CLI edits (terminal hooks)#
Terminal agents edit files outside the editor, so Contral offers small hooks that tell it exactly which edits came from them. Install them from a terminal (Node.js 18.17 or later is required):
Claude Code:
npx @contral/claude-code-hook installThis adds a hook to ~/.claude/settings.json that records Claude Code's edits to ~/.contral/agent-events.jsonl, which the Contral extension reads. Check it with npx @contral/claude-code-hook status and remove it with npx @contral/claude-code-hook uninstall.
Codex CLI:
npx @contral/codex-hook installWithout the hooks, Contral still notices terminal-agent edits through file watching; the hooks just make attribution exact.
Turning AI-edit teaching on or off#
- Run Contral: Toggle teach-on-change from the Command Palette. You'll see "Teach-on-change enabled." or "Teach-on-change disabled."
- Or change these settings:
| Setting | Default | What it does |
|---|---|---|
contral.teachOnChange | true | Show teaching cards when AI agents edit files |
contral.teachingLayerEnabled | true | Master switch for all teaching cards |
contral.autoOpenOnAgentEdit | true | Open a file automatically when an agent writes it |
contral.floatingCardDisplay | deck | How cards appear: deck, comment, hover, panel or both |
contral.preferredAgent | auto | Force which agent edits are credited to |
contral.harvestAgentPrompts | true | Read your agent's local chat logs to show what you asked |
contral.attribution.burstLineFloor | 8 | Minimum changed lines to count as an AI edit |
contral.attribution.minConfidence | 0.4 | How sure Contral must be before treating a change as an AI edit |
How AI-edit teaching counts against your plan#
Each teaching card for an AI edit uses one auto-teach card: 25 per day on Free, 250 on Pro, 500 on AppSumo Tier 1, 1,000 on Tier 2, and unlimited on Pro+, Teams and Tier 3. Cards for the Contral Build agent's own edits count the same way. When you run out, cards show "You've used this period's explanations. Upgrade, or wait for the reset." See Usage limits & quotas explained.
When teaching cards don't appear#
- Check that you're signed in (
/status) and thatcontral.teachOnChangeis on. - Small edits (fewer than 8 changed lines by default) may not count as an AI burst. Lower
contral.attribution.burstLineFloorto catch smaller edits. - Edits in ignored folders such as
node_modulesordistare skipped. - Check you haven't hit your daily auto-teach limit on the dashboard.
Still stuck? Ask the support assistant in the corner of this page, or open a support ticket.