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.
Keeping the goal and recent state intact in long coding-agent sessions on a local 27B model
A practitioner guide recommends pinning a single tracker file — holding the goal verbatim, an append-only decision log with reasons, and current status — and re-injecting it whole at every chunk boundary in long coding-agent sessions on a local 27B model, rather than relying on a rolling summary that can drop or soften past decisions. The guide argues retrieval should fetch evidence on demand but never the goal or decisions, and that status should be rebuilt from observable work (files changed, tests run, results) rather than the model's own account. It advises validating the approach on one long task run both ways, counting decision reversals and re-done steps, and concludes fine-tuning on goal-anchored traces is unlikely to fix drift because the loss occurs between chunks in state the weights never see.
Run your AI side-project on zahid.host
EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.