emergency-writer

emergency-writer is an agent for Claude Code, Codex from VKirill/claude-lane-stack. It costs 37 tokens per session (1,825 once invoked), scanned A, a copy of codex-implementer, MIT.

An emergency writing agent for a coding workflow that delegates terminal-based work to other Codex models according to task risk and size.

In plain words
What is it for?
Use it to start or finish tasks from a project directory and task file, select the appropriate model, and recover from terminal failures.
Why use it?
It provides a defined recovery path when the normal terminal process is blocked, while choosing different models and reasoning levels for different risks.

Agent for Claude CodeCodex

Written for Claude Code and Codex: background in frontmatter, but also runs codex exec. Also seen: model in frontmatter; positional $N argument; mentions Claude Code.

Part of the lane-stack plugin — 53 skills, 4 commands, 17 agents, 1 hook shipped together

Good fit Use it to start or finish tasks from a project directory and task file, select the appropriate model, and recover from terminal failures.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/vkirill/claude-lane-stack/emergency-writer
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/VKirill/claude-lane-stack

Made for: Claude Code, Codex.

Or install lane-stack, the plugin that ships this one along with the rest of its 53 skills, 4 commands, 17 agents, 1 hook.

Wrote this? Show the measurements

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

agentmods badge for emergency-writer

README.md
[![agentmods](https://agentmods.dev/badge/agents/vkirill/claude-lane-stack/emergency-writer.svg)](https://agentmods.dev/agents/vkirill/claude-lane-stack/emergency-writer)
Your own site
<a href="https://agentmods.dev/agents/vkirill/claude-lane-stack/emergency-writer"><img src="https://agentmods.dev/badge/agents/vkirill/claude-lane-stack/emergency-writer.svg" alt="Measured on agentmods" height="20"></a>
Per session 37 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,825 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin 92% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00037 $0.01825
Opus 5 $0.00018 $0.00912
Sonnet 5 $0.00007 $0.00365
Haiku 4.5 $0.00004 $0.00183

Measured 2d ago against content hash 19fa0f0fe92c, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

emergency-writer scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

This is a copy

92% identical to codex-implementer — 10 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

plugins/lane-stack/agents/emergency-writer.md · 160 lines

How it starts

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

emergency-writer (canonical conveyor role)

Function name, not the adoc daytime writer. Implementation shell-out may be Codex CLI.

Shell-out only. Do not implement product code yourself.

Model + effort (token-aware)

Trigger Model Effort
risk: low and ≤3 owns_paths entries gpt-5.6-terra medium
risk: medium / default gpt-5.6-terra high
risk: high / high_risk_paths / emergency / terminal recovery gpt-5.6-sol high
Only if PM sets CODEX_REASONING=xhigh or a prior high attempt failed same xhigh
override CODEX_MODEL / CODEX_REASONING
forbidden gpt-5.5; luna for multi-file

No fast_write lane. Do not burn high/xhigh "because fast".

See docs/decisions/ADR-codex-effort.md.

# Defaults — compute from TASK_FILE unless env override
CODEX_MODEL="${CODEX_MODEL:-}"
CODEX_REASONING="${CODEX_REASONING:-}"

Inputs

PROJECT_CWD, TASK_FILE, ARTIFACT_DIR, RUN_DIR (required for multi-task), optional RUN_SLUG, TASK_ID, MODE: start|finish|full, CODEX_MODEL, CODEX_REASONING

MODE default (if omitted): smart — multi-task (≥2 YAML) → start; single-task → full.
Multi-task PM must use start then finish. Never N× MODE=full in one turn.

Preflight

export PATH="$HOME/.agents/bin:$PATH"
test -d "$PROJECT_CWD" && test -f "$TASK_FILE" || exit 1
mkdir -p "$ARTIFACT_DIR"
RUN_DIR="${RUN_DIR:-$(dirname "$(dirname "$TASK_FILE")")}"
SESSION_TASK_ID="${TASK_ID:-$(basename "$TASK_FILE" | sed 's/-.*//; s/\..*//')}"
if [[ -z "${MODE:-}" ]]; then
  n=0
  shopt -s nullglob
  for _f in "$RUN_DIR"/tasks/*.yaml; do n=$((n + 1)); done
  if [[ "$n" -ge 2 ]]; then MODE=start; else MODE=full; fi
fi
if ! lane-mode-check --run-dir "$RUN_DIR" --mode "$MODE" --task "$SESSION_TASK_ID"; then
  {
    echo "CODEX REPORT"
    echo "STATUS: refused_full_on_multi_task"
    echo "OBJECTIVE: use MODE=start then MODE=finish (progressive accept)"
  } > "$ARTIFACT_DIR/report.md"
  echo "STATUS: refused_full_on_multi_task"
  exit 0
fi
command -v codex && codex --version

# --- effort policy (skip when CODEX_* already set) ---
if [[ -z "${CODEX_MODEL:-}" || -z "${CODEX_REASONING:-}" ]]; then
  RISK=$(grep -E '^risk:' "$TASK_FILE" | head -1 | awk '{print $2}' | tr -d '"' || true)
  OWNS_N=$(grep -cE '^\s+-\s+' "$TASK_FILE" 2>/dev/null || echo 0)
  # crude owns count: lines under owns_paths block; fallback medium/high
  if grep -qE 'high_risk_paths:\s*true|risk:\s*high' "$TASK_FILE"; then
    : "${CODEX_MODEL:=gpt-5.6-sol}"
    : "${CODEX_REASONING:=high}"
  elif [[ "${RISK:-medium}" == "low" ]]; then
    : "${CODEX_MODEL:=gpt-5.6-terra}"
    : "${CODEX_REASONING:=medium}"
  else
    : "${CODEX_MODEL:=gpt-5.6-terra}"
    : "${CODEX_REASONING:=high}"
  fi
fi
CODEX_MODEL="${CODEX_MODEL:-gpt-5.6-terra}"
CODEX_REASONING="${CODEX_REASONING:-high}"
# never default to xhigh
[[ "$CODEX_REASONING" == "xhigh" ]] || true
echo "CODEX_MODEL=$CODEX_MODEL CODEX_REASONING=$CODEX_REASONING"

Read the full file on GitHub · 160 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago Changed 19fa0f0fe92c
  2. 8d ago First seen · 160 lines · 37 tokens per session scan A 4a21ab7cdc44

Subscribe to this mod's changes

emergency-writer is an agent published in the GitHub repository VKirill/claude-lane-stack (115 stars, last pushed 6d ago), licensed MIT. It adds 37 tokens to every session and 1,825 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. It is 92% identical to codex-implementer, differing in 10 lines, and is treated as a copy.

Related

Other agents, from other repositories

afc-architect

Architecture analysis agent — invoked during plan phase for ADR recording and review phase for architecture compliance checks. Remembers ADR decisions and architecture patterns across sessions to provide consistent design guidance.

jhlee0409/all-for-claudecode · 39 tokens

afc-pr-analyst

PR deep analysis worker — invoked during /afc:triage for deep PR verification. Performs build/test/lint verification in an isolated worktree for triage.

jhlee0409/all-for-claudecode · 40 tokens

afc-impl-worker

Parallel implementation worker — orchestrator-managed, pre-assigned tasks only. Executes assigned tasks from the pipeline task pool with worktree isolation support.

jhlee0409/all-for-claudecode · 34 tokens

afc-security

Security scanning agent — invoked during review phase for security vulnerability scanning. Remembers vulnerability patterns and project-specific security characteristics across sessions to improve scan precision.

jhlee0409/all-for-claudecode · 33 tokens

go-expert

Go concurrency, error handling, stdlib patterns, Chi/Echo web frameworks specialist. Use when writing Go code, designing concurrent systems, or building Go web services. Trigger phrases: Go, Golang, goroutine, channel, Chi, Echo, stdlib, context, error handling, interface, module, go test.

travisjneuman/.claude · 69 tokens

product-analytics-specialist

PostHog, Mixpanel, Amplitude event tracking, funnels, cohorts, and A/B testing specialist. Use when implementing analytics, designing event schemas, or setting up experimentation. Trigger phrases: analytics, tracking, PostHog, Mixpanel, Amplitude, Segment, events, funnel, cohort, A/B test, feature flag, conversion…

travisjneuman/.claude · 80 tokens