Skip to content

Code Completion & Assistant

Continue, explain and revise code inside the editor

Code & softwareBeginner#34
inTextCodeCode

What this capability means

Takes the code context around the cursor plus an intent — complete a line, change a function, explain the logic — and outputs an edit that can be adopted directly. Its constraint is consistency with the existing repository rather than producing an isolated snippet. Unlike code generation it makes local changes inside existing files and conventions, and therefore leans more on context.

How it is done

A common approach concatenates the current file, nearby symbols and retrieved related snippets into the prompt so the model completes or rewrites within full context; repository-level assistants use code retrieval to surface relevant definitions and call sites. Edit requests are often framed as generating a patch that is then applied, which makes review and rollback easy. The system is tightly coupled to the IDE and needs low-latency inference with incremental context updates.

Representative products

4

Microsoft

GitHub Copilot

Completing and rewriting code in your editor from context

2Caps
Tool Freemium
TextCodeCode
2021

Anysphere (Cursor)

Cursor

A desktop code editor that treats the whole repository as context

3Caps
App Freemium
TextCodeCode
2023

Anthropic

Claude Code

A coding agent that carries out multi-step tasks from the terminal

3Caps
Tool Closed
TextCodeCode
2025

Cognition (Devin)

Devin

An autonomous coding agent with its own shell, editor and browser

4Caps
App Closed
TextCodeCode
2024

Organizations involved

Typical uses

  • Line-by-line completion while coding
  • Bug fixes and refactoring suggestions
  • Explaining code and onboarding into an unfamiliar repo
  • Writing tests and doc strings

How it is evaluated

Suggestion acceptance rate
Share of suggestions developers keep, closest to real experience
pass@k
One-shot success on tasks with tests
Test pass rate for a single edit
Whether the repository tests still pass after one edit

Limits and hard parts

  • It edits the wrong variable or misses call sites, producing code that clashes with the surrounding semantics
  • Repository understanding is capped by the context window, so distant constraints are missed in large projects
  • It can emit outdated or insecure patterns that the author must review

Concepts behind it

NLP & Large Language Models

Transformer ArchitectureIntermediate

Replacing word-by-word relay with a room where everyone speaks at once, so long-range dependencies are one hop away

4Linked
Figures 2 · Data 2

AI Engineering, Safety & Ethics

Retrieval-Augmented GenerationBeginner

Rather than cramming knowledge into parameters, leave it outside and look it up on demand — an open-book exam instead of a closed-book one

4Linked
Figures 2 · Data 1

NLP & Large Language Models

Prompting & AlignmentExpert

Making a model helpful, honest and harmless is harder than simply making it bigger

4Linked
Figures 1 · Data 1