Skip to content

fix(cli): find marimo-pair skill from subdirectories of the repo root - #10704

Open
jungleBadger wants to merge 1 commit into
marimo-team:mainfrom
jungleBadger:fix/claude-skill-dir-parent-walk
Open

fix(cli): find marimo-pair skill from subdirectories of the repo root#10704
jungleBadger wants to merge 1 commit into
marimo-team:mainfrom
jungleBadger:fix/claude-skill-dir-parent-walk

Conversation

@jungleBadger

@jungleBadger jungleBadger commented Aug 30, 2026

Copy link
Copy Markdown

Problem

marimo pair prompt --claude reports the marimo-pair skill as missing whenever it is
run from a subdirectory of the project, even when the skill is correctly installed at
<repo>/.claude/skills/marimo-pair/SKILL.md:

$ cd my-project && marimo pair prompt --url http://localhost:2718 --claude
# (no warning — skill found)

$ cd my-project/notebooks && marimo pair prompt --url http://localhost:2718 --claude
The marimo-pair skill for Claude Code could not be found.

Please install it with:

  npx skills add marimo-team/marimo-pair

Same project, same install. Running the command from anywhere below the root — which is
common, since notebooks often live in a subdirectory — tells the user to reinstall a
skill they already have.

Cause

_claude_skill_dirs() builds its roots from Path.cwd() / ".claude" only. Claude Code
resolves project skills from .claude/skills in the directory it was started in and in
every parent directory up to the repository root
, so a skill installed once at the root
applies to every subdirectory. The validator checked a single directory where Claude Code
checks a chain.

Fix

Add _claude_project_roots(), which walks from the current directory up to the repository
root and returns each .claude along the way. It stops at the root rather than continuing
to unrelated ancestors, and treats a .git file as a root so worktrees and submodules
resolve correctly. Outside a repository there is no root to walk to, so only the current
directory applies — matching the previous behaviour for that case.

~/.claude is still checked, and the plugin/marketplace subdirectory handling is unchanged.

Tests

_claude_skill_dirs() had no coverage, which is how this went unnoticed. Added
TestClaudeProjectRoots with five cases: the parent walk itself, the end-to-end
"skill at root, found from a subdirectory" regression, the stop-at-root boundary,
.git-as-a-file, and the no-repository fallback.

Verified the regression test fails without the fix and passes with it, using only the
pre-existing _claude_skill_dirs() / AgentConfig API:

UNFIXED source: 1 failed
FIXED source:   1 passed

tests/_cli/test_cli_pair.py — 31 passed. ruff check, ruff format --check, and
mypy marimo/_cli/pair/commands.py all clean. The wider tests/_cli/ suite has 7
failures in test_cli_export.py (test_export_watch_*_no_out_dir) that reproduce
identically on an unmodified checkout of main, so they are unrelated to this change.

Related

Same class of path-resolution mismatch as previous fixes to this function, and not covered
by any of them:

This is the project-root dimension: all three above corrected which directories are
checked, while .claude project roots were still resolved from Path.cwd() alone.

Note

Drafted with AI assistance; disclosed via a Co-Authored-By trailer on the commit. Happy
to drop the trailer or restructure if that conflicts with project preference.

`marimo pair prompt --claude` reported the marimo-pair skill as missing
whenever it ran below the repository root, even with the skill correctly
installed at `<repo>/.claude/skills/marimo-pair/`.

`_claude_skill_dirs()` only considered `Path.cwd() / ".claude"`, but Claude
Code resolves project skills from the start directory and every parent up to
the repository root. Walk the same path so a skill installed once at the root
is found from any subdirectory, stopping at the root rather than escaping to
unrelated ancestors.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Aug 30, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
marimo-docs Ready Ready Preview Aug 30, 2026 2:49pm

Request Review

@github-actions

github-actions Bot commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@jungleBadger

jungleBadger commented Aug 30, 2026

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

@jungleBadger
jungleBadger marked this pull request as ready for review August 30, 2026 14:51
@jungleBadger
jungleBadger marked this pull request as draft August 30, 2026 20:54
@jungleBadger
jungleBadger marked this pull request as ready for review August 30, 2026 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant