agentleFS
strikersamstrikersam/autonomous-ai-agency/.agents/skills/duplicate-thread/SKILL.md

duplicate-thread

Skill9 starsChanged 3 months agoMITView on GitHub

Claude will: 1. Copy the current PLAN.md / CONTEXT.md to a new thread folder 2. Apply the requested change only in the fork 3. Proceed with the forked version, noting the original thread ID in meta.json If the fork succeeds and you want to merge learnings back: 1. Compare PLAN.md diffs between fork and original 2. Update the original CONTEXT.md with lessons learned 3. Archive the fork: set "status": "merged" in meta.json If the fork fails: 1. Set "status": "abandoned"…

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    If the fork succeeds and you want to merge learnings back:

    line 70
  2. Very specific:

    Update the original CONTEXT.md with lessons learned

    line 72
  3. Distinctive:

    If the fork fails:

    line 75

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Skill: duplicate-thread

Purpose

Clone an existing plan, task thread, or agent session so you can explore an alternative approach without losing the original. Analogous to "duplicate thread" in Copilot's mission control.

When to Use

  • You want to try a risky refactor without throwing away the current plan
  • A/B testing two implementation strategies in parallel
  • Resuming a stalled task from a known-good checkpoint with different parameters
  • Forking a plan for a different target environment (e.g., prod vs. staging)

How It Works

  1. Identify the source thread — a .claude/threads/<id>/ directory, a plan file, or a PLAN.md
  2. Copy it to a new thread ID with a meaningful suffix
  3. Stamp it with metadata (source thread, fork reason, timestamp)
  4. Continue in the new thread independently

Thread Directory Convention

.claude/threads/
  <thread-id>/
    PLAN.md          # the plan or task description
    CONTEXT.md       # accumulated context
    CHECKPOINT.md    # last known-good state (from checkpoint-strategy skill)
    meta.json        # thread metadata

Usage

Manual duplication

bash .agents/skills/duplicate-thread/duplicate.sh <source-thread-id> <reason>

Example:

bash .agents/skills/duplicate-thread/duplicate.sh plan-2025-01-15 "try-async-approach"
# Creates: .claude/threads/plan-2025-01-15--fork-try-async-approach/

In a Claude prompt

Duplicate the current thread as "alternative-auth-strategy" and in the fork,
replace the JWT approach with session cookies. Keep the original intact.

Claude will:

  1. Copy the current PLAN.md / CONTEXT.md to a new thread folder
  2. Apply the requested change only in the fork
  3. Proceed with the forked version, noting the original thread ID in meta.json

meta.json Schema

{
  "thread_id": "plan-2025-01-15--fork-try-async-approach",
  "forked_from": "plan-2025-01-15",
  "fork_reason": "try-async-approach",
  "forked_at": "2025-01-15T10:30:00Z",
  "status": "active"
}

Merging Back

If the fork succeeds and you want to merge learnings back:

  1. Compare PLAN.md diffs between fork and original
  2. Update the original CONTEXT.md with lessons learned
  3. Archive the fork: set "status": "merged" in meta.json

If the fork fails:

  1. Set "status": "abandoned" in meta.json
  2. Return to the original thread — it is untouched

Integration

Pairs well with:

  • checkpoint-strategy — always checkpoint before duplicating
  • parallel-agents — run both threads simultaneously and compare
  • council-review — have the council evaluate both approaches and pick the winner
  • cooldown-resume — resume a forked thread after a pause

Files

  • SKILL.md — this file
  • duplicate.sh — shell helper to copy a thread

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.