[BUG] Print mode (-p) bypasses IP-based authentication checks enforced in interactive mode

Resolved 💬 2 comments Opened Jan 22, 2026 by w1tg Closed Feb 28, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

When using OAuth credentials copied to a machine with a different external IP address, print mode (-p) works normally while interactive mode prompts for re-authentication.

Both modes have access to the same privileged operations (Bash, Edit, Read, Write, etc.), so this creates an inconsistent security boundary.

What Should Happen?

Both interactive and print modes should enforce the same security checks (IP validation).

Error Messages/Logs

Interactive mode shows login prompt, no specific error message.                                                                                                                                                                                   
Print mode executes successfully with no errors.

Steps to Reproduce

Steps to Reproduce:

  1. On Machine A: Authenticate via claude login
  2. Copy ~/.claude/.credentials.json to Machine B (different external IP)
  3. On Machine B, run claude → Prompts for re-authentication
  4. On Machine B, run claude -p "hello" → Command executes successfully

Claude Model

None

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.15

Platform

Other

Operating System

macOS

Terminal/Shell

WSL (Windows Subsystem for Linux)

Additional Information

Tested on Ubuntu 24.04 LTS running in WSL2.

View original on GitHub ↗

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