Expose directories added via /add-dir in statusline JSON

Resolved 💬 2 comments Opened Feb 16, 2026 by codemedic Closed Feb 16, 2026

Feature Request

When using /add-dir (or --add-dir) to add additional directories to a session, there is no way to programmatically query which directories have been added.

Use case

I have a custom statusline script that displays session context (git branch, model, cost, context usage, etc). I'd like to also show which additional directories are part of the current session, especially when working across multiple repos or monorepo subdirectories.

Current behaviour

The statusline JSON input includes:

  • workspace.current_dir — current working directory
  • workspace.project_dir — directory where Claude Code was launched

Neither of these reflect directories added via /add-dir.

Proposed solution

Add a field to the statusline JSON, e.g.:

{
  "workspace": {
    "current_dir": "/home/user/project",
    "project_dir": "/home/user/project",
    "added_dirs": ["/home/user/other-repo", "/home/user/shared-lib"]
  }
}

This would allow statusline scripts and other tooling to display and react to the full set of directories in the session.

Alternatives considered

  • Tracking added directories manually via environment variables or wrapper scripts — fragile and doesn't capture interactive /add-dir usage
  • Reading session transcripts — no structured field for this exists there either

View original on GitHub ↗

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