Digitorn
Digitorn
All terms
Agent concepts

Goal pinning

A pattern where the original goal is auto-injected at the top of every turn so the LLM cannot lose the thread.

also known as: goal injection
In depth

After ten or fifteen turns, the original goal gets buried under tool results, and the LLM starts drifting. Goal pinning fixes this structurally: a hook at turn_start re-injects the goal before any tool result lands. The agent physically cannot forget what it cannot unsee. It's the cheapest improvement you can make to a long-running agent, three lines of YAML.

What it looks like in practice

YAML
1hooks:2  - on: turn_start3    do:4      - inject_message:5          role: system6          content: "REMINDER: {{memory.goal}}"
Related concepts
Read the deep dive

Hooks: 4 production patterns we ship today on Digitorn

Read article
Newsletter

Get the next post in your inbox.

Engineering notes from the Digitorn team. No marketing, no launch announcements, no "10 prompts that will change your life". Just the things we write that we'd want to read.

One-click unsubscribe. We never share your address. Powered by our own infrastructure, not a tracker.

More in Agent concepts

Agent loop/glossary/agent-loopAgent spawn/glossary/agent-spawnAI agent/glossary/ai-agentCompaction/glossary/compactionCoordinator agent/glossary/coordinatorFunction calling/glossary/function-calling