Skip to content

feat: Improve multiclaude refresh with agent-context awareness#339

Open
aronchick wants to merge 1 commit intodlorenc:mainfrom
aronchick:work/brave-bear
Open

feat: Improve multiclaude refresh with agent-context awareness#339
aronchick wants to merge 1 commit intodlorenc:mainfrom
aronchick:work/brave-bear

Conversation

@aronchick
Copy link
Copy Markdown
Contributor

Summary

  • Agent-context aware refresh: When run inside an agent worktree, multiclaude refresh now syncs just that worktree directly with immediate feedback
  • --all flag: Explicitly triggers global daemon-based refresh (previous behavior)
  • Updated /refresh slash command: Now recommends the CLI method as the quick path

Changes

File Change
internal/cli/cli.go Added context detection and direct worktree refresh
internal/prompts/commands/refresh.md Added "Quick Method" section recommending CLI

Behavior

Context Action
Inside agent worktree Refreshes that worktree directly with detailed output
Outside agent context Triggers daemon-based global refresh
With --all flag Always triggers daemon-based global refresh

Test plan

  • Build compiles successfully
  • All worktree tests pass
  • All daemon refresh tests pass
  • CLI help shows updated usage

Roadmap

P0 item: Worktree sync - Keep agent worktrees in sync with main as PRs merge

🤖 Generated with Claude Code

When run inside an agent worktree, `multiclaude refresh` now syncs just
that worktree directly instead of triggering a global refresh via daemon.
This gives agents immediate feedback and control over their sync process.

Changes:
- Add context detection: automatically identifies agent worktree from cwd
- Add direct refresh: syncs single worktree using worktree.RefreshWorktree()
- Add --all flag: explicitly triggers global refresh (previous behavior)
- Update /refresh slash command to recommend CLI method
- Provide detailed output: fetch status, rebase info, conflict handling

Behavior:
- Inside agent worktree: refreshes that worktree directly with feedback
- Outside agent context: triggers daemon-based global refresh
- With --all flag: always triggers daemon-based global refresh

P0 Roadmap item: Worktree sync

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@aronchick
Copy link
Copy Markdown
Contributor Author

Merge Queue: READY TO MERGE

  • CI: All 6 checks passing
  • Merge status: MERGEABLE/CLEAN
  • Reviews: None blocking

This PR is ready for maintainer merge.

@aronchick aronchick marked this pull request as ready for review January 31, 2026 21:26
whitmo added a commit to whitmo/multiclaude that referenced this pull request Mar 1, 2026
whitmo added a commit to whitmo/multiclaude that referenced this pull request Mar 1, 2026
…(context-aware refresh)

13 new tests covering token-aware status display, LongDescription help,
handleListRepos enriched response, context-aware refresh path detection,
--all flag parsing, and worktree path edge cases.

Findings documented at /tmp/swarm-tests-338-339.md including:
- PR dlorenc#338 depends on unmerged ForkConfig PR
- PR dlorenc#339 symlink handling is correct
- Both PRs are independent with no conflicts

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
whitmo added a commit to whitmo/multiclaude that referenced this pull request Mar 1, 2026
…c#333 on pr-triage-b2

Tests from multiclaude workers (silly-otter, lively-otter, clever-bear):
- PR dlorenc#338: Token-aware status display, hibernate help, rich list_repos response
- PR dlorenc#339: Context-aware refresh, worktree path detection, --all flag parsing
- PR dlorenc#337: Categorized help (worker report captured, tests via CLI assertions)
- PR dlorenc#333: Enhanced repair (worker report captured, daemon handler tests)

Co-Authored-By: Claude Opus 4.6 <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