anthropics / anthropics/claude-code

Feature: user-configurable prompt input completion source (frecency/history inline autosuggest)

Open
#81,244 0 comments 0 reactions 0 assignees View on GitHub
area:tui
Dominant language
Python
Stars
145k
Forks
23.1k
PR merge metrics
PR metrics pending

Description

### What

Expose a **user-configurable completion source for the prompt input** — inline, as-you-type suggestions (frecency/history-backed) that render as ghost text and accept with Tab, the same way Claude Code already renders inline completions for `/` commands, `@` file paths, and `:emoji:` shortcodes.

### Why

Claude Code already ships the exact UI primitive for this: it renders inline prompt completions internally for slash-commands, `@`-paths, and (recently) `:emoji:` shortcodes. There is currently **no public extension point** to feed *custom* completions into that same surface:

- The plugin/hook system operates at tool-execution and lifecycle events.
- The closest hook, `UserPromptSubmit`, fires **on Enter** — it can add context or modify the submitted prompt, but it can't surface suggestions *while typing*.

So there's no way to get history- or frecency-based inline autosuggest at the prompt.

### Use case

Heavy TUI users repeatedly type the same short phrases into the prompt ("merge it", "yes dispatch", "recommend next steps", etc.). Shell tools like `zsh-autosuggestions`/fish deliver perfect inline ghost-text autosuggest — but only in the shell's own line editor, never in the Claude Code prompt widget, which is Claude Code's own input.

OS-level workarounds don't reach it either: on X11, IME candidate windows aren't cursor-anchored, and a full-screen raw-mode TUI clobbers the terminal's preedit rendering entirely (well-documented on GitHub Copilot CLI, architecturally the same kind of Node TUI). The only thing that can render an inline, cursor-anchored, as-you-type suggestion *inside* the prompt is Claude Code itself — which is why this needs to be a first-party extension point.

### Proposed shape (open to alternatives)

Any one of:
1. A **custom completion source API** (plugin/config) that Claude Code queries with the in-progress input and renders the returned candidates in the existing inline-completion UI (accept with Tab, cycle, etc.).
2. A built-in **history/frecency autosuggest** for the prompt (like zsh-autosuggestions), toggleable — reusing your existing inline-completion renderer.

Either would let users get low-friction, zero-invocation phrase completion at the prompt without hacky external keyboard overlays. Given the rendering machinery already exists (slash/@/emoji), the incremental surface seems small.

### Environment

Claude Code CLI in a terminal (Alacritty) + tmux on Linux/X11. Not terminal- or OS-specific — the ask is a first-party prompt-completion extension point.

Contributor guide

No contributing guide indexed for this repository

Research direction

No files or tests are named. Start by locating the existing inline-completion implementation for slash commands, @ paths, and emoji shortcodes, then inspect the plugin and UserPromptSubmit hook APIs; done means a configurable source or toggleable history/frecency completion can suggest text while typing and accept it with Tab.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli, developer-experience
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.