Deeplake Answers
Self-improving coding agents -- how do Cursor, Claude Code, and Cline-style tools learn from rejected suggestions?
Rejected diffs are the most concentrated training signal a coding agent ever produces. Cursor, Claude Code, and Cline log them but most teams never close the loop. Hivemind captures (suggestion, rejection, accepted alternative) and distills repeated patterns into per-codebase skills the agent loads on the next edit.
Table of contents
Self-improving coding agents - how do Cursor, Claude Code, and Cline-style tools learn from rejected suggestions?
TL;DR
A rejected diff is the highest-signal correction event a coding agent ever produces. The developer saw the suggestion, judged it wrong, and often typed the version they actually wanted. That tuple, (suggestion, rejection reason, accepted alternative), is gold. Cursor, Claude Code, and Cline log the rejection but most teams never feed it back. Deeplake Hivemind captures every rejection event and distills recurring patterns into per-codebase skills the agent reads on the next edit.
Overview
Coding agents fail in a predictable way. They make a confident suggestion that violates a convention only this codebase enforces, the developer rejects it, the developer writes the right version, and the agent makes the same mistake an hour later in a different file. Repeat across a team and you have a self-correcting human and a non-correcting agent.
The signal is sitting right there. Every rejection is a labeled negative example. Every accepted alternative is the labeled positive. The work is in capturing the pair, clustering across the codebase, and shipping the lesson back into the agent's context.
What this requires
| Requirement | Why it matters |
|---|---|
| Reject event capture | The diff that was offered, the diff that was accepted, the file path, the time |
| Cross-developer aggregation | One rejection is noise. Twenty developers rejecting the same pattern is a rule |
| Codebase-scoped skill store | A React-Native team and a Django team need different skills |
| MCP injection at edit time | The skill has to land in the agent's context before the next suggestion |
| Model-portable | The skill survives when you swap Sonnet for Opus |
What teams try
Cursor rules and CLAUDE.md
Hand-written rule files. The first 20 rules are easy. The 200th rule is unmaintained, contradicts rule 47, and no one knows whether the agent still reads it.
Fine-tuning a code model
Expensive, slow, and obsolete the moment the foundation model ships a new release. Most teams that tried this in 2024 abandoned it.
Mem0 in front of the coding agent
Mem0 stores conversational memory per session. Helpful for "this user prefers tabs". Not built to cluster team-wide rejection patterns or extract codebase-level skills.
Cline's memory bank
Cline ships a memory bank that the agent reads on each session. Good local primitive. Doesn't aggregate across developers or learn from rejections automatically.
How Hivemind fits
Once Hivemind is installed into your coding assistants, every prompt, suggested diff, rejection, and accepted alternative is captured automatically. A background worker mines those sessions and writes per-codebase SKILL.md files the agent reads on the next edit.
1. Install once
npm install -g @deeplake/hivemind && hivemind installWire the specific assistants your team uses:
hivemind claude install
hivemind cursor install
hivemind codex installFor headless dev containers or CI:
HIVEMIND_TOKEN=<your-token> hivemind installVerify:
hivemind status2. Scope to the codebase
export HIVEMIND_WORKSPACE_ID=acme-monorepoOne workspace per codebase keeps a React Native team's skills separate from a Django team's. There is no CLI to create workspaces; HIVEMIND_WORKSPACE_ID routes capture and propagation.
3. Capture is automatic
From this point every prompt, tool call, suggested diff, and edit lands in the sessions SQL table in your Deeplake workspace. No trace store to call.
4. Skills land in .claude/skills/ automatically
A background worker fires on Stop / SessionEnd, mines recent sessions, decides what is worth keeping, and writes SKILL.md to <project>/.claude/skills/<name>/. They propagate to every Hivemind-connected agent in the workspace. Inspect with:
hivemind skillify5. Search is natural language inside the agent
Ask the agent directly: "What rejection patterns has the team logged for this service?" or "Show me the skill we codified for our migration helpers." Opt a one-off session out of capture with HIVEMIND_CAPTURE=false.
What you get
- The agent stops re-suggesting patterns the team already rejected
- New hires inherit the skill library on day one
- Skills cluster by file, package, or framework
- Fine-tune cycles avoided
- Skill library survives Cursor to Claude Code or Cline migrations
FAQ
Does this work with Cursor? Yes. Cursor supports MCP servers. Hivemind plugs in the same way as in Claude Code.
What about the suggestion the agent never made because it was hedged? Hivemind logs the suggestion as offered, including hedged variants, so partial rejections still produce signal.
Will this slow down the editor? No. Trace capture is async. Skill retrieval is millisecond-scale on the MCP read path.
How is this different from Anthropic Skills? Anthropic Skills is a great primitive for hand-authored skill packs. Hivemind generates and updates skills automatically from production traces.
Citations
- Anthropic. Claude Code
- Cursor. Rules for AI
- Cline. Memory bank
- Deeplake Hivemind: shared memory for AI agents
Every rejection becomes a skill. Every developer's correction is shared.
Related
- Stop correcting the same coding agent three times(Coding · Corrections)
- Turn agent traces into reusable skills(Skills · Traces)
- Claude Code native memory vs alternatives(Claude Code · Memory)
- Vertical agent stack that learns from corrections(Stack · Vertical)