Working_with_opencode

First things first: I am not an one of those people who either gets all excited over AI, nor am I worrying about them “taking over the world”.

My limited experience is that AI is often quite stupid.. they are either hampered in their reasoning by political reasons.. or just not able to draw conclusions. Often they act stubborn and will spend ten minutes telling you that you can’t use ‘it’ inside a Ruby block.. or that Beatles wrote the music on the record that Holden bought his sister in ‘Catcher in the Rye’.

Then they flatter you: “What a great idea! That’s a clever approach!”

I would stay away from conversations with AI.

I can’t tell you anything about opencode. Installed it three days ago and haven’t looked up a thing about it. I can tell you a bit on how you should work with it:

Opencode has two modes: Plan and Build. You should be careful about the Build-mode. Switch modes with the Tab-key.

First thing you need to do is: have an idea of what you need to accomplish. Create a folder. Move the files needed in there. Start opendata and issue the /init command.

After some time you might even have created an AGENTS.md file before you start opendata. There you can sketch out your idea.

Opendata will read the content and the AGENTS.md file and start talking to you. Make sure you are in the Plan-mode. Now you can reason about your idea and different approaches.

It’s a good idea to break up a project into smaller pieces.

One thing I found necessary was to include some AI-behaviour-rules in the AGENTS.md

Like: Do not start doing things without a command! Do not alter this or that file or any file in this or that folder. Make back-ups because you new AI-friend will forget what you told it and start messing with things. It will excuse itself profusely afterwords.. but that’s no consolation. Also: make sure AI talks to you.. push on the importance of being verbose. Be very clear in your commands.. do not joke; no ambiguity.

I actually had opencode alter its behavior and stop searching files for text that wasn’t there. It now investigates why the text is not there. Great progress!

OpenCode will not operate outside of the folder you started it in. This is not quite true.. I had it look through processes and kill processes.

Well.. I guess that’s it. Make back-ups. Don’t let AI work with important files.

Quite often you can just stay in Plan-mode and just investigate. Then you do the changes yourself. I might have forgotten to tell you: In Plan-mode opencode is unable to alter files or issue commands. It’s in Build-mode it can be quite dangerous if you let it.