Mariomarquezt/multi-flow-skills / skills/sliced-review
sliced-review
FlaggedReview a whole codebase with several models by cutting it into small file-listed slices ordered by blast radius, then triage every finding with three judges, and optionally fix. Use when the user asks to review or audit a whole project or repo with other models, wants a second opinion on a codebase, wants a review split into slices or tiers, has a whole-repo review that died on credits, or wants a check before a launch or handover. Modes (`3`, `5`, `8`, `fast`, `fix …`, `fix fast …`, `fix only`, `report`, `no wrap`) are in the body. Not for a plan before code exists (/grill-me-codex, /codex-review) or a single diff, branch or PR (/code-review).
references/keep-warm.md
View on GitHub# Keep the prompt cache warm (rule for every skill that waits for a long run)
Added 2026-10-08 (the user). Measured the same day on six test runs.
## The problem
A Claude subagent keeps its prompt cache for **5 minutes** after its last request. The main session
keeps it for 1 hour. When a subagent waits longer than 5 minutes in ONE tool call (a builder, a
reviewer, a test suite, a `codex exec`), its next request writes its WHOLE context again.
Measured: about 150k tokens each time = $0.75 at $5 per 1M (5-minute write). One request that reads
the cache costs about $0.03. Prices: Opus 5.5, confirmed by the user 2026-10-08.
## The rule
**No tool call of a subagent waits longer than 230 seconds.** (the user 2026-10-08: keep 230. The
5-minute timer starts at the previous request, so the model's own writing time and the ssh time
count too. 230 s of wait can be 290 s on the timer.)
1. Start the long command in the background:
- any command: `~/.claude/skills/multi-model-fix/templates/lean/bg-run.sh <logs dir> <step> -- <command...>`
- a Devin run: `.../lean/lean-run.sh <mode> <run dir> <brief file> <logs dir> <step>` (sets the tag)
2. Wait in short steps: `.../lean/lean-wait.sh <logs dir> <step>`. It returns after 230 s at most
and prints `RUNNING` (call it again) or `DONE rc=<n>` + the end of the log.
3. Never `pgrep -f` wait loops (the pattern matches the waiting shell). Never a bare long `sleep`.
4. When the work runs on another machine, copy the scripts there first (`scp`), then call them
through `ssh`. One `ssh` call per wait.
## Who needs it
- A **subagent** that leads, builds or reviews and waits for a runner or a long test: ALWAYS.
- The **main session** (1-hour cache): not needed for the cache. The background start + done-file
is still the safe way to wait (no `pgrep` trap, the user can talk while it runs).
- When you brief a subagent that will wait for runs, put this rule and the script paths in the brief.
## It is automatic for every subagent (hook, 2026-10-08)
`~/.claude/hooks/subagent-keepwarm.py` (Mac and laptop, in `~/.claude/settings.json` under
`SubagentStart` and `PreToolUse` / `Bash`; outside this repo) does two things for EVERY subagent,
with or without a skill:
- at the start it puts this rule and the two script paths in the subagent's context;
- it REFUSES a foreground Bash call of a subagent with a timeout above 240 s, and says how to run
it with `~/.claude/hooks/bg-run.sh` and `~/.claude/hooks/bg-wait.sh` (the same two scripts as
`lean/bg-run.sh` and `lean/lean-wait.sh`, at a path that does not depend on this repo).
The main session is never touched. Tested live on the laptop 2026-10-08 (rule seen, a 300 s call
refused). A session reads its hooks at start: sessions opened before the install do not have it.
## The other fix (not used)
The user 2026-10-08: stay on the 5-minute cache and keep warm. The setting below is OFF on both machines.
Setting `"subagentPromptCacheTtl": "1h"` in `~/.claude/settings.json` (Claude Code 2.1.242 or
newer) gives subagents the 1-hour cache. Every cache write then costs $8 and not $5 per 1M, and the
setting is ignored while the plan is in overage. The short waits are cheaper; the setting is the
safety net. Which one the user keeps: see `docs/STATUS.md`.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |