Base directory for this skill: /Users/user_c042661f/.claude/skills/subagent-launcher
Subagent launcher (multi-model)
This skill is the umbrella for dispatching work to a model other than the one currently driving the conversation. The point is independence: a different model's judgement, not a parallel copy of your own.
Four pathways are wired up:
Pathway
Model
Invocation
Has tools?
Cost source
Codex
GPT-5.5 (configurable)
codex exec (CLI)
Yes — sandboxed workspace
User's OpenAI/Codex quota
Claude
Claude (Opus/Sonnet/Haiku)
Agent tool in Claude Code
Yes — full tool palette
User's Claude Code session
DeepSeek V4 Pro
deepseek-v4-pro (official API)
curl to api.deepseek.com
No (pure chat)
DEEPSEEK_API_KEY from ~/.hermes/.env
Kimi K2.5
kimi-k2p5 via Fireworks
curl to api.fireworks.ai (the megaplan "hermes" agent route)
No (pure chat)
FIREWORKS_API_KEY from ~/.hermes/.env
DeepSeek and Kimi here are chat-only one-shots — good for opinions, root-cause hypotheses, or judging artifacts you already have in hand. They don't write files or run commands. If you need DeepSeek or Kimi to actually do agentic work, dispatch a megaplan run with the matching profile instead (see Agentic delegation below).
Picking a pathway
Want a second model's judgement on something you already understand? → Codex (or DeepSeek/Kimi if you want a third voice or want to avoid burning OpenAI quota).
Want independent root-cause analysis from scratch? → Codex (it can read the repo) or Claude (Agent tool).
Want a model to implement a fix? → Codex with --sandbox workspace-write, or the Claude Agent tool with the general-purpose subagent. DeepSeek/Kimi via curl can't write files; go through megaplan for that.
Adversarial review of a Claude diagnosis? → Codex is the highest-signal second opinion because it's the most-different model and has repo access.
"Jury of models" for high-stakes calls? → Fan out the same prompt to Codex + DeepSeek + Kimi in parallel (multiple Bash tool calls in one message). Compare answers.
Already have the answer? → Don't dispatch. Subagents aren't free.
1. Codex (GPT-5.5)
Codex is installed at /Users/user_c042661f/.nvm/versions/node/v20.19.4/bin/codex. The openai/codex-plugin-cc Claude Code plugin wraps it as /codex:review etc., but the underlying call is codex exec — invoke it directly from Bash.
Basic invocation:
bash
codex exec --sandbox read-only "PROMPT_HERE"
--sandbox read-only — analysis only, no file writes
--sandbox workspace-write — let Codex modify project files
--sandbox danger-full-access — full shell (avoid unless explicitly requested)
-m gpt-5.5 — pin the model (default; check ~/.codex/config.toml first if you'll override)
-c model_reasoning_effort=medium — medium is the default; bump to high for hard reasoning, drop to low for mechanical edits
Always seal stdin with </dev/null when running Codex non-interactively. If stdin isn't a TTY and isn't /dev/null, codex exec will block forever at "Reading additional input from stdin..." even when the prompt is fully supplied as an argument. The process sits at 0% CPU and silently waits — no error, no timeout. See Detecting hangs below.
Background long sessions via the Bash tool's run_in_background: true. Pair with timeout 600 codex exec ... so a wedged run self-terminates instead of squatting indefinitely.
codex apply — apply Codex's last diff with git apply
2. Claude (via Claude Code Agent tool)
Claude subagents are dispatched through the Agent tool already available in this harness. They run as cleanly-scoped instances with no memory of the outer conversation — so the prompt must be self-contained.
Subagent types worth knowing:
general-purpose — catch-all for research, multi-step tasks, code edits with full tool access.
Explore — fast read-only search agent. Use it to find files / grep / "where is X defined."
Plan — software-architect agent that returns step-by-step plans without writing code.
claude-code-guide — Claude Code / Anthropic SDK / Claude API questions.
code-reviewer — independent review of a diff or change.
statusline-setup, others — see the agent list at the top of the harness prompt.
Invocation pattern (inside this Claude Code session):
code
Agent({
description: "Independent root-cause review",
subagent_type: "general-purpose",
prompt: "<self-contained brief: working dir, files to read, what to return, response cap>"
})
Key prompt rules (same as any subagent):
Name the working directory explicitly.
List exact files/paths to read, not "the relevant files."
State the desired output format (diff, ranked list, schema proposal).
Cap the response length ("under 600 words").
For adversarial tasks, tell Claude to be opinionated — otherwise it hedges.
When to prefer Claude over Codex: when you want the same family of judgement (Claude is what's already driving the conversation) but isolated from the outer context — e.g., to keep the main thread clean during a big repo sweep. For genuinely different judgement, prefer Codex or DeepSeek.
3. DeepSeek V4 Pro (official API)
DeepSeek V4 Pro is invoked via the official DeepSeek API at https://api.deepseek.com. The matching megaplan profile is all-deepseek-pro-direct (spec: hermes:deepseek:deepseek-v4-pro).
API key: DEEPSEEK_API_KEY, sourced from ~/.hermes/.env
It's a reasoning model. Reasoning tokens count against max_tokens. Setting max_tokens: 200 will exhaust the budget on reasoning and return empty content. Use ≥ 2000 for short answers, ≥ 16000 for analysis.
One-shot invocation:
bash
set -a; source ~/.hermes/.env; set +a
curl -s -X POST https://api.deepseek.com/v1/chat/completions \
-H "Authorization: Bearer $DEEPSEEK_API_KEY" \
-H "Content-Type: application/json" \
-d @- <<'EOF' | python3 -c "import sys,json; d=json.load(sys.stdin); print(d['choices'][0]['message']['content'])"
{
"model": "deepseek-v4-pro",
"messages": [
{"role": "system", "content": "You are an adversarial code reviewer. Be opinionated and concise."},
{"role": "user", "content": "..."}
],
"max_tokens": 16384,
"temperature": 0.3
}
EOF
For multi-paragraph prompts, build the JSON with python3 -c or write it to /tmp/deepseek_req.json and -d @/tmp/deepseek_req.json.
Inspecting reasoning: the response has choices[0].message.reasoning_content separately from content. Print content for the answer; sample reasoning_content if you want to see how it got there.
Tools / agentic mode: DeepSeek V4 Pro via curl has no tools — pure chat. For agentic work, run a megaplan plan with --profile all-deepseek-pro-direct (see Agentic delegation).
4. Kimi K2.5 (via megaplan/hermes Fireworks route)
Kimi K2.5 in this setup is the Fireworks-hosted model accounts/fireworks/models/kimi-k2p5, the same route the megaplan all-open profile uses (via the hermes:fireworks:... agent spec). Direct Moonshot keys (KIMI_API_KEY) are not configured locally; OpenRouter quotas are exhausted; Fireworks is the working path.
API key: FIREWORKS_API_KEY, sourced from ~/.hermes/.env
It's a thinking model. Same gotcha as DeepSeek — set max_tokens to ≥ 2000 for any non-trivial answer. With small budgets it'll burn the whole window on reasoning and finish with length before emitting the answer.
Alternative model: accounts/fireworks/models/kimi-k2p6 (K2.6, newer). Same code path, swap the model string.
One-shot invocation:
bash
set -a; source ~/.hermes/.env; set +a
curl -s -X POST https://api.fireworks.ai/inference/v1/chat/completions \
-H "Authorization: Bearer $FIREWORKS_API_KEY" \
-H "Content-Type: application/json" \
-d @- <<'EOF' | python3 -c "import sys,json; d=json.load(sys.stdin); print(d['choices'][0]['message']['content'])"
{
"model": "accounts/fireworks/models/kimi-k2p5",
"messages": [
{"role": "system", "content": "You are an independent reviewer. Be opinionated and concise."},
{"role": "user", "content": "..."}
],
"max_tokens": 16384,
"temperature": 0.3
}
EOF
Tools / agentic mode: the curl path is pure chat. To get Kimi as a tool-using agent inside the megaplan harness ("via megaplan agent" in the deeper sense), use a megaplan run with a Kimi-based profile — e.g., all-open (Fireworks Kimi-k2p6) — or write a one-off profile that pins Kimi K2.5 to the phases you care about.
Agentic delegation (when curl isn't enough)
The DeepSeek and Kimi pathways above are chat one-shots. When you need either model to do work — read files, write code, run commands — route through megaplan instead:
Swap --profile all-open for Kimi (Fireworks-hosted). --robustness light skips prep/gate/review for a faster single-pass run. For full multi-phase work, drop the flag (defaults to standard).
The megaplan skill (already loaded in this harness) covers the workflow; this skill just points you to the right profile.
Regardless of which pathway you use, the receiving model starts with zero context from your conversation. Treat every dispatch like briefing a smart colleague who just walked into the room:
Working directory — name it explicitly (/Users/user_c042661f/Documents/megaplan).
Files / paths — list exact paths, not "the relevant files."
Goal + why — what you're trying to accomplish and why the answer matters.
What you've already ruled out — saves the subagent re-doing your work.
Output shape — diff, ranked list, JSON, prose under N words. Specify.
Length cap — "under 600 words" or "respond in under 200 words."
Be opinionated — for adversarial / second-opinion tasks, tell the model not to hedge. Otherwise they'll all hedge.
Long prompts (>2 KB) belong in a file (/tmp/<task>_prompt.md) and get loaded by cat or -d @file.
Fan-out: judge / jury patterns
When the call is genuinely high-stakes, send the same prompt to multiple models in parallel and compare. From this harness, that means a single message with multiple Bash tool calls (or Agent calls) in parallel:
Codex via codex exec
DeepSeek via curl
Kimi via curl
Optional: a Claude Agent invocation as a fourth panelist
Diverging answers are signal. Convergence on a subtle judgement is much stronger evidence than any single model's confidence.
Don't fan out for routine work — it's wasteful. Reserve it for: pre-merge review of risky changes, architecture decisions you can't easily reverse, security-sensitive code paths, judging artifacts that megaplan itself produced.
Bundles
Preconfigured fan-outs aimed at a specific kind of decision. Same problem, different lenses, run in parallel, no cross-talk.
Agent UX bundle
Three parallel Codex subagents (GPT-5.5, model_reasoning_effort=medium) sense-check the same proposal from three lenses:
Human user — what's confusing, surprising, or invisible to the end person?
Agent user — would an LLM reading this cold pick the right tool / default / path?
Technical abstraction — are the boundaries clean and the abstractions load-bearing?
Use for changes that touch all three surfaces (new CLI, new API, new prompt/workflow, slash command). Skip for pure bugfixes or one-layer work.
Briefing rules: same unbiased problem write-up to all three; each gets only its own lens plus a note that two others are running; tell each to take a position and not hedge; cap ≤ 600 words; never show one's output to another.
bash
cat > /tmp/agent_ux_problem.md <<'EOF'
<unbiased factual description of the proposal>
EOF
# Single message, three parallel Bash calls — one per lens:
codex exec --sandbox read-only -c model_reasoning_effort=medium "$(cat <<'EOF'
Sense-check from the **human user perspective**. Two other reviewers cover the agent-user and technical-abstraction lenses — skip their ground. Take a position, do not hedge. ≤ 600 words.
PROBLEM:
$(cat /tmp/agent_ux_problem.md)
EOF
)" 2>&1 | tail -200
# …repeat with "agent user perspective" and "technical abstraction perspective".
Synthesize: concerns in >1 lens are likely real; disagreement between lenses usually means the design optimizes one surface at another's expense.
Sanity checks before dispatching
Is there an equivalent built-in agent (Claude Agent with Explore or general-purpose) that would work? If yes and you don't need genuinely independent judgement, use it.
Does the task need write access? If yes, Codex workspace-write or Claude Agent (with edit tools) — DeepSeek/Kimi curl can't write files.
Are you re-asking what you already answered? If so, add the twist (rank these, find the flaw, argue the other side) — otherwise you're just burning tokens.
For DeepSeek/Kimi: did you set max_tokens high enough that the reasoning budget won't eat the answer? Default to 16384 unless you have a reason to go lower.
Is ~/.hermes/.env actually sourced in your shell call? It isn't by default — prepend set -a; source ~/.hermes/.env; set +a whenever you're shelling out via curl.
Detecting hangs / liveness checks
Every pathway has a specific way to silently wedge. Each requires a different smoke-test. If you dispatch a long-running subagent, do a liveness check 30-60 seconds after launch — not 10 minutes in. Cheap to verify, expensive to leave running.
Codex (codex exec)
Failure mode: blocks on stdin even when prompt is fully supplied as argv — sits at 0% CPU, 0.1% MEM, output file at ~39 bytes containing only the literal banner Reading additional input from stdin... and nothing else. Forever. No timeout, no error.
Important — that banner string appears in healthy runs too. Codex always prints Reading additional input from stdin... as its first line on launch, even when the prompt was supplied as argv. Presence of the string is not the signal. The signal is whether anything follows it.
Prevention: redirect stdin from /dev/null. Always. The banner still prints but the process doesn't actually block.
The differentiator is file growth, not file content. Healthy Codex streams output continuously and the file is many KB by 30s; wedged Codex stays at ~39 bytes (just the banner).
bash
# Snapshot, wait, snapshot — growth is the signal:
SZ1=$(wc -c < /tmp/out.txt); sleep 5; SZ2=$(wc -c < /tmp/out.txt)
echo "growth: $SZ1 -> $SZ2" # equal AND tiny = wedged. growing = healthy.
# Process check confirms — wedged proc has 0% CPU with minutes elapsed:
ps -o pid,stat,%cpu,etime -p $(pgrep -f "codex exec") 2>/dev/null
Note: healthy Codex also shows low %CPU locally (reasoning happens server-side), so CPU alone is ambiguous — pair with file-growth or banner-only check. The all-three combination (banner-only output AND 0% CPU AND minutes elapsed) is conclusive wedge.
Recovery:pkill -f "codex exec" and re-run with </dev/null. Wrap in timeout 600 ... going forward.
DeepSeek / Kimi (curl)
Failure modes (in order of frequency):
Reasoning ate max_tokens — request returned 200 OK, content is empty string, finish_reason: "length". Set max_tokens ≥ 2000 for short answers, ≥ 16000 for analysis.
HTTP error masked by curl -s — auth, quota, rate-limit, or 5xx. curl -s swallows the status; the pipe to python3 -c "...['content']" then throws KeyError on error payload, with no clue what went wrong.
Server hang — TCP open, no response. With no --max-time, curl waits indefinitely.
Prevention pattern (use this every time, not the bare curl -s shown in earlier examples):
bash
set -a; source ~/.hermes/.env; set +a
curl -sS --fail-with-body --max-time 300 \
-X POST https://api.deepseek.com/v1/chat/completions \
-H "Authorization: Bearer $DEEPSEEK_API_KEY" \
-H "Content-Type: application/json" \
-d @/tmp/req.json \
> /tmp/raw.json
# Parse defensively — distinguish error from empty content:
python3 - <<'PY'
import json, sys
d = json.load(open('/tmp/raw.json'))
if 'error' in d:
print('API ERROR:', d['error']); sys.exit(1)
msg = d['choices'][0]['message']
content = msg.get('content') or ''
if not content:
print('EMPTY CONTENT. finish_reason=', d['choices'][0].get('finish_reason'),
'reasoning_len=', len(msg.get('reasoning_content') or ''))
else:
print(content)
PY
Liveness check (30-60s post-launch for background curls):
bash
wc -c /tmp/raw.json # 0 = still waiting or network dead
pgrep -fl curl # process still alive?
# If raw.json has content but parse fails, inspect raw.json directly —
# the error payload is the diagnosis.
Healthy curl: writes nothing until the response arrives in one chunk (streaming is opt-in). So an empty file at 60s isn't necessarily wedged — but at 5+ minutes with no --max-time it almost certainly is. Always set --max-time 300 so wedged curls self-terminate with a clear timeout error.
Claude Agent (Agent tool)
Failure modes: much rarer than the curl/Codex paths because the Agent tool runs in-process and surfaces errors through the tool-result envelope. The two real risks:
Subagent loops — bad tool / bad prompt causes the inner agent to grind. The harness will eventually return; there's no external timeout you control.
Terse prompt → shallow output — not a hang, but the most common form of "wasted dispatch." Diagnosis: response comes back in <30s with generic hedging.
Prevention:
Cap the response length explicitly (under 600 words, respond in under 200 words).
For adversarial tasks, instruct "take a position, do not hedge."
For exploration, prefer Explore subagent (fast, read-only) over general-purpose.
Liveness check: none available mid-flight — Agent tool calls are synchronous from your perspective. If an Agent dispatch is suspiciously long, the recourse is to wait or cancel the parent turn.
megaplan
Failure modes: runs are multi-phase and stage at finalize-to-execute checkpoints in review mode. The "wedge" is usually waiting for human approval, not a stuck process.
Liveness check:
bash
megaplan status --plan <name> # current state + next-step runtime hint
megaplan progress --plan <name> # per-batch completion in execute
A genuinely stuck megaplan run is rare; an apparently stuck one is usually a gated step waiting for an override (megaplan override force-proceed or replan).
Universal rule
Liveness ≠ correctness. A subagent can run for 10 minutes producing token-by-token output and still emit a useless answer. Liveness checks catch the silent-wedge failure mode. The bad-output failure mode (hedging, missed the question, hallucinated file paths) needs you to actually read the response — there's no shortcut.
Quick reference
bash
# 1. Codex — always seal stdin with </dev/null
codex exec --sandbox read-only "<prompt>" </dev/null
codex exec --sandbox workspace-write "<prompt>" </dev/null # implementer
codex exec review --pr 123 # PR review
codex apply # apply last diff
# Wedge-proofing: prefix with `timeout 600 ` for long runs.
# 2. Claude — call the Agent tool from inside this Claude Code session
# (no shell command; use the Agent tool with a subagent_type)
# 3. DeepSeek V4 Pro — always -sS --fail-with-body --max-time 300
set -a; source ~/.hermes/.env; set +a
curl -sS --fail-with-body --max-time 300 https://api.deepseek.com/v1/chat/completions \
-H "Authorization: Bearer $DEEPSEEK_API_KEY" -H "Content-Type: application/json" \
-d '{"model":"deepseek-v4-pro","messages":[...],"max_tokens":16384}'
# 4. Kimi K2.5 (Fireworks)
set -a; source ~/.hermes/.env; set +a
curl -sS --fail-with-body --max-time 300 https://api.fireworks.ai/inference/v1/chat/completions \
-H "Authorization: Bearer $FIREWORKS_API_KEY" -H "Content-Type: application/json" \
-d '{"model":"accounts/fireworks/models/kimi-k2p5","messages":[...],"max_tokens":16384}'
# Agentic delegation for DeepSeek/Kimi
PYENV_VERSION=3.11.11 megaplan init --project-dir "$PWD" \
--profile all-deepseek-pro-direct --robustness light "<task>"
PYENV_VERSION=3.11.11 megaplan init --project-dir "$PWD" \
--profile all-open --robustness light "<task>" # Kimi via Fireworks (k2p6)
User
subagent-launcher
/subagent-launcher
can you change the temperature and other settings on deepseek?
User
Base directory for this skill: /Users/user_c042661f/.claude/skills/subagent-launcher
Subagent launcher (multi-model)
This skill is the umbrella for dispatching work to a model other than the one currently driving the conversation. The point is independence: a different model's judgement, not a parallel copy of your own.
Four pathways are wired up:
Pathway
Model
Invocation
Has tools?
Cost source
Codex
GPT-5.5 (configurable)
codex exec (CLI)
Yes — sandboxed workspace
User's OpenAI/Codex quota
Claude
Claude (Opus/Sonnet/Haiku)
Agent tool in Claude Code
Yes — full tool palette
User's Claude Code session
DeepSeek V4 Pro
deepseek-v4-pro (official API)
curl to api.deepseek.com
No (pure chat)
DEEPSEEK_API_KEY from ~/.hermes/.env
Kimi K2.5
kimi-k2p5 via Fireworks
curl to api.fireworks.ai (the megaplan "hermes" agent route)
No (pure chat)
FIREWORKS_API_KEY from ~/.hermes/.env
DeepSeek and Kimi here are chat-only one-shots — good for opinions, root-cause hypotheses, or judging artifacts you already have in hand. They don't write files or run commands. If you need DeepSeek or Kimi to actually do agentic work, dispatch a megaplan run with the matching profile instead (see Agentic delegation below).
Picking a pathway
Want a second model's judgement on something you already understand? → Codex (or DeepSeek/Kimi if you want a third voice or want to avoid burning OpenAI quota).
Want independent root-cause analysis from scratch? → Codex (it can read the repo) or Claude (Agent tool).
Want a model to implement a fix? → Codex with --sandbox workspace-write, or the Claude Agent tool with the general-purpose subagent. DeepSeek/Kimi via curl can't write files; go through megaplan for that.
Assistant
Yes. The DeepSeek call is just a curl to the OpenAI-compatible /v1/chat/completions endpoint, so any parameter the API accepts can go in the JSON body. The common ones:
temperature (0.0–2.0) — default in the skill examples is 0.3; bump to 0.7–1.0 for more variation, drop to 0.0 for deterministic
top_p — nucleus sampling cutoff
max_tokens — must stay ≥ 2000 for short answers, ≥ 16000 for analysis (reasoning tokens count against this budget)
response_format: {"type": "json_object"} — force JSON output
seed — for reproducibility (best-effort)
One caveat specific to DeepSeek V4 Pro: it's a reasoning model, so temperature mostly affects the final answer phase — the reasoning trace is largely deterministic regardless. If you want more diverse reasoning paths, you'd need to vary the prompt, not the temperature.
Want me to dispatch something with specific settings? If so, tell me the prompt + what you want to change and I'll run it.
User
Can you try just write like, I tried a few different temperatures and maybe deploy like five different ones with different temperatures asking them to write like, you know, maybe from 0.6 to 1.4 asking them to write a scene where Kramer is very excited about open source AI and Jerry and George is very skeptical. and Jerry is kind of like just really confused. He just keeps on asking who and what, you know?
Assistant
I'll set this up with a helper script first, then fan out 5 parallel DeepSeek calls at temperatures 0.6, 0.8, 1.0, 1.2, 1.4.
Assistant
All 5 fired in parallel. Waiting for them to finish — DeepSeek reasoning runs typically take 1-3 minutes.
User
Assistant
Temp 1.4 done. Waiting on the other four.
User
Assistant
Not using TaskCreate here — just five parallel API calls, nothing to track beyond the notifications themselves. Three more pending.
User
Assistant
Two more pending (1.0 and 1.2).
User
Assistant
One more pending (1.2).
User
Assistant
All five done. Reading them now.
Assistant
All 5 scenes printed above. Quick comparative read:
0.6 — Tightest, most predictable. Clean structure, the gags land but feel paint-by-numbers ("Hugging Face… that's a lawsuit waiting to happen"). Kramer name-drops conservatively (Mistral, Llama, A100). George's "wet napkin" line is the standout.
0.8 — Same shape as 0.6 but slightly looser. The "zoo in a bakery" beat is good; the LangChain → chain gang misread is the cleanest "Jerry confused" gag of the bunch. Ends on a tidy button.
1.0 — Starts to sprawl. Introduces a B-plot (JerryBot, forking the code, the Aluminum Siders local 214). George spirals from "scam" into "human capital" within four lines, which is the kind of jump higher-temp gives you. Closer ("They're in the walls, Jerry") is darker than the show usually goes.
1.2 — Best one for my money. Weirder swings that still land: "Jer-minator," "Samsung Fridge-igator," Newman flagged by peephole AI as a "confectionary threat." George's "I have bespoke panic" is a real Costanza line. Risk-on but coherent.
1.4 — Starts to fray at the edges. The mannequin-and-fan cold open is gold but some lines drift toward random-words-soup ("polite burglar", "you mixed experts with a transformer? That sounds like an electrocution"). Still ends strong with "Singularity… isn't that a black hole?" / "Same difference."
Sweet spot for this kind of pastiche looks like ~1.0–1.2. 0.6/0.8 are safe but a little dead; 1.4 has the best individual lines but also the most groaners.
If you want, I can:
Re-roll just 1.0 and 1.2 a few times to see how stable they are
Try top_p instead of temperature (different sampling lever)
Run the same prompt through Kimi or Codex for a totally different voice
User
can you open them as .md?
Assistant
Saved and opened all five at /tmp/seinfeld_scenes/seinfeld_temp_{0_6,0_8,1_0,1_2,1_4}.md. They should be opening in your default .md handler now. Skipping TaskCreate — this was a two-step file write, not work that needs tracking.
User
Let's do five more like that, but save them all directly to a markdown document and make them all way shorter. So let's make them all 30 seconds long in terms of the pacing and timing.
Assistant
All 5 short scenes firing in parallel. Skipping TaskCreate again — these are just five API calls with a notification per completion. I'll combine into one .md once they're done.
User
Assistant
1.0 done, four to go.
User
Assistant
0.6 done, three to go.
User
Assistant
1.2 done, two to go.
User
Assistant
0.8 done, just 1.4 left.
User
Assistant
All five done. Combining into a single .md now.
Assistant
All five saved to /tmp/seinfeld_scenes/seinfeld_short_temps.md and opened.
Quick read across them:
0.6 — "He's gotta be the world's worst businessman." Tight, classic Jerry button.
0.8 — "Cosmo-GPT" / "gas station sushi roll" is the best pair of consecutive lines in any of the five.
1.0 — Toaster gluten-free singularity. Stays on character despite the swing.
1.2 — George's "daycare for emotional vampires" is great; otherwise feels a beat short on Kramer's excitement.
1.4 — George becomes the explainer ("a French wind"), which is a nice flip. "Secret to AI is being full of hot air" is the cleanest button of the five.
1.4 had the best ending this round; 0.8 had the funniest individual line.
User
Let's try a few on higher temperatures.
Assistant
Going to 1.6, 1.8, and 2.0 (DeepSeek's max). Skipping TaskCreate — same shape as before, three parallel API calls.
Assistant
Three high-temp runs firing. Heads up: at 2.0 there's a real chance of nonsense / API rejection — we'll see how it lands.
User
Assistant
1.8 done, two to go.
User
Assistant
2.0 done, one to go (1.6).
User
Assistant
All three done. Combining and opening.
Assistant
Saved to /tmp/seinfeld_scenes/seinfeld_high_temps.md and opened. (Skipping TaskCreate again — three API calls don't need a tracker.)
The model held together better than I expected at 2.0 — no word salad, the structure stayed intact.
1.6 — Best ending of the three: "Even your AI can't come up with anything original." The "Yes! Like… (strikes a pose)" beat where Kramer can't finish the AI's joke is a clean comedic mechanic.
1.8 — Best Jerry-confusion run yet. The escalation from "Who's Mistral?" → "Who's Llama?" → "What's a gatekeeper?" → final "Who?" works as a real comedic structure. George's "democracy in my sock drawer if you count the holes" is the standout line.
2.0 — Still coherent but lines are getting more random. "Who's Centralized? Is he with the llama?" is great. "Open sauce at the diner" button is the best of the three. Some lines (the banana man, "future is a bag of mush") feel like the model reaching.
Observation: I expected 2.0 to fall apart, but DeepSeek V4 Pro stays remarkably structured even at max temp — probably because the reasoning phase is deterministic and only the surface generation samples wide. 1.8 might actually be the sweet spot — wildest swings that still land, best Jerry-confusion rhythm.
Want me to push further with a different lever (e.g., top_p to 0.99, or frequency_penalty to discourage Llama/Mistral repetition), or try the same prompt through Kimi K2.5 for a totally different voice?
User
Let's do the thing, let's just do five. Let's try a thing where we do five at temperature 2.0 and then just try to combine them together yourself. I tried to keep the weird components, the ideas that it comes up with and combine it into something like this overhaul coherence.
Assistant
All 5 firing at temp 2.0. I'll read them once they're back and stitch the best weird bits into a single coherent ~30-second scene myself.
User
Assistant
Run 3 done, four to go.
User
Assistant
Run 2 done, three to go.
User
Assistant
Run 5 done, two to go (runs 1 and 4). Skipping TaskCreate.
User
Assistant
Run 4 done, just run 1 left.
User
Assistant
All 5 in. Reading them now to mine the best weird ideas.
Assistant
Best material across the five (the bits I want to preserve):
Run 4: "Meta? The guy from the phone booth?" — peak Jerry confusion
Run 2: "food bank for algorithms" — perfect Costanza phrasing
Run 5: "You type 'puffy shirt,' it makes a puffy shirt!" — gift-wrapped callback to S5E2
Run 5: "My laptop can barely run solitaire without wheezing"
Run 3: "brain waves / decentralized consciousness" + "You can't even merge with a parking spot"
Run 5: Jerry mishearing Stable Diffusion as a horse dating app
Run 2: "I'm not open source. I'm a closed, proprietary system that crashes every forty-five minutes" — best closer of the bunch
Stitching:
Assistant
Saved and opened at /tmp/seinfeld_scenes/seinfeld_stitched.md.
The structure I went for:
Kramer's manic name-dump (sets the tornado)
Jerry "Who?" → Kramer says Meta → Jerry's phone-booth misread (locks in the confusion engine)
George with the killer dismissal ("food bank for algorithms")
Jerry's horse-dating-app misread → Kramer corrects with the puffy-shirt callback (which is the real Seinfeld easter egg — the run-5 model just handed us a perfect bridge to S5E2)
Kramer escalates to brain waves / decentralized consciousness
George puncture: parking-spot line
Jerry's laptop-solitaire button on the practical absurdity
George closes on the proprietary-system metaphor
The closer commits to George's worldview — he's been calling the AI a scam the whole scene, and the final line reveals he sees himself as the un-open-sourced one. That's the kind of misdirected self-awareness the show actually trades in.
User
Try to make it feel more like a coherent thread, you know, where things are being passed around in the conversation.
Assistant
v2 saved and opened at /tmp/seinfeld_scenes/seinfeld_stitched.md. (Skipping TaskCreate — single file edit, no tracking needed.)
The rule I used this pass: every line has to either pick up a word from the previous line or call back to something earlier. So:
"open" → "opening" (Jerry warps the term into stand-up), → "opening for nobody" (George volleys it back), → "open source" (George swings back to Kramer's frame).
"food bank" → "co-op" — Kramer doesn't reject George's charity metaphor, he upgrades it.
"the people own the brain" gets caught by Jerry pulling on the pronoun (Whose brain?).
"fine-tune" gets bent back onto Jerry himself.
"puffy shirt" lands as the S5E2 callback — this is the meta-thread the show would actually have done.
"merging with the machine" gets immediately deflated by George ("can't even merge with a parking spot") — same verb, totally different domain.
The closer now resolves the "open source" thread that opened the scene. George's proprietary-crashes line, which in the source was his self-diagnosis, gets weaponized onto Jerry — which is much more Costanza than self-pity.
Net effect: the scene reads as one continuous riff instead of three characters taking turns at the mic.
User
Add in laugh lines.
Assistant
Laugh lines added in standard Seinfeld-script format. Choices I made:
[APPLAUSE] on Kramer's entrance — the live audience always erupted when he came through the door, that's a signature.
[LAUGHTER] on the regular punchlines (Llama opening at the club, food bank for algorithms, "Whose brain?", thoughts at standard pitch, "asked the universe to forget").
[LAUGHTER AND APPLAUSE] on the puffy-shirt callback — that's the kind of moment a live audience claps and laughs at because they recognize it.
[BIG LAUGHTER] on the parking-spot deflation (George demolishing Kramer mid-soliloquy is always the biggest beat).
[BIG LAUGHTER AND APPLAUSE] + [END SCENE] on the closer — standard scene-out cue.
No laugh tag on the straight-lines (Kramer's name-dump, "co-op / own the brain", Jerry's recap question) — those are setups, not punchlines, and tagging them dilutes the rhythm.
User
Does that feel funny and does it feel like true to Seinfeld?
Assistant
Honest answer: it's a good pastiche but it's not actually Seinfeld. A few specific reasons:
What lands:
"Who's Llama? Is he opening for me at the club?" — that's real Jerry. Stand-up vocabulary leaking into civilian life is exactly how he hears the world.
"You can't even merge with a parking spot." — real Costanza. Concrete, mean, deflates an abstraction with a specific failure.
The puffy-shirt callback genuinely works.
What doesn't:
"Food bank for algorithms" is too writerly for George. George doesn't construct cute analogies — he reacts, panics, catastrophizes. Real Costanza is more like "Free? Nothing's free! That's how they get you!" The metaphor is something a writer's room punches up, not something a guy in a sweatshirt thinks of in real time.
"Barely tolerate them at standard pitch" and "the one thing I asked the universe to forget" are too literary for Jerry. His real voice is flatter and more declarative — "I don't need my thoughts fine-tuned. My thoughts are fine. Actually, they're not, but I'm not adjusting them."
The threading itself is wrong. Real Seinfeld dialogue is less connected, not more. Characters talk past each other and stay trapped in their own POV — that's where the comedy lives. The handoff structure I built is closer to Sorkin or modern half-hour writing. Seinfeld scenes have more friction and less call-and-response.
No physical specificity. Real scenes are full of cereal, the fridge, what's on TV, who's at the door. This one is all concepts, no apartment. Jerry should be eating something or staring into the open fridge during half of Kramer's speech.
The closer is too tidy. "Most closed system I know. Proprietary. Crashes every forty-five minutes." is a writer's button — it resolves the open-source thread too cleanly. The show would more likely end on Kramer leaving with misplaced confidence ("Giddy-up!"), or Jerry's flat resignation, or even nothing — just a beat and then somebody asking about Chinese food. Seinfeld scenes often end un-resolved.
Kramer's "co-op! The people own the brain!" is too political. Real Kramer is concrete-absurd, not ideological — "I got a Llama in my closet, Jerry, it's writing my Christmas cards. The thing's got style."
Verdict: funnier than 90% of internet Seinfeld parodies, but it reads like an SNL sketch about Seinfeld more than a Seinfeld scene. Too clean, too connected, too metaphor-rich. The actual show was messier, more material, and the characters were more locked inside themselves.
User
Can you make that whole process we ran there into a little script, you know, that runs just one shot and then just run it again please?
Assistant
Script saved at /tmp/seinfeld_pipeline.py, and the run dropped a scene at /tmp/seinfeld_scenes/seinfeld_pipeline_20260513_195042.md (already open).
The synthesis stage actually did the job — picked the strongest beats from each attempt:
Apartment is present (Jerry eating cereal, putting the bowl down)
George's "open source guilt for years — you don't see her putting it on GitHub" is the standout line, lifted intact from attempt 1
"Sentient soup? So it knows it's cold" — kept verbatim, perfect Jerry
Kramer exits on "my instance is learning bisque. Ciao!" — un-tidy, in character, doesn't try to be a writerly button
What's still a little off: "iambic pentameter" and "democratizing intelligence" are slipping back into too-clean territory. Could tighten the synthesis prompt to push harder against that, but it's already a real improvement over the hand stitch — the mother / GitHub beat alone is better than anything I produced manually.
To re-run any time: python3 /tmp/seinfeld_pipeline.py — each run is timestamped so they don't overwrite each other.
User
Should we add this to the prompt for the clean up step? You know, like with this and the previous one he identified a few problems. Maybe this should be part of the prompt. We obviously don't want to kill the soul of the high temperature one but also yeah.
Assistant
Good call. The synthesis prompt is too philosophical right now — it says "avoid writerly metaphors" but doesn't show what kind of cleanness to reject. Let me bake in concrete DO / DON'T examples drawn from what we've actually seen go wrong.
Assistant
Saved to /tmp/seinfeld_scenes/seinfeld_pipeline_20260513_200014.md and opened. (Skipping TaskCreate.)
Honest read — it's mixed. The notes helped in some places and got ignored in others:
Helped:
George's "Mistral? Sounds like a hair band from the 80s" — concrete, dismissive, exactly the character-leak comedy I described.
Jerry "Liberty? Is she one of the French guys?" — clean Jerry pronoun-trap.
Jerry opening the fridge and grabbing milk — physical specificity actually showed up.
Kramer "It runs on a toaster!" — concrete-absurd, good.
Ignored:
Kramer still says "It's about liberty! Digital liberty!" — that's exactly the kind of ideological-abstract line the system prompt told it not to do. The "DO NOT" examples didn't stick.
George's "They share models like it's potluck for the singularity" is still a writerly metaphor. Same failure mode.
The closer "My fridge is open source, and it only knows to chill" is another writerly button — the model is magnetically drawn to clever closing metaphors no matter how many times we tell it not to.
The opening stage direction got dropped entirely — it jumps straight from [APPLAUSE] to KRAMER: with no apartment-setting beat.
Laugh-tag density got out of control — almost every single line. Worse than the previous run.
So the model partially listened. The character-voice notes worked for George and Jerry but Kramer is still doing TED talks, and the closer instinct is too deeply baked to suppress with prose.
Possible next moves if you want to iterate:
Hard rules for the closer — explicitly say "The closing line MUST be either Kramer's exit ('Giddyup!', 'I'm outta here!') OR Jerry mid-action with no callback. NEVER a metaphor."
Limit laugh tags — "Insert at most 4-5 laugh tags total, only on the biggest jokes."
Run two synthesis passes — first pass produces a draft, second pass is a "polish remover" that explicitly searches for and replaces writerly lines.
Try a different synthesis model — DeepSeek may just have a strong instinct for the polished button. Codex / GPT-5.5 might respect the constraints more literally.
Want me to push on any of these?
User
Do you think it should be broken up into more steps? You know, one step should make it just a coherent thread and then one step should just clean up voice things? And what are we using to clean it up? Are we using DeepSecret now?
Assistant
Yes on both counts.
What's running now: DeepSeek V4 Pro is doing the base generations AND the synthesis. That's actually the core problem — the same model that wrote "potluck for the singularity" in attempt 3 is the one we're asking to recognize "potluck for the singularity" as too writerly in the synthesis. It has the same prosaic instinct on both ends. We're asking it to police itself.
Multi-step would help. Specifically, three passes with one job each:
Thread-weaver (DeepSeek, temp ~0.5) — given 5 attempts, output one coherent ~12-line scene. Don't worry about voice. Just thread the best weird bits into a sequence.
Voice doctor (different model, low temp) — given the threaded scene, ONLY rewrite lines that violate character-voice rules. Leave structure alone. Don't add or remove lines. This is the de-writerly pass.
Laugh-line pass (any model, deterministic-ish) — strip all tags, insert at most 4–5 on the biggest beats. Could even be hand-coded heuristics instead of an LLM call.
The wins from splitting: each pass has a smaller, sharper job; the voice doctor can't accidentally rewrite the whole closer because it's been told only to swap writerly lines; and we can use a different model for the cleanup so it doesn't share DeepSeek's blind spots.
For the voice doctor, I'd use Codex (GPT-5.5). Different family, different prosaic instincts, has tools so it could even diff its changes. Falls back cleanly to chat-only mode for this. Kimi K2.5 would also work as an alternative — but Codex is the bigger swing for "different lens."
Want me to wire up the three-step pipeline that way? It'd take the script from ~6 API calls to ~7 (still cheap), and the voice doctor pass via Codex would be a separate subprocess.
User
Let's just break the cleanup into a few steps, you know. So let's just have one to make it coherent and it also should be on lower temperatures like 1.0 for that. Not 2.0 so let's just do 2.0 for the ideation, 1.0 for the synthesis and then 1.0 for mapping it to the voice, you know. And characters. So there's like three phases in total.
Assistant
You've hit your limit · resets 9pm (Europe/Berlin)
Dataset releases
Not yet included in a published release.
Adversarial review of a Claude diagnosis? → Codex is the highest-signal second opinion because it's the most-different model and has repo access.
"Jury of models" for high-stakes calls? → Fan out the same prompt to Codex + DeepSeek + Kimi in parallel (multiple Bash tool calls in one message). Compare answers.
Already have the answer? → Don't dispatch. Subagents aren't free.
1. Codex (GPT-5.5)
Codex is installed at /Users/user_c042661f/.nvm/versions/node/v20.19.4/bin/codex. The openai/codex-plugin-cc Claude Code plugin wraps it as /codex:review etc., but the underlying call is codex exec — invoke it directly from Bash.
Basic invocation:
bash
codex exec --sandbox read-only "PROMPT_HERE"
--sandbox read-only — analysis only, no file writes
--sandbox workspace-write — let Codex modify project files
--sandbox danger-full-access — full shell (avoid unless explicitly requested)
-m gpt-5.5 — pin the model (default; check ~/.codex/config.toml first if you'll override)
-c model_reasoning_effort=medium — medium is the default; bump to high for hard reasoning, drop to low for mechanical edits
Always seal stdin with </dev/null when running Codex non-interactively. If stdin isn't a TTY and isn't /dev/null, codex exec will block forever at "Reading additional input from stdin..." even when the prompt is fully supplied as an argument. The process sits at 0% CPU and silently waits — no error, no timeout. See Detecting hangs below.
Background long sessions via the Bash tool's run_in_background: true. Pair with timeout 600 codex exec ... so a wedged run self-terminates instead of squatting indefinitely.
codex apply — apply Codex's last diff with git apply
2. Claude (via Claude Code Agent tool)
Claude subagents are dispatched through the Agent tool already available in this harness. They run as cleanly-scoped instances with no memory of the outer conversation — so the prompt must be self-contained.
Subagent types worth knowing:
general-purpose — catch-all for research, multi-step tasks, code edits with full tool access.
Explore — fast read-only search agent. Use it to find files / grep / "where is X defined."
Plan — software-architect agent that returns step-by-step plans without writing code.
claude-code-guide — Claude Code / Anthropic SDK / Claude API questions.
code-reviewer — independent review of a diff or change.
statusline-setup, others — see the agent list at the top of the harness prompt.
Invocation pattern (inside this Claude Code session):
code
Agent({
description: "Independent root-cause review",
subagent_type: "general-purpose",
prompt: "<self-contained brief: working dir, files to read, what to return, response cap>"
})
Key prompt rules (same as any subagent):
Name the working directory explicitly.
List exact files/paths to read, not "the relevant files."
State the desired output format (diff, ranked list, schema proposal).
Cap the response length ("under 600 words").
For adversarial tasks, tell Claude to be opinionated — otherwise it hedges.
When to prefer Claude over Codex: when you want the same family of judgement (Claude is what's already driving the conversation) but isolated from the outer context — e.g., to keep the main thread clean during a big repo sweep. For genuinely different judgement, prefer Codex or DeepSeek.
3. DeepSeek V4 Pro (official API)
DeepSeek V4 Pro is invoked via the official DeepSeek API at https://api.deepseek.com. The matching megaplan profile is all-deepseek-pro-direct (spec: hermes:deepseek:deepseek-v4-pro).
API key: DEEPSEEK_API_KEY, sourced from ~/.hermes/.env
It's a reasoning model. Reasoning tokens count against max_tokens. Setting max_tokens: 200 will exhaust the budget on reasoning and return empty content. Use ≥ 2000 for short answers, ≥ 16000 for analysis.
One-shot invocation:
bash
set -a; source ~/.hermes/.env; set +a
curl -s -X POST https://api.deepseek.com/v1/chat/completions \
-H "Authorization: Bearer $DEEPSEEK_API_KEY" \
-H "Content-Type: application/json" \
-d @- <<'EOF' | python3 -c "import sys,json; d=json.load(sys.stdin); print(d['choices'][0]['message']['content'])"
{
"model": "deepseek-v4-pro",
"messages": [
{"role": "system", "content": "You are an adversarial code reviewer. Be opinionated and concise."},
{"role": "user", "content": "..."}
],
"max_tokens": 16384,
"temperature": 0.3
}
EOF
For multi-paragraph prompts, build the JSON with python3 -c or write it to /tmp/deepseek_req.json and -d @/tmp/deepseek_req.json.
Inspecting reasoning: the response has choices[0].message.reasoning_content separately from content. Print content for the answer; sample reasoning_content if you want to see how it got there.
Tools / agentic mode: DeepSeek V4 Pro via curl has no tools — pure chat. For agentic work, run a megaplan plan with --profile all-deepseek-pro-direct (see Agentic delegation).
4. Kimi K2.5 (via megaplan/hermes Fireworks route)
Kimi K2.5 in this setup is the Fireworks-hosted model accounts/fireworks/models/kimi-k2p5, the same route the megaplan all-open profile uses (via the hermes:fireworks:... agent spec). Direct Moonshot keys (KIMI_API_KEY) are not configured locally; OpenRouter quotas are exhausted; Fireworks is the working path.
API key: FIREWORKS_API_KEY, sourced from ~/.hermes/.env
It's a thinking model. Same gotcha as DeepSeek — set max_tokens to ≥ 2000 for any non-trivial answer. With small budgets it'll burn the whole window on reasoning and finish with length before emitting the answer.
Alternative model: accounts/fireworks/models/kimi-k2p6 (K2.6, newer). Same code path, swap the model string.
One-shot invocation:
bash
set -a; source ~/.hermes/.env; set +a
curl -s -X POST https://api.fireworks.ai/inference/v1/chat/completions \
-H "Authorization: Bearer $FIREWORKS_API_KEY" \
-H "Content-Type: application/json" \
-d @- <<'EOF' | python3 -c "import sys,json; d=json.load(sys.stdin); print(d['choices'][0]['message']['content'])"
{
"model": "accounts/fireworks/models/kimi-k2p5",
"messages": [
{"role": "system", "content": "You are an independent reviewer. Be opinionated and concise."},
{"role": "user", "content": "..."}
],
"max_tokens": 16384,
"temperature": 0.3
}
EOF
Tools / agentic mode: the curl path is pure chat. To get Kimi as a tool-using agent inside the megaplan harness ("via megaplan agent" in the deeper sense), use a megaplan run with a Kimi-based profile — e.g., all-open (Fireworks Kimi-k2p6) — or write a one-off profile that pins Kimi K2.5 to the phases you care about.
Agentic delegation (when curl isn't enough)
The DeepSeek and Kimi pathways above are chat one-shots. When you need either model to do work — read files, write code, run commands — route through megaplan instead:
Swap --profile all-open for Kimi (Fireworks-hosted). --robustness light skips prep/gate/review for a faster single-pass run. For full multi-phase work, drop the flag (defaults to standard).
The megaplan skill (already loaded in this harness) covers the workflow; this skill just points you to the right profile.
Regardless of which pathway you use, the receiving model starts with zero context from your conversation. Treat every dispatch like briefing a smart colleague who just walked into the room:
Working directory — name it explicitly (/Users/user_c042661f/Documents/megaplan).
Files / paths — list exact paths, not "the relevant files."
Goal + why — what you're trying to accomplish and why the answer matters.
What you've already ruled out — saves the subagent re-doing your work.
Output shape — diff, ranked list, JSON, prose under N words. Specify.
Length cap — "under 600 words" or "respond in under 200 words."
Be opinionated — for adversarial / second-opinion tasks, tell the model not to hedge. Otherwise they'll all hedge.
Long prompts (>2 KB) belong in a file (/tmp/<task>_prompt.md) and get loaded by cat or -d @file.
Fan-out: judge / jury patterns
When the call is genuinely high-stakes, send the same prompt to multiple models in parallel and compare. From this harness, that means a single message with multiple Bash tool calls (or Agent calls) in parallel:
Codex via codex exec
DeepSeek via curl
Kimi via curl
Optional: a Claude Agent invocation as a fourth panelist
Diverging answers are signal. Convergence on a subtle judgement is much stronger evidence than any single model's confidence.
Don't fan out for routine work — it's wasteful. Reserve it for: pre-merge review of risky changes, architecture decisions you can't easily reverse, security-sensitive code paths, judging artifacts that megaplan itself produced.
Bundles
Preconfigured fan-outs aimed at a specific kind of decision. Same problem, different lenses, run in parallel, no cross-talk.
Agent UX bundle
Three parallel Codex subagents (GPT-5.5, model_reasoning_effort=medium) sense-check the same proposal from three lenses:
Human user — what's confusing, surprising, or invisible to the end person?
Agent user — would an LLM reading this cold pick the right tool / default / path?
Technical abstraction — are the boundaries clean and the abstractions load-bearing?
Use for changes that touch all three surfaces (new CLI, new API, new prompt/workflow, slash command). Skip for pure bugfixes or one-layer work.
Briefing rules: same unbiased problem write-up to all three; each gets only its own lens plus a note that two others are running; tell each to take a position and not hedge; cap ≤ 600 words; never show one's output to another.
bash
cat > /tmp/agent_ux_problem.md <<'EOF'
<unbiased factual description of the proposal>
EOF
# Single message, three parallel Bash calls — one per lens:
codex exec --sandbox read-only -c model_reasoning_effort=medium "$(cat <<'EOF'
Sense-check from the **human user perspective**. Two other reviewers cover the agent-user and technical-abstraction lenses — skip their ground. Take a position, do not hedge. ≤ 600 words.
PROBLEM:
$(cat /tmp/agent_ux_problem.md)
EOF
)" 2>&1 | tail -200
# …repeat with "agent user perspective" and "technical abstraction perspective".
Synthesize: concerns in >1 lens are likely real; disagreement between lenses usually means the design optimizes one surface at another's expense.
Sanity checks before dispatching
Is there an equivalent built-in agent (Claude Agent with Explore or general-purpose) that would work? If yes and you don't need genuinely independent judgement, use it.
Does the task need write access? If yes, Codex workspace-write or Claude Agent (with edit tools) — DeepSeek/Kimi curl can't write files.
Are you re-asking what you already answered? If so, add the twist (rank these, find the flaw, argue the other side) — otherwise you're just burning tokens.
For DeepSeek/Kimi: did you set max_tokens high enough that the reasoning budget won't eat the answer? Default to 16384 unless you have a reason to go lower.
Is ~/.hermes/.env actually sourced in your shell call? It isn't by default — prepend set -a; source ~/.hermes/.env; set +a whenever you're shelling out via curl.
Detecting hangs / liveness checks
Every pathway has a specific way to silently wedge. Each requires a different smoke-test. If you dispatch a long-running subagent, do a liveness check 30-60 seconds after launch — not 10 minutes in. Cheap to verify, expensive to leave running.
Codex (codex exec)
Failure mode: blocks on stdin even when prompt is fully supplied as argv — sits at 0% CPU, 0.1% MEM, output file at ~39 bytes containing only the literal banner Reading additional input from stdin... and nothing else. Forever. No timeout, no error.
Important — that banner string appears in healthy runs too. Codex always prints Reading additional input from stdin... as its first line on launch, even when the prompt was supplied as argv. Presence of the string is not the signal. The signal is whether anything follows it.
Prevention: redirect stdin from /dev/null. Always. The banner still prints but the process doesn't actually block.
The differentiator is file growth, not file content. Healthy Codex streams output continuously and the file is many KB by 30s; wedged Codex stays at ~39 bytes (just the banner).
bash
# Snapshot, wait, snapshot — growth is the signal:
SZ1=$(wc -c < /tmp/out.txt); sleep 5; SZ2=$(wc -c < /tmp/out.txt)
echo "growth: $SZ1 -> $SZ2" # equal AND tiny = wedged. growing = healthy.
# Process check confirms — wedged proc has 0% CPU with minutes elapsed:
ps -o pid,stat,%cpu,etime -p $(pgrep -f "codex exec") 2>/dev/null
Note: healthy Codex also shows low %CPU locally (reasoning happens server-side), so CPU alone is ambiguous — pair with file-growth or banner-only check. The all-three combination (banner-only output AND 0% CPU AND minutes elapsed) is conclusive wedge.
Recovery:pkill -f "codex exec" and re-run with </dev/null. Wrap in timeout 600 ... going forward.
DeepSeek / Kimi (curl)
Failure modes (in order of frequency):
Reasoning ate max_tokens — request returned 200 OK, content is empty string, finish_reason: "length". Set max_tokens ≥ 2000 for short answers, ≥ 16000 for analysis.
HTTP error masked by curl -s — auth, quota, rate-limit, or 5xx. curl -s swallows the status; the pipe to python3 -c "...['content']" then throws KeyError on error payload, with no clue what went wrong.
Server hang — TCP open, no response. With no --max-time, curl waits indefinitely.
Prevention pattern (use this every time, not the bare curl -s shown in earlier examples):
bash
set -a; source ~/.hermes/.env; set +a
curl -sS --fail-with-body --max-time 300 \
-X POST https://api.deepseek.com/v1/chat/completions \
-H "Authorization: Bearer $DEEPSEEK_API_KEY" \
-H "Content-Type: application/json" \
-d @/tmp/req.json \
> /tmp/raw.json
# Parse defensively — distinguish error from empty content:
python3 - <<'PY'
import json, sys
d = json.load(open('/tmp/raw.json'))
if 'error' in d:
print('API ERROR:', d['error']); sys.exit(1)
msg = d['choices'][0]['message']
content = msg.get('content') or ''
if not content:
print('EMPTY CONTENT. finish_reason=', d['choices'][0].get('finish_reason'),
'reasoning_len=', len(msg.get('reasoning_content') or ''))
else:
print(content)
PY
Liveness check (30-60s post-launch for background curls):
bash
wc -c /tmp/raw.json # 0 = still waiting or network dead
pgrep -fl curl # process still alive?
# If raw.json has content but parse fails, inspect raw.json directly —
# the error payload is the diagnosis.
Healthy curl: writes nothing until the response arrives in one chunk (streaming is opt-in). So an empty file at 60s isn't necessarily wedged — but at 5+ minutes with no --max-time it almost certainly is. Always set --max-time 300 so wedged curls self-terminate with a clear timeout error.
Claude Agent (Agent tool)
Failure modes: much rarer than the curl/Codex paths because the Agent tool runs in-process and surfaces errors through the tool-result envelope. The two real risks:
Subagent loops — bad tool / bad prompt causes the inner agent to grind. The harness will eventually return; there's no external timeout you control.
Terse prompt → shallow output — not a hang, but the most common form of "wasted dispatch." Diagnosis: response comes back in <30s with generic hedging.
Prevention:
Cap the response length explicitly (under 600 words, respond in under 200 words).
For adversarial tasks, instruct "take a position, do not hedge."
For exploration, prefer Explore subagent (fast, read-only) over general-purpose.
Liveness check: none available mid-flight — Agent tool calls are synchronous from your perspective. If an Agent dispatch is suspiciously long, the recourse is to wait or cancel the parent turn.
megaplan
Failure modes: runs are multi-phase and stage at finalize-to-execute checkpoints in review mode. The "wedge" is usually waiting for human approval, not a stuck process.
Liveness check:
bash
megaplan status --plan <name> # current state + next-step runtime hint
megaplan progress --plan <name> # per-batch completion in execute
A genuinely stuck megaplan run is rare; an apparently stuck one is usually a gated step waiting for an override (megaplan override force-proceed or replan).
Universal rule
Liveness ≠ correctness. A subagent can run for 10 minutes producing token-by-token output and still emit a useless answer. Liveness checks catch the silent-wedge failure mode. The bad-output failure mode (hedging, missed the question, hallucinated file paths) needs you to actually read the response — there's no shortcut.
Quick reference
bash
# 1. Codex — always seal stdin with </dev/null
codex exec --sandbox read-only "<prompt>" </dev/null
codex exec --sandbox workspace-write "<prompt>" </dev/null # implementer
codex exec review --pr 123 # PR review
codex apply # apply last diff
# Wedge-proofing: prefix with `timeout 600 ` for long runs.
# 2. Claude — call the Agent tool from inside this Claude Code session
# (no shell command; use the Agent tool with a subagent_type)
# 3. DeepSeek V4 Pro — always -sS --fail-with-body --max-time 300
set -a; source ~/.hermes/.env; set +a
curl -sS --fail-with-body --max-time 300 https://api.deepseek.com/v1/chat/completions \
-H "Authorization: Bearer $DEEPSEEK_API_KEY" -H "Content-Type: application/json" \
-d '{"model":"deepseek-v4-pro","messages":[...],"max_tokens":16384}'
# 4. Kimi K2.5 (Fireworks)
set -a; source ~/.hermes/.env; set +a
curl -sS --fail-with-body --max-time 300 https://api.fireworks.ai/inference/v1/chat/completions \
-H "Authorization: Bearer $FIREWORKS_API_KEY" -H "Content-Type: application/json" \
-d '{"model":"accounts/fireworks/models/kimi-k2p5","messages":[...],"max_tokens":16384}'
# Agentic delegation for DeepSeek/Kimi
PYENV_VERSION=3.11.11 megaplan init --project-dir "$PWD" \
--profile all-deepseek-pro-direct --robustness light "<task>"
PYENV_VERSION=3.11.11 megaplan init --project-dir "$PWD" \
--profile all-open --robustness light "<task>" # Kimi via Fireworks (k2p6)
ARGUMENTS: can you change the temperature and other settings on deepseek?
If you want me to take another pass with these notes in mind, I can — the goal would be making it worse in a specific way: less polished, more cereal, more talking past each other.