본문으로 건너뛰기
cccskills
무료GitHub에 공개

codex-luna-swarm

Launch and collect independent Codex sessions (gpt-6-luna at high, xhigh or max; gpt-6.1-sol at low to xhigh) for bounded parallel work, from Claude Code or Codex: one manifest, one detached launcher, one report a session, a drain while it runs, and a retry of incomplete sessions. Owns the Codex transport when another skill sets the questions, as whole-run-investigation does for its lanes. Use when the operator asks for Luna or Sol sessions, a swarm, many sessions, a reasoning effort, a Codex subagent from Claude Code, or a later collection of reports. Distinguish a request to launch from one to wait and collect.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(3)

  • SKILL.md9.7 KB
  • scripts/luna-receipts.ts10.8 KB
  • scripts/luna-sessions.ts22.0 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Codex Luna swarm

One independent Codex session per bounded task. The orchestration stays in the session that launches, and the preparation stays smaller than the work it hands out. One script does the transport:

bun --no-env-file .claude/skills/codex-luna-swarm/scripts/luna-sessions.ts --manifest <json> --output-dir <new dir> [options]
bun --no-env-file .claude/skills/codex-luna-swarm/scripts/luna-sessions.ts --drain <output dir>
bun --no-env-file .claude/skills/codex-luna-swarm/scripts/luna-sessions.ts --retry <output dir> [--max-active N] [--start-interval-ms N]

The usage block at the head of luna-sessions.ts lists every flag. --no-env-file is Bun's own: v2 keeps no bunfig.toml, so without it a .env in the working directory would be loaded into the launcher and handed to every session.

The author before the report

A failed session is missing work, never work done by something else. When two Luna lanes of v1 failed on exhausted credits, Claude subagents wrote the reports and the session called them "Luna at max, both completed"; nothing in the reports showed it. So read who ran before reading what was claimed: summary.json holds each session's result, and a report with no result there is not a Codex session's. Exhaustion is an ordinary interruption (AGENTS.md, rule 15): those sessions are typed non-results, retried later, and never a defect of the work.

Model, effort and count

The operator's batch policy of 4 September decides when the request names no model:

independent questionsmodel and effort
2 to 5--model gpt-6.1-sol --reasoning-effort medium
6 or more--model gpt-6-luna --reasoning-effort xhigh, all in one launch

An explicit choice for this batch replaces the table. Keep an effort exactly as named and never raise it; Luna named without an effort runs at max. One launch runs one model at one effort, so mixed efforts are one launch a group. Do not split two useful questions into six to reach a Luna batch, and do not wait for earlier reports before starting the rest of a batch: the count follows the questions the evidence has not settled.

The table is the batch policy, not a count-based choice in the launcher. Pass its flags explicitly. MODELS in luna-sessions.ts accepts these values:

modelaccepted effortsdefault effort
gpt-6-lunahigh, xhigh, maxmax
gpt-6.1-sollow, medium, high, xhighmedium

With neither flag the launcher uses gpt-6-luna at max, even for a small batch. Every launch uses the priority service tier (DEFAULT_MODEL, SERVICE_TIER). From Claude Code at most two Claude subagents run at once (the operator, 4 September); Codex sessions do not count against that.

Where to stop

  • Launch, start, spawn: start every session and return the start line. Do not wait for reports unless the request also says wait, collect, review or summarise.
  • Wait, collect, review, summarise: stay until the launch completes, drain every report, and return the synthesis asked for.

Say preparing while writing the manifest, launched only once the launcher printed luna_sessions.started, and collecting only when collection was asked for. When the repository, the count, the authority and the output are clear, make bounded assumptions and start in the same turn; do not stop at a plan unless a preview was asked for.

The sessions

Read shared material once and put it in the shared instructions: the commit, the evidence rules, the limits and the report's form. A row then needs a unique lowercase name, one question and its limits, where inspection starts, its authority, and the outcome it returns. A title, a line range or "review this" is too weak; the same generic question numbered six times is one question.

  • A step every session would repeat goes in the instructions once as an exact command. Look for it first in the bun run scripts, the commands under tools/ (bun tools/wri/wri.ts read --log <log> reads a campaign) and the owning skill's scripts/.
  • A causal question asks the session to test at least three hypotheses where the evidence shows a mismatch, an innocent or intended one among them, to count the callers and tests, and to propose a correction only for a defect it proved.
  • Read-only by default. A write session owns named paths and is told others may be editing. Where fixes are asked for and nobody owns the paths, sessions propose and the launching session checks and makes the confirmed fixes. No coordinator, and no session starts another.
  • Keep reports within the seat's permitted view (AGENTS.md, sections 1 and 3), and keep private details out of prompts and published text (section 10).

Reports are research. Check every finding you act on as AGENTS.md, section 11, says.

The manifest

Write it as a file, using a file-writing tool rather than shell interpolation:

{
  "workdir": "/absolute/worktree",
  "instructionsFile": "/absolute/shared-instructions.md",
  "sessions": [
    { "name": "readers", "task": "Own the readers of comparison.reported from the log to the view. Report each reader, what it reads, and any two that disagree." },
    { "name": "fixture", "task": "Write the hostile case named in the instructions.", "sandbox": "workspace-write", "ownedPaths": ["test/compare.test.ts"] }
  ]
}

Each session receives the shared instructions (the file's, then instructions), its task, then a line stating its authority. A row takes only name, task, workdir, sandbox and ownedPaths; names match ^[a-z][a-z0-9_]{0,47}$, tasks are distinct, and a workspace-write session declares ownedPaths. Codex starts only inside a Git work tree unless told otherwise, and the launcher tells it so for a read-only session and for one that owns its whole workdir.

Launch

Start the whole batch in one detached launcher, so neither the Bash tool's 600-second limit nor the end of the turn takes it down: a launcher started as an ordinary background command died with its parent on 28 August and took all 24 sessions with it. The output directory must not exist yet, and the log goes outside it:

nohup bun --no-env-file .claude/skills/codex-luna-swarm/scripts/luna-sessions.ts \
  --manifest <scratch>/manifest.json --output-dir <scratch>/luna \
  --model gpt-6.1-sol --reasoning-effort medium [--max-active 12] [--start-interval-ms 1000] \
  > <scratch>/luna.log 2>&1 &

Put the output directory somewhere the host does not clean, in the session's scratchpad or beside the evidence it serves, never under a campaign's folder. The first line of the log is luna_sessions.started; only then report the directory, the count, the model, the effort, the service tier, the active count and the pace as launched. The launcher finds Codex by --codex-bin, then the ChatGPT app's copy, then Homebrew's, then codex on the PATH. It needs Codex's own state; request shell access only if the sandbox refuses the authorised launch. Each read-only session stays read-only.

Watch, drain, retry

Read the launcher's log: one luna_session.finished line a session, then luna_sessions.completed. Drain while it runs, not only at the end: --drain <output dir> prints what reports.md gained since the last drain, and sixty lanes of one v1 batch sat unread on 29 September because nothing drained them. reports.md gains each report as its session settles, so it holds every settled report even if the launcher dies.

After luna_sessions.completed, drain once more and read summary.json: one result for each session asked for. A session that did not complete is missing work, and its result says why (failureKind: spawn, rate-limit, or null when unclassified). A transport warning in stderr is not a failure: a fall-back from WebSocket to HTTPS may still complete. The start line proves the configuration asked for, not the model a remote session bound; where identity carries a claim, read the session's own event log before making it.

Codex retries a request inside a session. A session completes only when its last attempt exits 0 and writes a report (settle, luna-receipts.ts). An incomplete session gets one further attempt by default (--retries, 0 to 5): codex exec resume of its thread where Codex named one, a fresh start otherwise. After rate-limited sessions, let the launch settle, then run again only what is missing, under the recorded model, effort and prompts:

bun --no-env-file .claude/skills/codex-luna-swarm/scripts/luna-sessions.ts --retry <output dir> --max-active 4 --start-interval-ms 5000

A retry leaves launch.json and every completed result as they were, appends the rerun reports to reports.md, and refuses while that directory's launcher still runs.

Lanes of a whole-run investigation

whole-run-investigation step 3 writes the manifest, <dir>/launch.json: one workspace-write session a lane built, owning the report it writes, in the checkout the investigation reads. Launch it as it stands. A lane that runs alone (5 and 19) is built, and launched, on its own after the reports it waits on. Then wri.ts collect reads the reports as from any seat.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Use after an Anabasis v2 comparison, checkpoint or system change, and before any sentence claims that a harness, a model or a patch improved something. States what one reading may be said to show: the identities it was made under, the counts kept apart, whether it was repeated, which part of a harness it belongs to, whether a mechanism was live in the run, and whether the measurement is valid as distinct from whether it was exploited. Ends in one fixed report.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

s-smits/anabasis642026년 10월 21일 업데이트

commit-r

무료

The commit-R protocol: a test-driven rewrite of one compartment of Anabasis v2. Commit what is in flight, remove the compartment's tests in an "R:" commit, write them again from a stated hypothesis so the production code fails on purpose, remove the production files in a second "R:" commit, then write the production code again, rewrite the neighbouring functions the old shape bent, and delete what served only it. Use when the operator says "commit R", "commit-R protocol", "remove and rewrite the tests" or "rewrite from scratch", or asks for a test-first pass that looks for a faster, simpler path to the same outcome.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

s-smits/anabasis642026년 10월 21일 업데이트

The harnesses a campaign keeps, read outside a run: which there are and where each came from, what each is made of and what moved from its parent, what each was measured to be, trying one on a task, the audit before a promotion and the blind review at a handover, whether a part earns its place, and changing what makes a harness or what a seat is told about one. Use when the operator asks which harness is current, what a Builder changed, whether a harness is ready to promote or hand over, to run a kept harness on a task, or to change the harness contract. Reading one run is whole-run-investigation's, wording a claim attribution-and-proof's.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

s-smits/anabasis642026년 10월 21일 업데이트

Hand a question about Anabasis v2 to an outside Oracle model as one task document and one zip. The Oracle reads GitHub; the zip carries what it cannot fetch: campaign logs and kept harnesses through `bun run runs zip`, a reader's output, predictions with how each resolved, patches for commits never pushed. Use when the operator asks to prepare an Oracle question, a report request, a problem statement or a second opinion on a run, a reading or a design, or to send the latest runs to an outside model. Produces local files; uploading is the operator's.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

s-smits/anabasis642026년 10월 21일 업데이트

Replay recorded promotions through a tree's own rule without models or spend. Read which promotions the rule supports, what unsuccessful attempts missed by, their A/A controls, and hours and dollars per promotion. Compare a baseline and a candidate that changes one rule.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

s-smits/anabasis642026년 10월 21일 업데이트

Measure whether a change made the tree simpler: line counts, branching, coupling, interface width, rule count, standing exemptions and model-visible prose across one diff or a stack of pull requests. Use before claiming a pass reduced complexity, when deciding which pull request added machinery, and to read a function's branch count, which no v2 gate reports.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

s-smits/anabasis642026년 10월 21일 업데이트

s-smits의 스킬 모두 보기

이 스킬의 문제 신고