Skip to content

feat: show the files Cursor's agents wrote, and an IDE chat's context and changes - #26

Merged
lr00rl merged 1 commit into
mainfrom
feature/20261023_cursor-edits
Oct 23, 2026
Merged

lr00rl merged 1 commit into
mainfrom
feature/20261023_cursor-edits

Conversation

@lr00rl

@lr00rl lr00rl commented Oct 23, 2026

Copy link
Copy Markdown
Owner

Summary

ccli show gains two Cursor additions, both read offline from files Cursor already keeps:

  • Files written (Cursor CLI and IDE): the files the session's agents wrote, newest first, with the models that wrote them, from ~/.cursor/ai-tracking/ai-code-tracking.db (session id plus subagent ids). Ten by default, --all for every one. Paths under the session's folder are relative; long paths are cut from the front so the file name stays.
  • Context and changes (IDE only): contextUsagePercent and Cursor's totalLinesAdded / totalLinesRemoved / filesChangedCount from composerHeaders. The change count reads zero for some chats that did edit files, so it is shown only when not zero.

show --json carries them as cursor_edits and cursor_composer. Nothing new is stored in the index; a failed side read leaves its part out without failing show.

Not included on purpose: the tracking row count as "lines written" (the table's key is an undocumented hash, so the count is unreliable).

Test plan

  • TestReadListsFilesNewestFirst, TestReadWithoutDatabase (tracking reader: order, model ranking, subagent ids, missing database)
  • TestCursorDetailEditsAndComposer (end to end through query.Session, IDE chat with a subagent plus a CLI chat)
  • TestSessionShowsCursorEditsAndComposer (zero changes hidden, relative paths, ten-file limit, --all)
  • go test ./...
  • Live: be14583f lists 46 files and 46% context; 5caeee9b lists 21 files; no file created beside either database; warm show about 40 ms slower.

… and changes

show now lists, for a Cursor CLI or IDE session, the files its agents
wrote, newest first, with the models that wrote them. Cursor records every
line an agent writes in ~/.cursor/ai-tracking/ai-code-tracking.db under the
conversation id, for the CLI and the IDE alike, so the session id and its
subagent ids find them. Ten are listed; --all lists every one. Paths inside
the session's folder are written relative to it, and a long path is cut
from the front so the file name stays.

For an IDE chat, show adds how full the context window is and Cursor's own
count of the chat's changes, both from composerHeaders. That count reads
zero for some chats that edited files (be14583f wrote 46 files and reads
zero), so it is printed only when it is not zero, and the list of files is
the fuller record. show --json carries both as cursor_edits and
cursor_composer.

Both are read when show runs and are not kept in the index. A failed read
leaves its part out instead of failing the command.

Rejected: showing the tracking row count as lines written. hash is the
table's key and Cursor does not say how it forms it, so the count is not a
reliable line count.
Tested: go test ./...; on the live machine show lists 46 files for
be14583f and 21 for 5caeee9b, and a warm show costs about 40 ms more.
@lr00rl
lr00rl merged commit 1d85a69 into main Oct 23, 2026
2 checks passed
@lr00rl
lr00rl deleted the feature/20261023_cursor-edits branch October 23, 2026 09:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant