thread-workspace-relink

thread-workspace-relink is a skill for Claude Code, Codex from Adam-Bull/Codex-thread-toolkit. It costs 70 tokens per session (845 once invoked), scanned A, original, MIT.

A procedure for updating Codex thread records after a workspace folder has been renamed or moved. It changes the saved folder paths in session files and the local thread database.

In plain words
What is it for?
Previewing affected threads, making a backup-backed path migration, checking the results, and refreshing Codex so the sidebar uses the new workspace path.
Why use it?
It fixes chats that still point to the old folder, show that the working directory is missing, or open in the wrong location.

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/adam-bull/codex-thread-toolkit/thread-workspace-relink
Any agent
npx skills add Adam-Bull/Codex-thread-toolkit --skill thread-workspace-relink
Clone the repo
git clone --depth 1 https://github.com/Adam-Bull/Codex-thread-toolkit

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for thread-workspace-relink

README.md
[![agentmods](https://agentmods.dev/badge/skills/adam-bull/codex-thread-toolkit/thread-workspace-relink.svg)](https://agentmods.dev/skills/adam-bull/codex-thread-toolkit/thread-workspace-relink)
Your own site
<a href="https://agentmods.dev/skills/adam-bull/codex-thread-toolkit/thread-workspace-relink"><img src="https://agentmods.dev/badge/skills/adam-bull/codex-thread-toolkit/thread-workspace-relink.svg" alt="Measured on agentmods" height="20"></a>
Per session 70 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 845 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.00070 $0.00845
Opus 5 $0.00035 $0.00423
Sonnet 5 $0.00014 $0.00169
Haiku 4.5 $0.00007 $0.00085

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

Security

Grade A, and why

thread-workspace-relink 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 5d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/relink_thread_workspaces.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

skills/thread-workspace-relink/SKILL.md · 111 lines

How it starts

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

Use this skill to migrate Codex thread workspace paths from old_path to new_path safely and repeatably.

Workflow

  1. Confirm target and scope
  • Collect old_path and new_path.
  • Decide scope: all affected threads or selected thread_ids.
  1. Run dry-run first
  • Use script in scripts/relink_thread_workspaces.py with --mode dry-run.
  • Review affected counts and files before writing.
  1. Apply with backup
  • Run with --mode apply.
  • Script creates timestamped backup under ~/.codex/path_rename_backup_*.
  • Script updates:
    • Session JSONL cwd fields (sessions/, archived_sessions/)
    • State DB threads.cwd in ~/.codex/state_*.sqlite
  1. Verify
  • Confirm old count is 0 for migrated scope.
  • Spot-check requested thread IDs.
  • If no compatible DB is discovered, run --diagnose and inspect db_search_roots, db_candidates, and compatible_dbs.
  1. Refresh UI
  • Quit/reopen Codex after apply so sidebar grouping refreshes.

Commands

Dry-run all:

python3 scripts/relink_thread_workspaces.py \
  --old "/old/path" \
  --new "/new/path" \
  --mode dry-run \
  --scope all

Apply all:

python3 scripts/relink_thread_workspaces.py \
  --old "/old/path" \
  --new "/new/path" \
  --mode apply \
  --scope all

Dry-run selected thread IDs:

python3 scripts/relink_thread_workspaces.py \
  --old "/old/path" \
  --new "/new/path" \
  --mode dry-run \
  --scope ids \
  --ids "id1,id2,id3"

Apply selected thread IDs:

python3 scripts/relink_thread_workspaces.py \
  --old "/old/path" \
  --new "/new/path" \
  --mode apply \
  --scope ids \
  --ids "id1,id2,id3"

Diagnose DB discovery:

python3 scripts/relink_thread_workspaces.py \
  --old "/old/path" \
  --new "/new/path" \
  --mode dry-run \
  --scope all \
  --diagnose

Deep diagnostics (recommended for issue triage):

python3 scripts/relink_thread_workspaces.py \
  --old "/old/path" \
  --new "/new/path" \
  --mode dry-run \
  --scope all \
  --diagnose-deep

Read the full file on GitHub · 111 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 5d ago First seen · 111 lines · 70 tokens per session scan A 1c6e3f4f4963

Subscribe to this mod's changes

thread-workspace-relink is a skill published in the GitHub repository Adam-Bull/Codex-thread-toolkit (32 stars, last pushed 4mo ago), licensed MIT. It adds 70 tokens to every session and 845 once invoked, about $0.0003 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-30.