[BUG] Claude Code -p in non interactive mode takes in minutes, while the same in claude code interactive mode is very fast. Why? How can I speed up the Claude Code in non interactive mode

Resolved 💬 2 comments Opened May 5, 2025 by palashk290195 Closed May 5, 2025

Environment

  • Platform (select one):
  • [X] Anthropic API
  • [ ] AWS Bedrock
  • [ ] Google Vertex AI
  • [ ] Other: <!-- specify -->
  • Claude CLI version: <!-- output of claude --version --> X
  • Operating System: <!-- e.g. macOS 14.3, Windows 11, Ubuntu 22.04 -->
  • Terminal: <!-- e.g. iTerm2, Terminal App -->

Bug Description

<!-- A clear and concise description of the bug -->
Run
claude code -p "explain this code base"
vs claude and then ask explain this code base
there is a huge difference in the time it takes

Steps to Reproduce

  1. <!-- First step -->
  2. <!-- Second step -->
  3. <!-- And so on... -->

Expected Behavior

<!-- What you expected to happen -->
The speed in non interactive mode and interactive mode should be same

Actual Behavior

<!-- What actually happened -->
Its very slow in non interactive mode

Additional Context

<!-- Add any other context about the problem here, such as screenshots, logs, etc. -->

View original on GitHub ↗

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