[FEATURE] Smart Compose / Autocomplete for Prompt Input
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
Feature Request: Smart Compose / Autocomplete for Prompt Input
Summary
Add Gmail-style smart compose functionality to Claude CLI that provides real-time text suggestions while typing prompts, helping users write prompts faster and more effectively.
Problem Statement
Currently, when typing prompts in Claude CLI, users must compose their entire message manually without any assistance. This creates friction, especially for:
- Repetitive tasks: Writing similar prompts for code reviews, commits, refactoring
- Long file paths: Manually typing
src/components/TaskList/TaskList.jsxevery time - Technical terminology: Remembering exact function names, API endpoints, or package names
- Common patterns: Re-typing phrases like "Can you help me refactor...", "Please explain how..."
Shell history (Ctrl+R) only recalls exact past commands and doesn't offer intelligent, context-aware suggestions.
Proposed Solution
Proposed Solution
Implement inline autocomplete suggestions that appear as ghost text while typing, similar to:
- Gmail Smart Compose
- GitHub Copilot CLI
- VS Code inline suggestions
Behavior
- As the user types, show faded/ghost text predictions for the rest of the sentence
- Press
TaborRight Arrowto accept the suggestion - Press any other key to ignore and continue typing
- Suggestions should be context-aware based on:
- Current working directory and file structure
- Recent conversation history
- User's CLAUDE.md instructions and memory files
- Common prompt patterns
Example
User types: "Can you help me fix the bug in src/comp"
Suggestion: "onents/TaskList/TaskList.jsx" (ghost text)
User types: "Please refactor"
Suggestion: " this function to use async/await" (ghost text)
Use Cases
| Scenario | Without Smart Compose | With Smart Compose |
|----------|----------------------|-------------------|
| Reference a file | Type full path manually | Tab-complete from partial |
| Code review request | "Please review this PR for..." | Auto-suggest based on recent PRs |
| Commit message | Type from scratch | Suggest based on staged changes |
| Explain code | "Can you explain how..." | Complete the pattern |
| Refactoring | Describe manually | Suggest common refactoring patterns |
Alternative Solutions
Implementation Ideas
Option A: Extend Hooks System
Add a new hook event UserPromptInput that fires on keystrokes (debounced) and can return suggestions:
{
"event": "UserPromptInput",
"partialInput": "Can you help me fix",
"cursorPosition": 20
}
Hook returns:
{
"suggestion": " the TypeScript error in src/index.ts"
}
Option B: Built-in Completion Engine
Integrate a lightweight completion model that runs locally or calls Claude API with low latency for single-line completions.
Option C: Terminal UI Enhancement
Use terminal control sequences to render ghost text (similar to how fish shell or zsh-autosuggestions work).
Priority
Medium - Would be very helpful
Feature Category
CLI commands and flags
Use Case Example
Example
User types: "Can you help me fix the bug in src/comp"
Suggestion: "onents/TaskList/TaskList.jsx" (ghost text)
User types: "Please refactor"
Suggestion: " this function to use async/await" (ghost text)
Use Cases
| Scenario | Without Smart Compose | With Smart Compose |
|----------|----------------------|-------------------|
| Reference a file | Type full path manually | Tab-complete from partial |
| Code review request | "Please review this PR for..." | Auto-suggest based on recent PRs |
| Commit message | Type from scratch | Suggest based on staged changes |
| Explain code | "Can you explain how..." | Complete the pattern |
| Refactoring | Describe manually | Suggest common refactoring patterns |
Additional Context
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗