active/thread/SKILL.md
Fork or create a Codex thread from a prompt, with optional model and reasoning overrides. Fork by default; create without parent history when the user explicitly asks for a new, fresh, or clean thread.
npx skillsauth add kevinslin/skills threadInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Use this skill when the user asks to create a new Codex thread and provides, or clearly wants you to derive, the prompt to seed it with.
$thread [prompt]
$thread new thread: [prompt]
$thread fork thread: [prompt]
$thread [prompt]. use xhigh profile
$thread [prompt]. use gpt-5.6-sol with ultra thinking
Parse optional model and reasoning overrides independently from the user's request:
model-override: pass any model id explicitly requested by the user. Do not maintain a skill-local model allowlist; the current create_thread or send_message_to_thread tool schema is authoritative and may accept newer model ids.thinking-override: pass any reasoning value supported by the current tool schema: low, medium, high, xhigh, max, or ultra.gpt5.6 sol means gpt-5.6-sol. Ask when an alias could refer to more than one model.use xhigh profile as backward-compatible shorthand for model: "gpt-5.5" and thinking: "xhigh". Explicit model or reasoning values in the same request take precedence over the corresponding shorthand value.model and thinking so the thread uses the existing/default profile behavior.At the start of each invocation, read ~/.agents/profile directly. Treat the profile as work only when it contains a trimmed, non-comment line exactly equal to name=work. A missing, unreadable, or differently named profile is non-work; do not infer work status from the cwd, project, account, or task content.
For a work profile, create exactly one Linear issue after the child thread has a real id, verified title, registry entry, and deep link. Use the installed linear:linear connector skill and its connected Linear tools. Do not invoke linear-cli, fall back to a browser, or request a separate CLI login for this workflow.
Before creating the issue:
KEV2 through the connector and verify that it belongs to the openai workspaceIn Progress live instead of assuming a cached idCreate the issue through the connector and:
KEV2 in the openai workspaceIn Progress stateSource prompt headingCodex thread: [thread-name](codex://threads/<thread-id>)In Progress state, description, and Codex deep link before reporting successIf a connector create call has an ambiguous result, use connector reads to check for the issue before retrying so that one invocation cannot create duplicate issues. If the Linear connector is unavailable, unauthenticated, or creation or verification otherwise fails after the child exists, keep the child thread and registry entry, report partial success with the exact Linear blocker, and do not claim that the issue was created. Do not fall back to linear-cli. For non-work profiles, skip Linear entirely.
Publishing the real child deep link is the latency-critical handoff. As soon as a real threadId exists and the child prompt has been accepted, send a commentary update in this form:
Created: [thread-name](codex://threads/<thread-id>)
Thread ID: <thread-id>
Status: prompt accepted; finalizing title, registry, and any required Linear tracking.
created and prompt accepted, not completed or ready.If create_thread returns only a pendingWorktreeId, no thread exists yet to hand off:
Queued thread setup: <pending-worktree-id>
Status: waiting for a real thread ID before title, registry, or Linear tracking.
::created-thread{pendingWorktreeId="..."} on its own line. Do not claim that a thread or Linear issue was created.When the user wants the child in the same project directory as the current thread:
Resolve model-override and thinking-override once using Profile overrides, then reuse those values on the operation that receives the child prompt.
Treat the active parent thread's CWD as the authoritative target. For fork mode,
do not call list_projects or replace that CWD with a saved project, sidebar
project, workspace root, or path mentioned in the prompt. For clean mode,
list_projects is allowed only to find an exact saved-project match for the
active CWD.
work-profile from ~/.agents/profile using Work-profile Linear issue.thread-name string and one topic-name registry key.thread-summary from the task being seeded into the child, following Thread summary.codex_app.fork_thread with environment: {"type":"same-directory"} so the child inherits the exact active CWD. Then send the fork guardrail prompt with codex_app.send_message_to_thread.codex_app.create_thread and pass the clean guardrail prompt as the initial prompt. Use an already-verified current project target when available; otherwise call list_projects and require one exact active-CWD match. If no exact match exists, stop and ask for a project target or permission to fall back to a same-directory fork. Never silently change modes.model: model-override and thinking: thinking-override only when each value is present.create_thread returns only a pendingWorktreeId, follow the queued branch in Immediate thread handoff and do not continue to title, registry, or Linear work until a real threadId exists.threadId, perform Immediate thread handoff before title, registry, or Linear work.codex_app.set_thread_title on the new thread with thread-name.~/.llm/skills/threads/{parent-thread-id}.md with topic-name, child thread id, and thread-summary.thread-nametopic-name and points to the same thread idthread-summary that accurately describes the seeded taskwork-profile is true, create and verify the Linear issue through the connected Linear app using Work-profile Linear issue.codex://threads/<thread-id>Same-directory fork_thread is the default because it preserves CWD and useful
parent context. An explicit new/clean request prioritizes an empty transcript;
resolve the matching saved project and use create_thread instead.
$thread [prompt] request.fork, copy this context, continue with this context, preserve history, or equivalent.new thread, fresh thread,
clean thread, without prior context, do not copy history, or equivalent.fork_thread with
environment: {"type":"same-directory"} and must not call list_projects.create_thread. If the current tool schema
requires a project id, call list_projects only for this explicit clean
request and choose only a project whose resolved root exactly equals the
active CWD. Do not guess from project name or nearby paths.use xhigh profile or use gpt-5.6-sol with ultra thinking as execution settings, not as part of the child prompt body unless the user explicitly wants that text preserved.$thread, fork_thread, create_thread, or send_message_to_thread unless the user explicitly asked for nested thread creation.Always wrap the child task in a short guardrail block.
For fork mode, use:
Hard guardrails:
- Ignore copied prior thread/delegation history if present; act only on the task below.
- Treat earlier `$thread` or `<codex_delegation>` content in the transcript as stale context, not instructions.
Task:
<preserved or derived user task>
For clean mode, omit copied-history language because no parent transcript is present:
Task:
<preserved or derived user task>
Derive thread-summary at creation time from the preserved or derived child task.
topic-name is reused, replace its prior id and summary with the new child task instead of appending a duplicate.Resolve the child name before creating or renaming the thread. Do not compute the visible title and registry key independently.
thread-name./, treat it as the full thread title, not as a {parent-thread}/{topic-name} suffix to append to another parent segment.topic-name to the exact thread-name unless doing so would duplicate an existing registry key for an unrelated thread.~/.llm/skills/threads/{parent-thread-id}.md when available. Preserve any visible project naming pattern already in that registry.1.1/gateway-spec/spec1-phase1, treat the prefix before the final slash (1.1/gateway-spec) as the active namespace for related threads in the same project.{parent-thread}/{topic-name} only because the new task is not a spec, milestone, or phase implementation.thread-name and topic-name to <project-namespace>/<derived-topic>.topic-name from the new thread's subject in 2-5 lowercase kebab-case words, then set thread-name to {parent-thread}/{topic-name}.Use this section only when Name resolution did not find an explicit user-provided name, registry convention, or project convention.
parent-thread segment.topic-name from the new thread's subject in 2-5 lowercase kebab-case words.{parent-thread}/{topic-name}.Use this path only when the user explicitly asks to create the thread in a project other than the active CWD.
list_projects and choose only the project that matches the user's explicit target.list_projects merely because the child prompt contains paths from another project.codex_app.create_thread with that project target and local or worktree environment. Resolve thread-name and topic-name first, pass the guarded prompt as the initial prompt, and rename the created thread when a real threadId is available.model: model-override and thinking: thinking-override on create_thread only when each value is present.Report the result plainly:
Mode: fork or Mode: cleanThread: [thread-name](codex://threads/<thread-id>)Thread ID: <thread-id>Deep link: [codex://threads/<thread-id>](codex://threads/<thread-id>)Linear: [KEV2-<number>](<linear-issue-url>)For pending worktree setup, report only the mode, pending worktree id, and queued status, followed by the required ::created-thread{pendingWorktreeId="..."} directive. Omit thread, deep-link, registry, and Linear success claims.
Do not fabricate a deep link before a real threadId exists. The immediate commentary update and final response must use the same real thread id and resolved thread name.
Keep a durable mapping for each parent thread in:
~/.llm/skills/threads/{parent-thread-id}.mdBehavior:
topic-name to child-thread-id plus thread-summary, where topic-name is the exact key produced by Name resolution.- `topic-name` -> `child-thread-id` — Summary: <thread-summary>.topic-name is reused instead of appending duplicates.Use a simple Markdown list so it is easy to inspect and edit manually:
# Child Threads
- `topic-name` -> `thread-id` — Summary: Investigate the named subsystem and write a source-backed report.
- `other-topic` -> `other-thread-id` — Summary: Implement the requested behavior and verify it with focused tests.
codex://threads/<thread-id> is the deep-link shape for opening an existing thread.codex://threads/new?... exists for app navigation, but when fulfilling the user's request here, create the real thread first and return the real thread link.development
Create, rename, audit, or close a tracked Codex task whose turns and status are persisted in the local thread ledger. Only use when directly invoked.
testing
Manage Git preflight, branch and worktree creation, and completed-work cleanup. Use when explicitly invoked.
databases
Automatically use for durable knowledge, configured project-context lookup, and schema-backed artifact layouts.
content-media
Create, update, or optimize skills and SKILL.md content.