Logo Codex App Link

Codex App Link

Cộng đồng
transcendr
codex-app-link

Create Codex threads and send messages into Codex desktop-app (GUI) threads, then wait for and read their replies, so Claude can orchestrate Codex agents. Use when the user asks to message, direct, steer, start, check on, or hand work to a Codex thread or agent (often given as a thread ID like 01a10323-9edd-...), or to run Codex as a sub-agent.

Tổng quan

Nhà phát hànhtranscendr
Kho mãslopware-skills
Tên kỹ năngcodex-app-link
Sao
39
Bản fork
2
Tệp đi kèm
5
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI là Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • 5 tệp đi kèm

    Các tập lệnh, mẫu và tài liệu tham khảo mà mô hình có thể đọc khi làm việc. Các tệp chỉ cho phép đọc và không bao giờ được thực thi.

  • Mã nguồn mở

    Được transcendr công bố trên GitHub. Hãy đọc nội dung nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Codex App Link trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL thư mục kỹ năng bên dưới và xác nhận.
    https://github.com/transcendr/slopware-skills/tree/main/plugins/codex-app-link/skills/codex-app-link
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/transcendr/slopware-skills.git /tmp/slopware-skills
mkdir -p .claude/skills
cp -r /tmp/slopware-skills/plugins/codex-app-link/skills/codex-app-link .claude/skills/codex-app-link
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Codex App Link trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự tải Codex App Link ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên Codex App Link không bị giới hạn ở mô hình mà kỹ năng này được viết cho. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên kỹ năng chưa dùng không tốn chi phí.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

Codex App Link

scripts/codex-thread.mjs drives Codex threads from the terminal. It sends messages through the Codex desktop app, or through the shared app-server daemon for a thread open in a terminal codex session, works whether or not the thread is in the foreground, and reads replies from Codex's own session files. By default, output is compact text, to save tokens in an agent's context:

  • one line of key=value scalars;
  • then the agent's reply (lastAgentMessage) as raw, unescaped text.

Add --json only when you need every field. Do not pipe JSON through jq into your context. Errors are one-line JSON on stderr, with exit code 1.

Set CT to the script inside this skill's base directory, fresh in every session:

bash
CT=<skill-base-dir>/scripts/codex-thread.mjs
node $CT version        # confirms the version and path you are actually running

Never reuse a .../codex-app-link/<version>/... path remembered from an earlier session or a summary. Plugin updates install side by side, so an old path keeps running the old version and misses its fixes and scripts.

Terminal sessions. A thread open in a terminal codex session is held by the shared local app-server daemon (~/.codex/app-server-control/app-server-control.sock), not the app, so the app can never take it over. send detects this (status shows loadedInDaemon=true) and talks to the daemon instead: --steer injects into the daemon's active turn, with that turn id as a precondition, and a plain send starts a turn when the thread is idle. Either way the message lands in the one live instance the terminal shows; no second process or fork is created.

Requirements: macOS, the Codex desktop app (ChatGPT.app) running, and Node.js 22.5 or later (the script reads Codex's thread index through node:sqlite).

Multiple Codex instances: set CODEX_HOME to the instance's home (for example CODEX_HOME=~/.codex-work) on every command. The script then uses that instance's socket, thread index and session files. open codex://... always reaches the default instance (~/.codex), so for any other instance the script loads a thread by sending the codex://threads/<id> link as a GetURL Apple Event to the process that owns that instance's socket. The first use may trigger a macOS Automation prompt. If no process owns the socket, it fails with not-loaded-in-instance.

CommandPurpose
node $CT list [--limit N] [--cwd DIR]Recent threads (id, title, cwd, updated)
node $CT status <id>status (idle/active), current turnId, runningFor, queued, lastAgentMessage, loadedInApp, loadedInDaemon
node $CT new --cwd DIR --text "..." [--timeout SEC] [-- <codex exec args>]Create a thread with the CLI, run its first turn, then load it in the app. Returns threadId and finalMessage
node $CT send <id> --text "..." [--wait] [--timeout SEC]Start a turn in an idle thread through the app. --wait blocks until it finishes and returns lastAgentMessage
node $CT send <id> --text "..." --queueNew follow-up work: starts a turn if the thread is idle; otherwise queues it and delivers it as a new turn when the running turn ends, one per turn
node $CT send <id> --text "..." --steerInput for the running turn's own work only: answer its question or correct it
node $CT queue <id> [rm QUEUE_ID | clear]List, remove or clear queued follow-ups (~/.codex/codex-app-link-queue/)
node $CT wait <id> [--timeout SEC] [--settle SEC] [--stall SEC] [--until-question] [--expect REGEX]Block until the thread is done (see "Waiting for results"). Prints result: done, stalled, timeout, question or paused (exit 0, 3, 4, 5 or 6), plus lastAgentMessage
node $CT read <id> [--last N]Final replies of the last N turns
node $CT result <id> [--marker RESULT] [--turns N]The latest RESULT block in recent replies (in or out of a code fence), parsed into key=value lines. Exit 6 if there is none
node $CT watch (<id>... | --tracked) [--expect REGEX] [--cursor FILE]One event line per STARTED, QUESTION, APPROVAL, COMPACTED, MAINTENANCE (if configured), RESULT, PAUSED, DONE, STALLED, MISSING, FOUND or UNPARSED (a complete session line that failed to parse: an event may be lost, so read the thread), across several threads (see "Managing several threads")
node $CT track add <id> --name N [--role R] / track rm N / track listThe project's thread registry at <git root>/.codex-app-link.json. Every command then accepts the name in place of the ID
node $CT versionThe plugin version, script path and registry path
node $CT questions <id> [--all] [--since ISO]Formal questions the thread asked (request_user_input*), unanswered by default, with options and the answer. Exit 5 if any are pending
node $CT open <id>Make the app load a thread without sending anything
node $CT access <id> full [--no-open]Set the thread's access the way the composer's selector does (Full access). It applies from the next turn, or to the running turn. Use it after an app restart: the app reloads threads under a restricted profile (workspace write, network off)

Long messages: --file path or --stdin instead of --text.

Waiting for results: the only supported method

Run exactly this as a background command, and act when it exits:

bash
node $CT wait <id> --timeout 10800        # run_in_background; one command, no loops
  • It waits for the thread, not a turn. It returns when the thread has been continuously idle for --settle seconds (default 45). Codex often chains turns: compaction, auto-continue, or context maintenance by other plugins. A turn can also end without a normal completion event. The settle window absorbs chained turns, and nothing is pinned to a turn ID.
  • It cannot hang silently:
    • result: "stalled" (exit 3): the thread claims to be active, but its session file has not been written for --stall seconds (default 2700, 45 min). Verify before acting: a silence of 15+ minutes is normal while a high-effort model reasons, or while a long command runs, because neither writes to the session file until it finishes. Check the last session-file write and running processes. If it is still writing or a process is running, restart wait. Treat the turn as dead only if it stays silent past the threshold with nothing running.
    • result: "timeout" (exit 4): the overall --timeout (default 3h) was reached. The current state is printed.
  • On exit, read result and lastAgentMessage from its output, then judge the work yourself. Do not require a particular reply format.
  • Questions don't end a wait unless you ask. Codex asks formal questions with request_user_input_async. It is accepted at once and the turn keeps running, so a plain wait never returns for it, and the worker proceeds on its own default. Use wait --until-question (result: "question", exit 5), or run codex-progress.py, which prints QUESTION lines. Then answer with send <id> --steer. Run questions <id> before closing out any handoff.

Never do any of these (each has caused missed completions):

  • wait on a specific turn ID (wait --turn X, or send --wait followed by its turn);
  • loop on a regex for an expected report string (e.g. RESULT slice=);
  • write hand-rolled shell loops around wait or status.

--turn is still accepted, but it only lets an earlier finish count; it never blocks on that turn.

Watching progress live (process work)

wait reports only that a thread finished. For process work, meaning live QA tests, computer-use or UI driving, deploys and ops steps, also stream the thread's progress, so that a blocked approval prompt, a missing plugin runtime or a stalled step surfaces within minutes:

bash
python3 <skill-base-dir>/scripts/codex-progress.py <id> 240   # run under a background monitor

It prints one line per new assistant note (NOTE), formal question (QUESTION, with its options), approval-request event (APPROVAL_WAIT) and turn end (TURN_END). After 240 seconds without a session write it prints a SILENT line; check it before acting, because a silent model may just be reasoning. Run it alongside wait, not instead of it. Ask the Codex worker to post a short progress note after every step. For implementation work (coding a scoped handoff, running tests, opening a PR), wait alone is enough. Stop the monitor when the turn ends.

Managing several threads: track, watch, result

When you run more than one worker, or anything long, use the manager kit rather than separate waits:

  1. Name the threads once per project: node $CT track add <id> --name sol-b --role "worker: render". The registry is a small JSON file at the git root, so every later manager of the project inherits the roster. Commit it.

  2. Run one watch for all of them, as a background monitor, and re-arm it when the monitor expires:

    bash
    node $CT watch --tracked --expect '^RESULT ' --cursor .codex-app-link.cursor.json

    --cursor saves offsets and turn state after every poll, so a re-armed watch resumes exactly where the last one stopped and loses nothing in between. Keep the cursor file out of git.

  3. Act on each event:

    EventWhat to do
    QUESTIONAnswer now with send <name> --steer. The worker keeps going on its default otherwise
    PAUSEDThe thread went idle without its result: a compaction pause, a "waiting for controller resume" stop, or a crash. Read its last reply, then resume it with send
    RESULTReported as soon as a reply containing a matching line is written, including mid-turn (one event per matching line, so chained work reports each result). Run node $CT result <name>, then verify the work yourself. Anchor --expect to the result line itself (for example '^\s*RESULT (handoff|research)='), so replies that merely mention it don't match
    STALLEDCheck before acting: long reasoning and long commands write nothing
    COMPACTED, STARTED, MAINTENANCEContext. MAINTENANCE appears only if you configured a maintenance controller's patterns (below)

| APPROVAL | It may need you in the app |

Context-maintenance controllers (optional). Some setups run a controller, such as Jevpact, that asks a worker to pause before compaction and sends a resume afterwards. Its wording is configurable, so the kit matches nothing by default. To see those steps as MAINTENANCE events, and to stop them counting as answers to questions, add the patterns your controller actually sends to the registry:

json
"automation": { "pause": "prepare to compact", "resume": "continue the existing unfinished assignment" }

(or pass --pause-pattern / --resume-pattern). Copy the patterns from a real message in your own rollouts, not from these examples. Whether or not a controller is present, a worker that goes idle without its RESULT shows up as PAUSED. A controller may skip its resume when it judges the work done, and can be wrong.

Ask every worker to end with a RESULT block (RESULT key=value …) and to treat only that block as the end of its task. --expect is what tells a finished worker from one that stopped short.

Managing a project through Codex threads

When the user onboards you as the manager of work that Codex threads carry out, read these once before acting:

  • references/strategic.md: roles, likely thread configurations (including the recommended coordinator-plus-work-threads setup), onboarding questions, and how to read the state of a project from its threads.
  • references/operational.md: the dispatch, review, wait, verify and merge loop, authority rules, and lessons from real orchestration.
  • references/companions.md: how to use MSW, MSL and Timebox when the project has them, and how to offer them when it does not.

For a single message to a thread, the commands above are enough.

Orchestration pattern

  1. new to create a worker thread, or take an existing thread ID from the user.
  2. send, then start node $CT wait <id> as one background command and do other work until it exits (see "Waiting for results"). Use send --wait only for short foreground turns; it uses the same thread-level wait.
  3. Give Codex file paths to read, not pasted content. Ask it to end its turn with a clear result line you can parse.
  4. Report the thread ID to the user so they can open it in the app.

Rules

  • Do not message a thread you did not create unless the user named it and asked you to. The user may be working in it.
  • send refuses (thread-busy) while a turn is running. New follow-up work goes through --queue, never --steer: steering new work keeps a turn alive for hours, re-reads its whole context on every request and burns usage. Use --steer freely, but only for input to the running turn's own work: answering its question or correcting it.
  • Commands print rule: ... lines with the protocol that applies to what you do next (new turn, steer, queued, active, questions, done, stalled, created). Read them; don't filter them out.
  • Never run a CLI process on a thread (codex resume, codex exec resume) while the app owns it. Only one Codex process may hold a thread.
  • New threads inherit ~/.codex/config.toml defaults (model, sandbox, approvals). Pass codex exec flags after -- to change them, for example -- --skip-git-repo-check outside a git repo, or -- -s workspace-write.
  • Clean up test threads by archiving them in the app. codex archive <id> returned "failed to archive session", with no further detail, for threads the app had loaded (2026-10-06; cause unconfirmed).

How it works

  • Sending: the app listens on a private socket, ~/.codex/ipc/ipc.sock. Each message is JSON with a 4-byte little-endian length in front. The script sends initialize, then thread-owner-discovery to find the app client that has the thread loaded, then thread-follower-start-turn (idle) or thread-follower-steer-turn (busy) to that client. This was learned from the Jevpact Codex plugin (plugins/jevpact/src/codex.js).
  • Loading: the app only answers for threads it has loaded. When a thread isn't loaded, send and new open codex://threads/<id> with open -g. That loads it in the background, but can switch the thread shown in the app window. --no-open disables this. This only happens for the default instance; see "Multiple Codex instances" above.
  • State: the thread index is ~/.codex/state_5.sqlite (table threads, read-only). Turn state and replies come from the thread's rollout JSONL: task_started means busy; task_complete (which carries last_agent_message) or turn_aborted means idle.
  • Creating: new runs codex exec --json using the CLI bundled with the app (/Applications/ChatGPT.app/Contents/Resources/codex-cli/bin/codex, override with CODEX_BIN). The older codex on PATH (nvm) may reject the configured model.
  • Queued messages: codex queue --thread <id> --message ... stores a message that runs only when a client loads the thread. Opening the thread delivers it at once, so check status after open before sending.

The socket protocol is private and undocumented. It was verified on 2026-10-06 against app CLI 0.160.0. If a Codex update breaks it, request-version-mismatch or no-handler-for-request errors appear. Re-check the method versions in the app bundle with strings app.asar | grep thread-follower-.

Troubleshooting

ErrorMeaning / fix
app-not-runningStart the Codex desktop app (ChatGPT.app)
not-loaded-in-appDeep link did not load the thread within 30s, and the shared daemon doesn't hold it either. Open the thread in the app manually and retry
daemon-threadaccess on a terminal session: set its access in that terminal
A thread's commands fail with EPERM, no network, or no Simulator after the app restartedThe app reloaded it under a restricted profile. Run access <id> full, then check the next turn: the rollout's turn_context shows sandbox_policy danger-full-access
not-loaded-in-instanceNo running app owns the CODEX_HOME instance's socket. Start that instance (or open the thread in it) and retry
thread-not-indexedWrong ID, or the thread was created on another machine
ENOENT on rollout-….jsonl (before 0.2.18), or zstd-unsupportedCodex zstd-compresses idle rollouts to .jsonl.zst and restores them when the thread resumes. 0.2.18+ reads the compressed copy through a private cache in the temp directory; it needs Node with zlib.zstdDecompressSync (22.15+)
thread-busyA turn is running. New work: send --queue. Answer or correction for this turn: send --steer
thread-follower-start-turn-timeout, or not-loaded-in-app on a thread that loads lateThe turn often did start anyway. Run status <id> before retrying; resending would deliver the message twice
request-version-mismatch / no-handler-for-requestThe app's private protocol changed. See "How it works"
new returns exitCode: 1 and no finalMessageThe first turn failed. Read the rollout's task_complete event; often an unsupported model or a CLI version mismatch

Tệp đi kèm

Mô hình đọc các tệp này khi cần trong lúc kỹ năng được tải. Các tệp được cung cấp ở dạng có thể đọc và không bao giờ được thực thi.

Câu hỏi thường gặp

Kỹ năng AI Codex App Link làm được gì?

Create Codex threads and send messages into Codex desktop-app (GUI) threads, then wait for and read their replies, so Claude can orchestrate Codex agents. Use when the user asks to message, direct, steer, start, check on, or hand work to a Codex thread or agent (often given as a thread ID like 01a10323-9edd-...), or to run Codex as a sub-agent.

Vì sao nên dùng Codex App Link trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Codex App Link là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Codex App Link trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/transcendr/slopware-skills/tree/main/plugins/codex-app-link/skills/codex-app-link. TypingMind đọc tệp SKILL.md, đóng gói các tệp đi kèm và cài đặt thành một kỹ năng mà bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Codex App Link?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Bạn có thể dùng Codex App Link với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Codex App Link với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Codex App Link có miễn phí không?

Kỹ năng này được transcendr phát hành trên GitHub. Hãy xem điều khoản giấy phép trong kho mã. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp cho mô hình các công cụ mới để gọi — mã được chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và tiêu chí của đầu ra tốt. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇