Skip to content

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:

  1. The contral.preferredAgent setting, if you've set one
  2. The AI extensions installed in your editor
  3. The editor itself (for example Cursor or Windsurf)
  4. 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:

bash
npx @contral/claude-code-hook install

This 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:

bash
npx @contral/codex-hook install

Without 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:
SettingDefaultWhat it does
contral.teachOnChangetrueShow teaching cards when AI agents edit files
contral.teachingLayerEnabledtrueMaster switch for all teaching cards
contral.autoOpenOnAgentEdittrueOpen a file automatically when an agent writes it
contral.floatingCardDisplaydeckHow cards appear: deck, comment, hover, panel or both
contral.preferredAgentautoForce which agent edits are credited to
contral.harvestAgentPromptstrueRead your agent's local chat logs to show what you asked
contral.attribution.burstLineFloor8Minimum changed lines to count as an AI edit
contral.attribution.minConfidence0.4How 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 that contral.teachOnChange is on.
  • Small edits (fewer than 8 changed lines by default) may not count as an AI burst. Lower contral.attribution.burstLineFloor to catch smaller edits.
  • Edits in ignored folders such as node_modules or dist are 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.

Teaching on AI edits from other agents · Contral Docs