rejoin

A workflow step that removes a separate Git worktree and keeps its branch in the main repository after rebasing it onto develop.

In plain words
What is it for?
Use it after work in a worktree to return the branch to the main repository, rebase it onto develop, and preserve it as a local branch.
Why use it?
It lets you continue with the branch in the main checkout without reinstalling dependencies or rebuilding editor indexes for the separate worktree.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/circui-try/circuit/rejoin
Any agent
npx skills add CIrcui-try/Circuit --skill rejoin
Clone the repo
git clone --depth 1 https://github.com/CIrcui-try/Circuit

Made for: Claude Code, Codex.

Per session 48 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,521 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00048 $0.01521
Opus 5 $0.00024 $0.00760
Sonnet 5 $0.00010 $0.00304
Haiku 4.5 $0.00005 $0.00152

Measured 2d ago against content hash 081898e9e1f3, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

rejoin scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.agents/skills/rejoin/SKILL.md · 53 lines

How it starts

The opening of the file, as written. The whole thing — 53 lines — stays where its author put it; the contents beside it link to each section on GitHub.

PR 머지 여부와 무관하게, 워크트리에서 빠져나와 진행 중인 브랜치를 메인 레포에 develop 위로 리베이스된 로컬 브랜치로 보존한다. 워크트리는 별도 디렉토리라 의존성 설치·빌드 캐시·IDE 인덱싱을 다시 해야 하므로, 메인 레포(이미 갖춰진 환경)로 항로를 다시 잡고 그쪽에서 작업을 이어가거나 다른 브랜치로 컨텍스트 스위칭하기 위함이다.

$ARGUMENTS 형식: [ISSUE-ID 또는 branch]. 예: /rejoin, /rejoin CIR-15, /rejoin feature/cir-15-fix-....

인자를 생략하면 현재 대화 컨텍스트에서 가장 최근에 작업한 브랜치 / PR / 티켓을 대상으로 한다. 예를 들어 직전에 /takeoff CIR-94 로 PR을 만들었다면, /rejoinCIR-94의 브랜치를 찾아 재합류한다.

자기 단계 실행 절차

  1. 호출 컨텍스트 캡처: 메인 레포로 이동하기 전에 CURRENT_BRANCH = $(git branch --show-current) 로 호출 위치의 브랜치를 저장한다. 이 값은 인자와 대화 컨텍스트에서 대상을 찾지 못했을 때의 마지막 후보로만 사용한다.
  2. 메인 레포로 이동: MAIN_REPO_ROOT = $(git rev-parse --path-format=absolute --git-common-dir | xargs dirname)cd $MAIN_REPO_ROOT.
  3. 대상 결정:
    • $ARGUMENTS 가 있으면 기존처럼 첫 토큰을 대상 문자열로 사용한다.
    • $ARGUMENTS 가 비어있으면 현재 대화 컨텍스트에서 가장 최근에 작업한 항목을 찾는다. 우선순위는 (1) 가장 최근에 명시된 작업 브랜치명, (2) 가장 최근에 생성/언급한 PR의 head 브랜치명, (3) 가장 최근에 작업한 Linear 이슈 키, (4) CURRENT_BRANCH 순서다.
    • 컨텍스트에서 PR URL/번호만 알 수 있고 head 브랜치명이 대화에 남아있지 않으면, 원격 조회(gh pr view)는 하지 말고 같은 컨텍스트에 함께 언급된 이슈 키를 사용한다. 이슈 키도 없으면 사용자에게 직접 입력받는다.
    • 자동 선택한 대상은 실행 전에 한 줄로 출력한다. 예: rejoin target inferred from recent context: CIR-94.
  4. 브랜치명 결정:
    • 대상 문자열이 CIR-/PROJ- 같은 이슈 키 패턴이면 Linear MCP get_issuegitBranchName 을 조회.
    • 대상 문자열에 / 가 포함되어 있거나 로컬 브랜치로 존재하면 그대로 브랜치명으로 사용한다.
    • 둘 다 실패하면 사용자에게 직접 입력받는다.
  5. 방어: <branch>develop / main 이면 거부하고 중단.
  6. 워크트리 탐색: git worktree list --porcelain 으로 <branch> 가 체크아웃된 워크트리 경로 확인.
    • 워크트리가 없고 로컬 브랜치만 존재 → 사용자에게 "워크트리가 없는데 develop 위로 리베이스만 진행할까요?" 확인 후 진행.
    • 워크트리도 로컬 브랜치도 없으면 중단.
  7. 워크트리 미커밋 변경 체크: 해당 워크트리 안에서 git status --porcelain 결과가 비어있지 않으면 "미커밋 변경이 있습니다 — 커밋/스태시 후 다시 실행해주세요" 안내 후 중단. 자동 stash 금지.
  8. develop 최신화 (메인 레포): git fetch origin developgit checkout developgit pull --ff-only origin develop.
    • fast-forward 실패 시 사용자 위임 후 중단.
  9. 워크트리 제거: git worktree remove .Codex/worktrees/<branch>.
    • 잠김/실패 시 사용자 확인 후 --force.
  10. 브랜치 리베이스 (메인 레포):
  • git checkout <branch>.
  • git rebase origin/develop.
  • 충돌 발생 시: 자동 해결 시도하지 말고 "리베이스 충돌 상태 — 해결 후 git rebase --continue 또는 git rebase --abort" 안내 후 중단. 메인 레포의 HEAD 는 리베이스 진행 중 상태로 둔다.
  1. 티켓 상태 동기화: 이슈 키를 확인할 수 있고 이슈가 Done/Canceled 가 아니면 Linear 상태를 In Progress 로 직접 유지한다. rejoin 은 작업 보존 단계이므로 Done 으로 바꾸지 않는다.
  2. 상태 파일 정리(있으면): 대상 이슈 키를 확인할 수 있고 .Codex/state/<ISSUE>.* 잔재가 있으면 함께 삭제. (보통 takeoff 후 호출되므로 잔재 없음.)
  3. 요약 출력: <branch> 가 develop 보다 N 커밋 앞섬 (git rev-list --count origin/develop..<branch>), HEAD 해시, 삭제된 워크트리 경로, "원격에는 영향 없음 (push 미수행)" 한두 문장으로 안내.

Read the full file on GitHub · 53 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 53 lines · 48 tokens per session scan A 081898e9e1f3

Subscribe to this mod's changes

rejoin is a skill published in the GitHub repository CIrcui-try/Circuit (5 stars, last pushed 3mo ago), licensed MIT. It adds 48 tokens to every session and 1,521 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.