Skip to content

fix(identity): never guess an agent from a broad folder; amp-init --remember - #42

Merged
jpelaez-23blocks merged 1 commit into
mainfrom
fix/identity-no-broad-dir-guess
Oct 16, 2026
Merged

jpelaez-23blocks merged 1 commit into
mainfrom
fix/identity-no-broad-dir-guess

Conversation

@jpelaez-23blocks

Copy link
Copy Markdown
Contributor

Reported by an agent that ran amp-init --name sebastian: amp-identity then answered as a different agent (the AI Maestro agent that owns /private/tmp), and the status line said "not configured (run amp-init)" for a session that had just never been named.

  • Folder lookup (amp-helper.sh, amp-statusline.sh): a broad owner (/, /tmp, /private/tmp, /Users, /home, $HOME, its parent) matches only the exact folder, never a folder below it. Project folders still match below.
  • amp-init: sends the project folder as metadata.working_directory when registering (never a broad one); new --remember writes env.CLAUDE_AGENT_NAME into the folder's .claude/settings.local.json, keeping other settings, refusing a broad folder or a non-JSON file; prints the one command that makes it stick.
  • Status line: "this session has no agent name (set CLAUDE_AGENT_NAME, or run amp-init --name --remember)"; a named agent without an address still says "not configured".
  • The "Multiple AMP agents found" error says how to name the session once.

12 new bats tests (tests/unit/session_identity.bats); they fail on the old scripts. Full suite: 321 pass.

🤖 Generated with Claude Code

…emember; clearer status line

A session below a folder that one agent owns was named after that agent, even when
the folder was $HOME or /tmp, so amp-identity answered as an unrelated agent. A broad
folder now matches only the exact folder. amp-init registers the project folder, and
--remember writes CLAUDE_AGENT_NAME into the folder's .claude/settings.local.json so
later sessions know who they are. The status line says a session has no name instead
of 'not configured (run amp-init)'.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@jpelaez-23blocks
jpelaez-23blocks merged commit 4f01365 into main Oct 16, 2026
2 checks passed
@jpelaez-23blocks
jpelaez-23blocks deleted the fix/identity-no-broad-dir-guess branch October 16, 2026 01:55
@jpelaez-23blocks jpelaez-23blocks mentioned this pull request Oct 16, 2026
jpelaez-23blocks added a commit that referenced this pull request Oct 16, 2026
Version bump for #42 (broad-folder identity guess fix, amp-init
--remember, clearer status line).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Juan Pelaez <juan.pelaez@3metas.com>
Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
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