Skip to content

Pi: ctx_* commands run in a completely different repo than the active worktree #545

@pablopunk

Description

@pablopunk

Platform

Pi

context-mode version

v1.0.123

Debug script output (REQUIRED)

I have no idea how to get this

Exact prompt that triggered the bug (REQUIRED)

Any prompt that causes Pi to use a ctx_* command.

Full error output (REQUIRED)

There is no explicit tool error. The bug is that ctx_* commands run in the wrong repository.

Reproduction steps

I usually use claude for work:

~/src/my-company/monorepo # main repo
~/.worktrees/monorepo/my-latest-worktree # single task worktree

But for personal projects I use pi:

~/src/fun-project
~/.worktrees/fun-project/new-feature

Right now I’m using pi in ~/.worktrees/fun-project/new-feature and all ctx commands run inside ~/src/my-company/monorepo.

ctx_purge also did not work.

Running context-mode with claude on the same personal-project worktree does work.

Expected behavior

ctx_* commands should run against the active Pi worktree.

Actual behavior

ctx_* commands run against a completely different repository.

Additional context

I’m opening this as requested in the last comment on #434.

I had already upgraded before commenting there, and my original screenshots/repro were already on the newer version suggested at the time. Upgrading did not resolve the issue for me.

Per the reply on #434, this seems distinct from the worktree hash bug fixed by #435 and instead looks like a Pi-side cwd leak / wrong cwd propagation between Pi and context-mode.

Feedback

Fun fact, I was trying pi to create an issue on github from the thread above, and no matter how much I tried instructing it, it would not do it following the actual issue that I was having. The fact that it was using ctx_* tools for everything made it so powerless, and literally unable to understand what I was talking about.

Something as simple as reading a github thread with 4 comments was impossible using ctx (at least, with pi). I uninstalled context-mode and it immediately did everything I asked.

I'll keep this issue open in case someone else runs into it, but unfortunately for now I will stop using this tool. I hope it gets better since I really like the idea. But it's not for me, at least for now.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions