[BUG] Custom Slash Commands Not Loading on Termux
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Custom slash commands placed in .claude/commands/ are not being discovered or loaded when running Claude Code in Termux on Android. The exact same file structure works perfectly on a standard Linux x86_64 system.
Commands fail to load whether placed in:
- Root directory:
.claude/commands/test.md - Subdirectories:
.claude/commands/agent-os/*.md
The SlashCommand tool also cannot access these commands, returning Unknown slash command errors.
What Should Happen?
Custom slash commands defined in .claude/commands/ should be automatically discovered when Claude Code starts and be available for use via /command-name syntax.
This behavior works correctly on Linux x86_64 with the same Claude Code version (2.0.14) and identical file structure.
Error Messages/Logs
Unknown slash command: test
When using SlashCommand tool programmatically:
Unknown slash command: test
Steps to Reproduce
- Install Claude Code 2.0.14 in Termux on Android:
``bash``
npm install -g @anthropic/claude-code
- Create a test directory with
.claude/commands/structure:
``bash``
mkdir -p teste/.claude/commands
cd teste
- Create a simple test command file
.claude/commands/test.md:
```markdown
# Test Command
This is a test command to verify if commands work.
Just respond with "Test command works!"
```
- Set proper permissions (matching working Linux system):
``bash``
chmod 755 .claude .claude/commands
chmod 644 .claude/commands/test.md
- Verify file is correct:
``bash``
file .claude/commands/test.md
# Output: Unicode text, UTF-8 text
- Start Claude Code:
``bash``
claude
- Try to use the command by typing
/test
Expected: /test command should be available and executable
Actual: Command is not discovered or loaded at all
Also tested with subdirectories (e.g., .claude/commands/agent-os/new-spec.md) - same result.
Claude Model
Sonnet (default)
Is this a regression?
No, this never worked
Last Working Version
_No response_
Claude Code Version
2.0.14 (Claude Code)
Platform
Anthropic API
Operating System
Other
Terminal/Shell
Xterm
Additional Information
SECTION: Operating System
Broken Environment (where bug occurs):
- OS: Android/Termux (aarch64)
- Kernel: Linux localhost 6.1.115-android14-11-ga2521ca27699-ab13294383
- Node.js: v24.9.0
Working Environment (for comparison):
- OS: Linux x86_64 (openSUSE)
- Kernel: 6.17.0-2-default
- Node.js: v24.1.0
- Same Claude Code version: 2.0.14
---
SECTION: Terminal/Shell
(Which terminal are you using?)
- Terminal: Termux
- Shell: bash (
/data/data/com.termux/files/usr/bin/bash) - TERM: xterm-256color
---
SECTION: Additional Information
(Anything else that might help us understand the issue?)
Investigation Performed
System commands verified present:
find(GNU findutils 4.10.0)ls(GNU coreutils 9.8)cat,stat,readlink,realpath,file(5.46-2)
File verification:
- Encoding: UTF-8 (verified with
fileandhexdump) - No hidden characters or corruption
- Permissions match working Linux system (755 for dirs, 644 for files)
Attempted fixes (none worked):
- Restarted Claude Code multiple times
- Fixed permissions to match working system
- Installed missing
filecommand - Moved commands from subdirectory to root
- Tried SlashCommand tool programmatically - also fails
File structure tested:
.claude/
├── commands/
│ ├── test.md # Doesn't load
│ ├── newspec.md # Doesn't load
│ └── agent-os/ # Subdirectory
│ ├── new-spec.md # Doesn't load
│ └── [other .md] # Don't load
└── agents/
└── agent-os/ # Custom agents also not loading
└── [.md files]
Hypothesis
Possible root causes:
- Path resolution - Termux uses non-standard paths (
/data/data/com.termux/files/...) - File system differences - Android file system handling may differ
- Native dependencies - Some native module behaving differently on ARM64 Android
- Node.js in Termux - File system operations may work differently
Impact
This prevents Termux users from using custom slash commands and agents - a core extensibility feature. Given Termux's popularity among mobile developers, this significantly limits Claude Code's usefulness on Android devices.
Workaround
None available for Termux users. Only workaround is to use standard Linux x86_64 system.
This issue has 9 comments on GitHub. Read the full discussion on GitHub ↗