# Keeping the goal and recent state intact in long coding-agent sessions on a local 27B model

> Source: <https://discuss.huggingface.co/t/keeping-the-goal-and-recent-state-intact-in-long-coding-agent-sessions-on-a-local-27b-model/191248#post_2>
> Published: 2026-10-30 22:35:50+00:00

Your tracker file is the right instinct; make it the whole mechanism. Keep one small file holding the goal verbatim, an append-only log of decisions with their reasons, and current status, and re-inject that file whole at every chunk boundary instead of a rolling summary, because a summary quietly edits the past and a decision it drops or softens returns as an open question. Let retrieval fetch evidence on demand, never the goal or the decisions, and rebuild the status section from what the work itself shows (files changed, tests run, results) instead of the model’s account of it. Fine-tuning on goal-anchored traces is unlikely to fix this, since it teaches staying on task inside a chunk while the loss happens between chunks, in state the weights never see. Check it on one long task run both ways, counting decision reversals and re-done steps: if the pinned file does not cut both sharply, the drift is in the model, not the memory.
