[FEATURE] Scope prompt input history per project/instance
Problem
When running multiple Claude Code instances simultaneously (e.g., via separate terminals or a multi-agent orchestration tool like Magnus), arrow-key history navigation (up/down) shows prompts from all running instances, not just the current one. This is because input history is stored in a single shared file.
For users running parallel agents — e.g., a PM agent, a worker agent, and a reviewer agent each in their own terminal — the history from all of them gets interleaved, making prompt recall via arrow keys noisy and unhelpful.
Expected Behavior
Input history should be scoped so that navigating with arrow keys only shows prompts relevant to the current context. Possible scoping strategies:
- Per-project (most useful) — history tied to the working directory/project, so different projects have independent history
- Per-instance — each running Claude Code process maintains its own history for the duration of the session
- Per-session — history scoped to the session ID
Per-project scoping would likely cover the most common case while keeping history useful across sessions within the same project.
Reproduction
- Open two terminals in different project directories
- Run
claudein both - Send a few prompts in each
- Press up arrow in either instance — prompts from the other instance appear
Context
This is especially relevant for multi-agent workflows where multiple Claude Code instances run in parallel on different tasks. The cross-instance history pollution makes arrow-key recall essentially unusable in that context.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗