Tips // Claude in practice

Tips for working better with Claude

One short tip at a time, with an example you can copy. Move through them at random or search for what you need.

APIIntermediateClaude API

With thinking + tools, send thinking blocks back untouched

If in a tool loop you delete or edit the thinking block to save context, the next request fails because of the signature.

Each thinking block comes with a signature that confirms the reasoning was not altered. On the next turn it has to be returned exactly as it arrived; redacted_thinking blocks too, even though they are encrypted. If you worry about accumulated context, the answer is context engineering (pruning, compaction, subagents), not trimming blocks.

Example
# Build the next turn with the full content of the response
messages.append({"role": "assistant", "content": response.content})
# do not filter or summarize the thinking blocks
#extended-thinking#tool-use#context