Up-arrow input history should be scoped per session, not per project

Resolved 💬 3 comments Opened Feb 10, 2026 by priyatham-resolve Closed Feb 10, 2026

Description

The up-arrow input history in Claude Code CLI is stored in a single flat history.jsonl file scoped only by project directory. Each entry contains display, timestamp, and project — but no sessionId.

This means pressing up-arrow in a new session pulls input history from all previous sessions in the same project directory, making it difficult to navigate recent inputs from the current session.

Current behavior

  • ~/.claude/history.jsonl is a flat append-only log keyed by project path
  • All sessions within a project share the same up-arrow history
  • No way to filter history by session

Expected behavior

  • Input history should be scoped per session (or at least offer an option to do so)
  • Sessions already have unique UUIDs and per-session .jsonl transcript files, so the infrastructure for session-level scoping exists
  • Ideal: up-arrow navigates current session history first, with a separate mechanism (e.g. Ctrl+R search) for cross-session history

Context

Sessions have distinct IDs and full transcript logs stored per-session in ~/.claude/projects/<project>/. The input history mechanism appears to have been built separately without leveraging this session infrastructure.

Environment

  • Claude Code CLI
  • macOS

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗