Add line numbers to user code
@hanna-paasivirta is already working on this.
Since Jul 30, 2026.
- Dominant language
- Jupyter Notebook
- Stars
- 5
- Forks
- 10
- Avg merge
- 2d 20h
- Merged PRs (30d)
- 17
Description
User feedback: "When I ask the AI Assistant to refer to specific lines of code, it seems to get it wrong" e.g. "Explain line 244-245"
The assistants are not given the code line numbers, so if a user refers to specific lines in their code by number, it has to make a rough guess about which line they mean. We should add line numbers to all user code for the assistant to see (in cat -n format).
The line number + tab would be treated as scaffolding and stripped out for code edits, and so this should not complicate code edits. This should be explained both in the planner and job code agent prompts, and the read code tool used by those agents. If it forgets that the line numbers are just part of the viewing format, the code edit would fail on no matches found, and as we surface the error to the assistant (double-check this) it should quickly self-correct.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.