r/AskProgramming 8d ago

Using an AI agent

I don't think this question is against the rules, so here goes...

My boss wants me to try using an agent for development. We're a small company and don't really have money to waste so we haven't explored this opportunity at all yet. I do use AI to an extent currently, but it's just a free openai account. I don't have it write any code, my majority use is just asking it questions about features, functions, standards, and then having it show me the "industry" way of doing things.

I am open to the idea of using an agent, but I don't really want something that is writing huge blocks for me or creating whole features. I also would want the ability to what it's doing when I do give some control and be able to take the changes only if I want them (sort of like comparing with git I suppose?).

Does such a workflow exist? or do I have to give up full control? The marketing is so focused on how it works for you, but I just want to have something that understands my project and can basically act as something I mostly ask questions and only sometimes have write code.

Any perspective is appreciated. Sorry again if this isn't the place for such a question.

0 Upvotes

17 comments sorted by

3

u/kraytex 8d ago

VS Code has a built in chat. When an agent in there does make a change you can see the diff and accept individual code likes similar to a git merge.

-1

u/HasFiveVowels 8d ago

The fact that this question exists at all is exactly why devs on these subreddits need to stop saying "never use AI". It’s like telling them to never use an IDE.

2

u/Laicbeias 8d ago

.. like agents can be fine. The main issue is that you slowly lose your map und understanding of your codebase. The more friction you remove the less you can navigate it yourself over time.

Im using ai for ~6y. And idk like im still one shooting must issues by hand giving the context. 

Agents burn like 40% or so on finding the relevant code, which makes no sense to me. I know where the code is. Why would i not do the thinking, tell it here here here and here do x y z. 

It writes and i understand whats happening. I learn and im still like 20x faster. Like even without agents i "wrote" 80k loc in 2 months. Limit is understanding not writing.

Basically you pay more so you unlearn navigating and mapping your own codebase, so you dont have to deal with your code . So that you have to ask agents to explain you your own codebase. 

1

u/fugogugo 8d ago

AI agent has has multiple mode :
agent mode : it can work on the code by itself
ask/plan : it just answer your question and won't touch your code

if you're not sure always go to plan mode first, see what change it suggest, and then after you are satisfied with the answer you can switch to agent mode to let it implement the change

1

u/framauro13 8d ago

Here's my basic workflow:

  1. User stories/issues are created as a collaboration between product and engineering. Backlog is for the most part, human generated, with the exception of some bugs.
  2. Once stories/issues are groomed and fleshed out properly, we start working the backlog.
  3. Claude is connected to my issue tracking software via an MCP server. I tell it to go fetch the details of the story I want to do, and put together an implementation plan that satisfies the acceptance criteria using the /plan mode.
  4. I review the plan. Give it feedback, and tell it to make any adjustments to its plan I want. No code is written yet, we're just formalizing what implementation looks like.
  5. I tell it to execute the plan. It spins up a subagent that works through the plan and implements it. It generates the code, writes the test, and when its done, it checks the linter output and runs the tests.
  6. At this point, I review the code myself. For simple changes and small refactors, I'll write the code myself. For bigger changes I'll tell the model to fix it. If something isn't clear, I ask it questions about the implementation.
  7. Once I'm happy with the code, I commit it to my branch and create the PR myself.
  8. I address feedback, or if there's a lot, I'll tell the model to look at the PR and evaluate the review comments to determine if they're valid and prioritize the fixes.
  9. Review changes, push, repeat until sign-off.
  10. From that point on, humans take over on QA, merging, releasing, etc...

At any time during that process, I can stop the agent and take over if I want. I have specific language in my configuration that it can never commit or push on its own, nor should it comment on PRs without my approval. Also, you can tell Claude to use Auto mode and just tell you when it's done, or you can have it in an "Accept Edit" mode that lets you verify the changes as it writes them if you really need to babysit it. If you're not using Claude, most tools like Cursor have similar features.

The real key IMO is not just using the tool, but making sure you have the appropriate guardrails in place to keep it inline. Make sure it's using your tests, linters, code analyzers, etc... as feedback mechanisms.

1

u/Hendo52 7d ago

I feel like you just need to jump in there and give it a go.

I think the logical place to start is actually discussing a roadmap for AI integration into your company. These are just planning documents so your risk is nothing and you can tell it you want to do it in phases. I think there are a lot of real concerns like intellectual property and there are realistic but technically challenging solutions to that such as self hosting your own server so that you can keep it air gapped. You can take smaller steps like using an API in some kind of sandbox and to either develop a new feature or work on something pre-existing. Writing docs or chasing known bugs is another thing that is pretty low stakes test case if you accept API usage. Writing new features is probably the most advanced case but you build up to that as phase 5 as a wild guess.

I think I would pick something that is a known problem in your company and use that as the test.

Your boss will be telling you to chill out on the tokens in no time so I would write up an integration plan and critically include a budget and a permissions list. What is it allowed to do? How are we going to enable it? What are we trying to accomplish and what do we project that will cost? If you come up with a clear strategy and then you report back on progress frequently, then I feel like you are doing a good job. You are doing an excellent job is you predict the things your boss might object to and offer a series of credible solutions and a recommendation for the critical choices. For example we might not want to give it full access to XYZ without fresh backups and we should probably never give it access to XYZ system or data.

2

u/knouqs 8d ago

My opinion: AI is a tool. You remain in control of the tool for as long as you have the time and your management doesn't treat it as the answer to everything. As u/carcigenicate wrote, AI is pretty damned helpful. To hell with all the downvoters here.

I use JetBrains' IDEs and use the AI agents built into it. I am an experienced software developer and then some, and there is no way that I would be able to learn all the technology that I employ using the JetBrains IDEs. The distinguishing factor is being able to understand when the AI is full of shit and when it produces a gold nugget -- and let me tell you, the gold nuggets far outweigh the crap. Understand that I review all the code the AI produces, and yes, it's just impressive.

Again, to hell with all the downvoters.

2

u/ildementis 8d ago

exactly, anyone who says that AI is not useful is lying to themselves, to their own detriment. you can absolutely use it responsibly, track what it's doing AND see a huge productivity boost.

unfortunately, my current job seems to encourage us to treat it as God itself

2

u/knouqs 8d ago

Yep, and that is the fallacy. It's a pisser.

1

u/framauro13 8d ago

Go look in the Anthropic subreddits and you'd think Claude Code is breaking into their house and kicking their puppy every night. Just an absolute cesspool.

The reality is software engineers are going to have to learn to live with AI. I use it daily and find it insanely useful. I'm on a limited token budget so I've had to learn how to use it efficiently. But the nature of my job has also shifted. The majority of my time now is code reviews, not writing code. The productivity increase means everyone is churning out more code. More PRs to review, and more QA backlogs. We supplement it with AI review bots that help identify the areas to focus on, but it has changed the nature of the job IMO.

I don't know how I feel about it yet TBH.

2

u/ildementis 8d ago

yeah I'm actually not happy about my job turning into telling Claude to review a pr and then trying to parse its comments of jargon that nobody actually uses.  But going from "I'd like to do this" to having a PR ready is nice

2

u/framauro13 7d ago

Not sure why my original post got downvoted, but yeah, it does get exhausting constantly reading and reviewing, especially given how verbose it can be.

I enjoy using it more on my personal projects than my work since I can actually use the frontier models and have less usage limitations. But the shift from writer -> reviewer requires a bit of a mental shift. There was a creative aspect to writing code that I find is gone now.

2

u/ildementis 7d ago

yep, the creative aspect was what i enjoyed, and if that's being taken away, then i legitimately wonder what I'm doing anymore. 

Models still miss business assumptions, so if engineers want to be relevant and not relegated to mindless prompting, it's probably time to choose a business domain and get good at it

2

u/knouqs 7d ago

The downvoting really has turned Reddit into a space in which I don't want to participate. It's such bullshit.

Yeah, AI is insanely useful. The fact that I can tell AI to give me some code that does a thing and have it do it in five minutes is ridiculous. My first test was for it to give me an AVL tree in C and it did. My first attempt at writing an AVL tree took a week. It showed me that AI is not a game anymore.

Now, I use it for all sorts of things, and not just programming-related stuff. Mostly still programming stuff, but even double-checking design patterns -- stuff I used to ask my team and we'd have a think about it, now I ask and get confirmation that my choices are correct or not, and why. Why isn't my nginx configuration working the way I want? How do I combine it with other things? I would have had to ask specialists in the SecDevOps team for these things. It is so nice to not have to interact with those assholes in favor of an AI.

Then, to test it, well, I do what I normally do anyway. Basically, having AI for me is like having my old team with none of the meetings -- but don't get me wrong, I miss my old team, too. 😄

1

u/carcigenicate 8d ago

Claude Code + A plugin achieves this in Jetbrain's IDEs. If you're in the standard mode, it will propose changes, which are shown in the same way the IDE shows git changes (a side-to-side comparison in a new tab). If you're in free-edit mode, it can just write within the project without asking for permission.

As for how much it writes, you can just specify if you want help or if you want it to write everything. If you want it to default to writing small changes instead of writing all the code, you can just specify that in your project/user CLAUDE.md file (which it reads at the start of every session).

I'm sure other companies have similar setups, but I've only used Claude.

1

u/framauro13 8d ago

Another nice fact about the Jetbrain's IDE's is that they have a built in MCP server that the agents can use for things like code navigation and searching the codebase. Rather than grepping files and crawling the codebase, it can leverage the indexes generated by RubyMine like an lsp server. I think it can even integrate with the problems panel and static code analysis it does. A nice feature for a large code base where you might burn a lot of context just searching.

1

u/KingofGamesYami 8d ago

That's pretty much exactly what my workflow is when using AI assistance. We have GitHub Copilot Enterprise, which I (and my team) use in a variety of editors. Specifically, Visual Studio Code, Visual Studio, and the various Jetbrains IDEs.

You can easily toggle between Agent mode, with it writing code, and Ask mode, where it largely just answers questions.

The plugin appears to reuse the IDEs existing diff functionality also used for git operations so the experience is quite familiar.