Ask AI to record in a projects directory memory: LOG.md, HANDOFF.md, DECISIONS.md, a plan folder. Reference code with absolute paths. Keep repeatable processes in skills. Version control it all, and use a dreaming process across multiple sessions to stop repeat mistakes.
That's what's worked for me, but there's many variations of this.
For big tasks/features, I'm always creating a new git worktree and I'm using a "status repo" skill that creates a sibling status git repository where everything is recorded.
It works quite well whenever I have to revisit something. It's quite token hungry but I have the full trace of what happened in the past.
https://gist.github.com/vkalintiris/3ad526e71a75bcba013aaadc....
Another approach I want to explore is using https://github.com/netdata/netdata (disclaimer, I work at Netdata) to send all OTel logs/traces of LLMs to it. The idea is to replace the status repo skill with something that will allow LLMs to retrieve the history of a given task/feature. It will probably require some "checkpointing" to make this more efficient.
> Try to keep context shoved in a conversation thread under a token limit to save tokens.
That is another solid tip. If using subagents, use the main thread for only the conversation + launching subagents. Tell it explicitly not to implement anything, and only support integration efforts.
Doing so keeps the worker subagent's context clean - so it can stay laser focused on the task.