000%
claude.sh
view on github ↗24 lines · bash
#!/bin/bash
# Agent adapter: Claude Code. Sourced by run-night.sh after run_with_timeout is defined.
# Contract (same for every adapter):
# agent_canary <outfile> -> outfile contains READY on success
# agent_run <outfile> <promptfile> <model> <effort> <timeout_secs>
# -> outfile is JSON {result, total_cost_usd, ...}
CLAUDE_BIN="${CLAUDE_BIN:-$(command -v claude || echo "$HOME/.local/bin/claude")}"
agent_canary() {
run_with_timeout 180 "$1" "$CLAUDE_BIN" -p 'Reply with exactly: READY' \
--model "$MODEL" --effort low --setting-sources project \
--strict-mcp-config --mcp-config "$OPS/night-mcp.json" </dev/null
}
agent_run() { # outfile promptfile model effort timeout
run_with_timeout "$5" "$1" \
"$CLAUDE_BIN" -p "$(cat "$2")" \
--model "$3" --effort "$4" \
--output-format json \
--setting-sources project \
--strict-mcp-config --mcp-config "$OPS/night-mcp.json" </dev/null
}
agent_relogin_hint() { echo "Run 'claude' interactively to re-login."; }
FULL INDEX
flow-designwhat this folder doesA progressive design interview: one question per screen, ending in a clickable HTML prototype of a linear user journey (onboarding, checkout, wizard).
loopswhat this folder doesGive an agent a goal, a budget, a cadence and a model. It works one bounded run at a time while you sleep, inside a fence, and hands you four plain sentences in the morning.
prototype-swarmwhat this folder doesCrawls a multi-screen HTML prototype for undefined click destinations and spawns one generator agent per missing screen, with a handoff packet written by the source screen, until the click graph is covered.
self-maintenancewhat this folder doesThe one way an unattended run may touch its own loop registry, and the one place a "need from you" becomes a decision you settle with a single command instead of a paste.
pm-strategistwhat this folder doesA product and strategy advisor agent that blends three lenses (build taste, business structure, PM execution) and pressure-tests ideas instead of cheerleading.
todowhat this folder doesA TODO list for PMs in one markdown file, reachable from Claude Code and from Telegram: capture, see what's due, triage, and hand items to an agent that asks before it acts.
rev-intel-harness ↗what this folder doesA CSV of companies in, the people out: point your existing AI subscriptions at target accounts. Open source, MIT.
karma ↗what this folder doesA personal knowledge graph over everything the loops write: seeds in, relationships out, so a month of night reports stays searchable. Open source, MIT.