brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: Ctrl+R searches every prompt you ever sent to Claude Code

Claude
~/tips/tip-claude-ctrl-r-history-search

cat ~/tips/tip-claude-ctrl-r-history-search.md

Searches your earlier Claude Code prompts as you type so you can reuse them.

Up arrow is fine for the last prompt. It is useless for the one from two weeks ago.

Press Ctrl+R in the prompt, like reverse search in your shell, and start typing. The best match shows in the input. Press Ctrl+R again to jump to older matches.

When you have the one you want, Tab or Esc puts it in the input so you can edit it, and Enter runs it straight away. Ctrl+C cancels and restores what you had typed.

In the classic renderer the inline search covers prompts from all projects. In fullscreen rendering Ctrl+R opens a dialog with a preview pane, and Ctrl+S there cycles the scope between this session, this project and all projects.

I like this because good prompts are worth reusing. A long prompt that worked once is a template, and searching for a word from it beats retyping it.

It also changes how I would write prompts. Since every old prompt is one search away, I would give the ones I want to find again a distinctive word. A search for the word "migration" or "changelog" then lands on the full version, ready to edit for today's task.

The caveat is small: it searches your prompts, not Claude's answers. For those, Ctrl+O is the better tool.

Further reading: Interactive mode – Claude Code docs, On this site: Ctrl+S stashes the prompt you are typing and brings it back later, On this site: Shift+Tab cycles permission modes, and acceptEdits skips the file-edit prompts

More Claude tips /recap /focus /skill-doctor /autocompact 500k claude purge ~/work/my-repo --dry-run All Claude tips (83) All topics

Link