list tool returns empty directory for readable hidden directories #3086

Open
opened 2026-02-16 17:38:33 -05:00 by yindo · 5 comments
Owner

Originally created by @uptownhr on GitHub (Nov 24, 2025).

Originally assigned to: @rekram1-node on GitHub.

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
Originally created by @uptownhr on GitHub (Nov 24, 2025). Originally assigned to: @rekram1-node on GitHub. ## 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
Author
Owner

@rekram1-node commented on GitHub (Nov 24, 2025):

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

@rekram1-node commented on GitHub (Nov 24, 2025): 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
Author
Owner

@kokokodi commented on GitHub (Dec 9, 2025):

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)?

@kokokodi commented on GitHub (Dec 9, 2025): 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)?
Author
Owner

@rekram1-node commented on GitHub (Dec 9, 2025):

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

@rekram1-node commented on GitHub (Dec 9, 2025): > 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
Author
Owner

@kokokodi commented on GitHub (Dec 10, 2025):

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).

@kokokodi commented on GitHub (Dec 10, 2025): > > 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).
Author
Owner

@rekram1-node commented on GitHub (Dec 10, 2025):

just set:

tools:
list: false

in ur json config

@rekram1-node commented on GitHub (Dec 10, 2025): just set: tools: list: false in ur json config
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#3086