opencode icon indicating copy to clipboard operation
opencode copied to clipboard

list tool returns empty directory for readable hidden directories

Open uptownhr opened this issue 1 month ago • 5 comments

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

uptownhr avatar Nov 24 '25 10:11 uptownhr

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 avatar Nov 24 '25 13:11 rekram1-node

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 avatar Dec 09 '25 23:12 kokokodi

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 avatar Dec 09 '25 23:12 rekram1-node

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 avatar Dec 11 '25 00:12 kokokodi

just set:

tools: list: false

in ur json config

rekram1-node avatar Dec 11 '25 00:12 rekram1-node