A Claude Code workflow built from past losses: five-layer harness guards against context and command failures
The author rarely encounters Claude Code's auto-compact warning because the workflow is structured to keep sessions well under half of the context window, since compaction replaces conversations with lossy summaries. The approach, termed harness engineering, treats the environment around the model (context, permissions, feedback, orchestration, and self-tests) as more decisive than the prompt itself. The harness was developed on a household pantry and nutrition tracker and grew through real incidents, starting with hooks added on 14 August 2026. Key components include a session-start hook that measures repository state directly and a shell-command guard that refuses irreversible actions while warning about misleading ones. The author also notes that piping test output through tail can mask failing exit codes.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in