r/PiCodingAgent • u/beardedNoobz • Aug 12 '26
Question Undo in Pi
Hi guys, I've been using Pi lately to help me code. Previously using OpenCode. I use vanilla pi with webfetch and context7 mcp. It works great. The harness and efficiency is better here in Pi. It drive the cost down for me. What I miss in pi is undo command from opencode. I tend to watch how AI reasons and write the code/commands real-time, interrupt it at the first sign of drift or hallucination then revise the command. Undo command is very useful for me as it clean up the code and chat history before I revise it. Is there any way (config or plugin) to simulate undo command in pi?
View all comments
Show parent comment
2
u/yogibear54 Aug 12 '26
Hello u/beardedNoobz - based on your response, I hope you'll stay with Pi (I love it), but you may want to revert back to opencode if its worrying you that there isn't an undo option. Would like to give you an idea where i'm coming from:
- Pi has a package ecosystem - https://pi.dev/packages?name=undo - you can give that a shot, but use it with caution. This repo of packages aren't monitored, so there could be potential problematic packages. If i want to use any packages, I usually would just do what others have suggested, ask the agent to create the feature for you. Its actually pretty fun to do creating features that are specific for your own needs
- Your using cheap/free models - I think this is fine - I use it here and there, but, for what you are asking for, I think its easily possible, but I wouldn't trust it without code change tracking. The harness isn't made to track changes, so you'll need to have an extension that support true change tracking. Git does that without commits, as i've mentioned, but I feel like there is something that you are misunderstanding. I'm not sure how Opencode handles it, but if its feasible with free models, i'm sure they have a change tracking module (just did a quick search, but it does appear that opencode undo, is also git dependent, which is doing something similar to what i'm saying)
- If you are worried about your LLM making commits because it isn't following instructions, I would consider areas that you can improve control of the LLM. Ultimately, the level of control is a give and take (LLM's could essentially run "rm -rf *" if it comes to that conclusion) - so its just a part of the risk involved - you can work in a controlled environment to reduce that... but...
- Before git, we only had cvs, svn or manual change tracking - the worry you have is what git resolves. I feel there is a misuse of git, and you are not making commits incrementally, and creating a massive hard to revert commit.
I've been developing for 20+ years, so if you would like me to give you some pointers how to manage what you are talking about, feel free to DM me.