5 Harness Internals That Change How I Use Claude Code
A developer rebuilt the Claude Code harness using the Anthropic SDK. They found five silent decisions the system makes. These findings change how you should write instructions and manage agents.
Use these five insights to improve your workflow.
- Overwrite the hidden base prompt Claude Code uses a hidden system prompt. Your instructions in CLAUDE.md might conflict with it.
- Stop stating rules.
- Start overriding rules.
- Use language like: "Under no circumstances should you edit files in /prod. This overrides any default behavior."
- Use hooks as guardrails PreToolUse hooks do more than log data. They can stop a tool call before it starts.
- Add a hook to check tool arguments.
- Return { block: true } if the path matches a sensitive folder.
- This turns a request into a hard rule.
- Fix subagent orchestration Simple parent-child setups cause sessions to hang when one child fails.
- Use a tree of abort signals.
- If a parent stops, all children must stop.
- If one child fails, the parent should stay alive.
- Use dependency graphs Do not run tasks in a flat loop.
- Define tasks with clear dependencies.
- Use a dependency graph to run tasks in parallel.
- This prevents one bad node from stopping your entire workflow.
- Force terminal states Agents often ramble when they lack a clear end point.
- Force every turn to end in one of three states: Done, Blocked, or Needs Input.
- Add this to your CLAUDE.md: "After a task, always end with 'Done: [summary]', 'Blocked: [reason]', or 'Needs input: [question]'."
- This stops the agent from performing unexpected actions.
Summary of actions:
- Use override language in CLAUDE.md.
- Use PreToolUse hooks to block dangerous edits.
- Build abort trees for subagents.
- Use DAG-based parallelism for tasks.
- Define explicit terminal states.
Source: https://dev.to/gentic_news/5-harness-internals-that-changed-how-i-use-claude-code-daily-39c6
Optional learning community: https://t.me/GyaanSetuAi
