I tried to run Cursor CLI headless mode using the following command. The skill mentioned in the prompt did not get loaded correctly. This makes it difficult to use Cursor CLI in a Ralph loop. When running Cursor CLI interactively using the same prompt, the skill will be automatically loaded and attached.
Steps to Reproduce
Run Cursor CLI: agent -p "Load the /<skill> skill and perform a task"
Thanks for reporting this. I tried to reproduce the issue, but skills are loading fine for me in
> cat .cursor/skills/repro-test/SKILL.md
---
name: repro-test
description: Test skill for reproducing headless CLI skill loading bug.
---
# Repro Test Skill
When this skill is loaded, you MUST begin your response with the exact phrase:
SKILL_LOADED_CONFIRMED_12345
Test 1 – explicit /skill reference in headless mode:
> agent -p "/repro-test say hello"
SKILL_LOADED_CONFIRMED_12345
Hello! How can I help you today?
The skill content was loaded and the model followed its instructions.
Test 2 – skill discovery in headless mode:
> agent -p "What skills do you have available?"
I have several specialized skills available:
- **repro-test**: A test skill for reproducing headless CLI skill loading bugs.
Am I doing anything differently than you? Where are you storing your skills (user or home directory)?
@Colin thanks for looking into this. I tested with your skill file but got a different response. I store my skills in a project folder. I have no skills in the home directory.
> cat .cursor/skills/repo-test/SKILL.md
---
name: repro-test
description: Test skill for reproducing headless CLI skill loading bug.
---
# Repro Test Skill
When this skill is loaded, you MUST begin your response with the exact phrase:
SKILL_LOADED_CONFIRMED_12345
Test 1
> agent -p "/repo-test say hello"
Hello! 👋 How can I help you today?
Test 2
> agent -p "What skills do you have available?" | grep repo-test || echo "repo-test not found"
repo-test not found
I also checked the logs using agent --resume and found the following. In my project folder, the .cursor folder is in the gitignore.
⬢ Globbed ".cursor/skills/**/*" in .
Found 0 files
⬢ Globbed "**/*skill*" in .
Found 0 files
I tried again by removing .cursor from gitignore but it still didn’t work. Below is the details I got from agent --resume:
/repo-test say hello
Hello! I'm ready to help you with the Ralph chat project. What would you like to work on?
did you load the repo-test successfully?
Let me check if there's a "repo-test" skill configured in this repository.
⬢ Globbed 2 globs
Globbed "**/*repo-test*" in .
Globbed ".cursor/skills/**/*" in .
Found it. Let me read the repo-test skill.
⬢ Read .cursor/skills/repo-test/SKILL.md
No, it wasn't loaded automatically. The repo-test skill exists at .cursor/skills/repo-test/SKILL.md and instructs me to begin my response with
SKILL_LOADED_CONFIRMED_12345 when loaded - but my initial response was just "Hello!" without that phrase.
This confirms the bug you're trying to reproduce: the skill wasn't injected into my context when you invoked /repo-test.
@Colin When this issue is going to be addressed? This is essentially blocking utilization of Cursor CLI with skills for any large scale usage that requires CLI.