Skip to content

Claude Code becomes unresponsive when launched in parent directory of ~/.claude #23237

@zizhongx

Description

@zizhongx

Bug Report: Claude Code becomes unresponsive when launched in parent directory of ~/.claude

Summary

Claude Code starts successfully but becomes completely unresponsive to user interaction when launched in the parent directory of the ~/.claude configuration directory (e.g., launching in /home/username when config is at /home/username/.claude). The same installation works normally in all other directories.

Environment

  • Claude Code Version: 2.1.31
  • OS: Linux (Rocky Linux 8.9)
  • Kernel: 4.18.0-513.11.1.el8_9.x86_64
  • Shell: bash

Steps to Reproduce

  1. Have Claude Code installed with config directory at ~/.claude (e.g., /home/username/.claude)
  2. Navigate to the parent directory: cd ~ (e.g., cd /home/username)
  3. Launch Claude Code: claude
  4. Observe that Claude starts but does not accept any user input

Expected Behavior

Claude Code should work normally regardless of which directory it's launched from.

Actual Behavior

When launched from the parent directory of ~/.claude:

  • Claude Code starts without error messages
  • The interface appears normal
  • User cannot interact with the CLI (no command input is accepted)
  • The session appears frozen/unresponsive

Workaround

Launch Claude Code from any directory other than the parent directory of ~/.claude. For example:

cd ~/projects  # or any other directory
claude         # works normally

Additional Context

Suspected root cause: When Claude Code is launched in the parent directory of its configuration directory, there may be a conflict or recursive dependency issue:

  • The global config is at /home/username/.claude
  • Launching in /home/username creates a project config named -home-username--claude
  • This may cause a configuration loop or access conflict

This appears to be a boundary condition bug that should be handled gracefully (either work normally or show a clear error message).

Related Files/Directories

/home/username/
├── .claude/                          # Global config directory
│   ├── projects/
│   │   └── -home-username--claude/   # Project config created when launching in /home/username
│   ├── settings.json
│   └── ...

Suggested Fix

Consider one of the following approaches:

  1. Detect this scenario and display a warning/error message
  2. Handle this edge case to work normally without conflicts
  3. Document this limitation in user-facing documentation

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:corearea:tuibugSomething isn't workinghas reproHas detailed reproduction stepsplatform:linuxIssue specifically occurs on Linux

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions