[BUG] --add-dir doesn't seem to work?

Status Fixed / completed
Maintainer reply ✓ Yes — rboyce-ant
Activity 5 comments · opened Jun 12, 2025 · closed Jun 23, 2025
💡 Likely answer: A maintainer (rboyce-ant, contributor) responded on this thread — see the highlighted reply below.

Environment

  • Platform (select one):
  • [x] Anthropic API
  • [ ] AWS Bedrock
  • [ ] Google Vertex AI
  • [ ] Other: <!-- specify -->
  • Claude CLI version: 1.0.21 (Claude Code)
  • Operating System: macOS
  • Terminal: iTerm2

Bug Description

claude --add-dir /other-repo

I then ask claude about /other-repo and it acts like it doesn't know about it.

Steps to Reproduce

  1. claude --add-dir /other-repo
  2. ask what is other-repo?
  3. tells it knows nothing

Expected Behavior

Claude Code would recognize /other-repo as if it were part of the current project.

Actual Behavior

It didn't recognize.

Additional Context

None.

View original on GitHub ↗

5 Comments

rboyce-ant contributor · 1 year ago

I'll add some additional context for the model, but for now if you use the /absolute/path/to/other-repo Claude should figure out what you mean!

vladholubiev · 1 year ago

Hmmm, absolute paths don't seem to help either. Or am I using it wrong? @rboyce-ant

!Image

The documentation and CLI help contradict each other.

!Image

rboyce-ant contributor · 1 year ago

I mean in your prompt, refer to ~/path/code/awsnews.info-api directly. Then Claude will know to try and list it. Right now Claude doesn't know that awsnews.info-api refers to a directory. An upcoming update will include that path in the system prompt by default, which should resolve this.

rboyce-ant contributor · 1 year ago

This should be more visible to Claude now! Thank you for the report.

github-actions[bot] · 1 year ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.