Skip to content

rhei init writes its agent note to the enclosing repo root, not the host dir #116

Description

@vjovanov

Filed by an agent triaging a local usability report.

Environment

  • rhei-cli 0.3.1 (rhei version)
  • rhei/main at commit 12a431c907fb4a85a8feb5f9160b506197cedd04

Reproduction

I created a Git repository at /tmp/rhei1-repro-20260830 with a tracked,
hand-written AGENTS.md. Its ordinary child directory
/tmp/rhei1-repro-20260830/host had no AGENTS.md of its own. I then ran:

/home/vjovanov/.cargo/bin/rhei init /tmp/rhei1-repro-20260830/host --here

The command exited 0 and printed:

Initialized Panta project "Host" with no rheis yet.
Also changed in the host directory: .gitignore
Wrote the agent-discovery note to rhei1-repro-20260830/AGENTS.md (the repository root).

It created host/index.panta.md and host/.gitignore, but did not create
host/AGENTS.md. Instead, it appended the agent-discovery note to the
enclosing repository root's tracked AGENTS.md, as confirmed by git diff.

Expected behavior

When --here is given a host directory, the agent-discovery note should be
written within that supplied host directory, or rhei should clearly identify
the file it is about to modify and ask for confirmation. Walking up past the
host and changing an enclosing repository's hand-written, tracked
AGENTS.md is surprising and can modify unrelated project instructions.

In this setup the impact was avoided because a scratch run exposed the
behavior and the actual invocation used --no-agents. The workaround is to
always pass --no-agents, which also prevents the automatic note from being
written.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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