Streamline: Automating Cursor History Export with CLI Tools

The default flow for exporting conversations from the Cursor AI editor can be clunky and disorganized. You have to manually export each conversation, and the resulting files lack a consistent naming scheme, making it difficult to build a persistent, searchable history of your important AI interactions.

This lesson introduces cursor-history (chi), a simple command-line tool built to solve this exact problem. It provides a streamlined interface to quickly find, export, and save your Cursor conversations with clean, organized, and timestamped filenames directly from your terminal.

By using chi, you can easily build a "memory" of important conversations right inside your project. This organized history can then be used as context for future AI agent tasks, creating a more powerful, efficient, and context-aware development workflow.

Workflow Demonstrated

  • Install the cursor-history CLI tool via NPM.
  • Use chi --select to interactively search and find past conversations from the current workspace.
  • Export a selected conversation to a well-named markdown file.
  • Save the exported conversation into a project's memories or conversations folder.
  • Leverage the saved conversation as context for new AI agent tasks, such as summarizing a past troubleshooting session.

Key Benefits

  • Quickly find and export conversations without leaving the terminal.
  • Creates organized, timestamped filenames based on the workspace and conversation title.
  • Builds a persistent, searchable knowledge base of your AI interactions within your project.
  • Improves context for future AI tasks by making past conversations easily accessible.

Spoken Prompts

Please use basic memory to find where I was troubleshooting server errors and summarize what it found.

Terminal Commands

npm i -g @johnlindquist/cursor-history@latest
chi --select
chi
chi --help
Create an AI-Automated MCP-Driven Markdown Knowledge Base
Lesson 2 of 10

Create an AI-Automated MCP-Driven Markdown Knowledge Base

Share with a coworker

Transcript

[00:00] I really don't like the flow of exporting conversations from Cursor, so I built a tool called Cursor History, which you can install using npm. So we'll just install this globally, and once that's installed it includes a command called chi for Cursor History. And when you pass in --"select", it will look through all the conversations in this workspace that it's currently in and allow you to go back and search through any of the conversations. So if I search for like perf it'll look for ones for performance wins or build anything with build in the title or content of the conversation. And then if I just navigate down and select one, let's just do this one, it'll output the path and from the terminal I can just either command click on this and cursor will open up the exported conversation, which I can then browse through see if I want to keep it.

[00:46] And if I want to keep it I can just go into my memories and my conversations and then just drag this tab in here. We're going to allow this to remove the line terminators, that's fine. And now we have this conversation which is also organized by the workspace name. So script generator is the workspace name and that has a nice time stamp on it as well. When you export these and if you have a lot of conversations that you export they'll be sorted by workspace name and by time stamp rather than the way that cursor exports a conversation with just the name of the conversation.

[01:14] So then I can use the agent and ask my basic memory to find this document and summarize it. So for example, please use basic memory to find where I was troubleshooting server errors and summarize what it found. Then just let this run. And this document isn't in context right now, So it's going to have to use the basic memory MCP to find it. So it's going to search my notes, and then it read the note that it found, and it brings it in and can summarize what this conversation was about.

[01:42] With the CHI tool there are a lot more commands you can use. If you do --"help", you can see that the default command will just export the latest conversation. So if we try this now, so chi, it should attempt to export this conversation we just ran. So if we look at this document and look at the content, you'll see here's what I just queried, and here's the summary. Now I will say that there have been some issues with running the CHI tool before Cursor has had a chance to save the conversation to the database.

[02:12] So sometimes this may fail. Make sure and check out the result. And there's no real way to force cursor to save this conversation to the database, so just always double check the output.