Skip to content

list tool returns empty directory for readable hidden directories #4689

Closed

Description

@uptownhr

Description

The list tool returns an empty directory listing for directories that are readable but have restrictive permissions, even when the user is the owner.

Steps to Reproduce

  1. Create a hidden directory with 700 permissions (owned by current user)
  2. Add files inside the directory
  3. Use the list tool to read the directory

Expected Behavior

The list tool should enumerate all files in the directory, matching the output of bash ls

Actual Behavior

The list tool returns an empty directory listing, while bash ls correctly shows the files.

Example

Directory: .claude/commands/ (permissions: drwxrwxr-x)

  • Owner: uptown (current user)
  • Files exist: add-frontmatter.md, cross-link.md, execute.md, etc.
  • bash ls output: Shows all 10 files
  • list tool output: Empty (no files listed)

Environment

  • Platform: Linux
  • Tool: OpenCode list command
  • Working directory: /home/uptown/Projects/research

Activity

  1. rekram1-node commented on Nov 24, 2025

    @rekram1-node
    Collaborator

    the list tool uses ripgrep, ripgrep respects your .gitignore could that be the issue?

    You can make exclusions to this by making a .ignore file and putting something like:

    !.claude/….

    and then list tool can read that dir

  2. kokokodi commented on Dec 9, 2025

    @kokokodi

    the list tool only lists the subfolders that have files in them. In other words does not list empty folders. Only when I ask model to run bash tool it creates a correct list of the working folder content. BTW, can we edit system prompt to leave those tools that work (and avoid having to write to the prompt every time to use the bash tool to be able to see folders)?

  3. self-assigned this
    on Dec 9, 2025
  4. rekram1-node commented on Dec 9, 2025

    @rekram1-node
    Collaborator

    can we edit system prompt to leave those tools that work

    Idk what that means

    the list tool only lists the subfolders that have files in them

    Okay we can fix that

  5. kokokodi commented on Dec 11, 2025

    @kokokodi

    can we edit system prompt to leave those tools that work

    Idk what that means

    I was just wondering how I could disable that built-in List tool (at least until it is fixed).

  6. rekram1-node commented on Dec 11, 2025

    @rekram1-node
    Collaborator

    just set:

    tools:
    list: false

    in ur json config

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions