169 comments

[ 3.1 ms ] story [ 233 ms ] thread
I’ve used aider to understand new codebases using technologies I don’t know and it did a fantastic job; much faster than grep/find + google.
To be fair in a world of good LSP impls, grep/find are really primative tools to be using. Not saying this isn't better then a more sophisicated editor setup, just that grep and find are a _really_ low bar
When we reach that world, let me know. I'm still tripping over a "python-lsp-server was simply not implemented async so sometimes when you combine it with emacs lsp-mode it eats 100% CPU and locks your console" issue.
Wait, so this is why Emacs has been locking up on me in most of my Python projects??
Possibly. Definitely why it has been locking up on me when I added lsp-mode.

Lsp-mode will schedule one request per keypress but then cancel that request at the next keypress. But since the python LSP server doesn't do async, it handles cancel requests by ignoring them

If emacs hard blocks on LSP requests, that may be on emacs as well. I recomemd you try ruff-lsp, although it does not iver everything and is more for linting, it's higb quality
Aider can answer questions I can’t search for via LSP, like “what code would process the following URL” and similar.
Not sure if that's making things "fair". Grep & find are insanely powerful when you're a CLI power user.

Nonetheless, I'm particularly curious which cases the AI tool can find things that are not easy to find via find & grep (eg: finding URLs that are created via string concatenation, those that do not appear as a string literal in the source code)

Perhaps a larger question there, what's the overall false negative rate of a tool like this? Are there places where it is particularly good and/or particularly poor?

edits: brevity & clarity

I evaluate a lot of code, like ten-twenty applications per year currently, terminal tooling is my goto. Mostly the basic stuff, tree, ripgrep, find, wc, jq, things like that. I also use them on top of output from static analysis tooling.

It's not as slick as SQL on a RDBMS, but very close, and integrates well into e.g. vim, so I can directly pull in output from the tools and add notes when I'm building up my reports. Finding partial URL:s, suspicious strings like API keys, SQL query concatenation and the like is usually trivial.

For me to switch to another toolset there would have to be very strong guarantees that the output is correct, deterministic and the full set of results, since this is the core basis for correctness in my risk assessments and value estimations.

Personally I don't like the fragility/IDE-specificity of a lot of LSP setups.

I wish every language just came with a good ctags solution that worked with all IDEs. When this is set up properly I rarely need more power than a shortcut to look up tags.

[dead]
People interested in Aider (which is an awesome tool) might also be interested in checking out my project Plandex[1]. It's terminal-based like Aider and has a somewhat comparable set of features, but is more focused on using LLMs to work on larger and more complex tasks that span many files and model responses. It also uses a git-style CLI approach with independent commands for each action vs. Aider's interactive shell.

I studied Aider's code and prompts quite a bit in the early stages of building Plandex. I'm grateful to Paul for building it and making it open source.

1 - https://github.com/plandex-ai/plandex

Do you have any plans to build IDE plugins for this? I understand it's open source and anyone could add that, I was just wondering if that was even on the roadmap? Having this run in my IDE would just so awesome with diff tool I'm used to, with all the other plugins/hotkeys/etc I use.
Yes, VSCode and JetBrains plugins are on the roadmap. Here's the current roadmap by the way: https://github.com/plandex-ai/plandex#roadmap-%EF%B8%8F (it's not exhaustive, but can give you a sense of where I'd like to take Plandex in the future).
And I completely missed that somehow... My apologies. Thank you for pointing that out.
No worries, it's pretty far down in the readme :)
How do you situate changes in a file? That seems like the hard part to me since the LLM can't necessary count to output a patch with line numbers.
It does use line numbers, which definitely aren't infallible. That's why a `plandex changes` TUI is included to review changes before applying. Unfortunately no one has figured out a file update strategy yet that doesn't make occasional mistakes--probably we'll need either next-gen models or fine-tuning to get there.

That said, counting isn't necessarily required to use line numbers. If line numbers are included in the file when it's sent to the model, it becomes a text analysis task rather than a counting task. Here are the relevant prompts: https://github.com/plandex-ai/plandex/blob/main/app/server/m...

Doesn't the software just give the LLM the line numbers?
This looked cool and I was excited to try it until I realized that I either need a subscription, or I need to set up a server. Why does this need a server, when Aider just works via the cli?
First I should note that while cloud will have a subscription eventually, it's free for now. There's an anonymous trial (with no email required) for up to 10 plans or 10 model responses, and then just name and email is required to continue.

I did start out with just the CLI running locally, but it reached a point where I needed a database and thus a client-server model. Plandex is designed for working on many 'plans' at different levels of the project hierarchy (some users on cloud have 50+ after using it for a week), and there's also a fair amount of concurrency, so it got to be too much for a local filesystem or even something like a local SQLite db.

Plandex also has the ability to send tasks to the background, which I think will start to play a more and more important role as models get better and more capable of running autonomously for longer periods, and I want to add sharing and collaboration features in the future as well, so all-in-all I thought a client-server model was the best base to build from.

I understand where you're coming from though. That local-only simplicity is definitely a nice aspect of Aider.

I had a second look and the server doesn't look too hard to deploy. I like that there's reasoning behind requiring it, although I suspect that SQLite is more than capable to very easily do this.

I'm trying to deploy the server right now so I can try Plandex, it would be easier if I hadn't forgotten my Postgres password...

As a tip, self-hosting would be much easier (which may be something you don't want to do) if you provided a plain Docker image, then it would just be "pull the Docker image, specify the local directory, specify the DB URL, done".

By the way, why does it need a local directory if it has a database? What's stored in the directory?

Agreed on providing a docker image. I made an issue to track it here: https://github.com/plandex-ai/plandex/issues/78

I do want to make self-hosting as easy as possible. In my experience, there will still be enough folks who prefer cloud to make it work :)

There's a local .plandex directory in the project which just stores the project id, and a $HOME/.plandex-home directory that stores some local metadata on each project--so far just the current plan and current branch.

I see, thanks for the explanation! If you're only storing a bit of data, removing the requirement for a local directory would make deployment easier; these could just go into the database.
Oh sorry, my comment was referring to the local files created by the CLI. The server uses the file system much more heavily in order to enable efficient version control with an embedded git repo for each plan. Everything in a plan that's version-controlled (context, the conversation, model settings, and tentative file updates) is stored in this repo instead of the database.
Ah, that makes sense, thank you.
I _cannot_ wait for you to get local models working with this (I know, they need function calling/streaming first). It's amazing! I burned through $10 like it was nothing and bigger context+local is going to make this killer IMHO. It needs additional guidance and with more context maybe loading lint rules into the context would get back code matching my coding style/guide but even as-is there is a ton of value here.

It was able to rewrite (partially, some didn't get fully done) 10 files before I hit my budget limits from Vue 2 Class Component syntax to Vue 3 Composition API. It would have needed another iteration or so to iron out the issues (plus some manual clean up/checking from me) but that's within spitting distance of being worth it. For now I'll use ChatGPT/Claude (which I pay for) to do this work but I will keep a close eye on this project, it's super cool!

Thanks for trying it and your feedback. I'm keeping tabs on open source/local models and will include them as soon as it's feasible.

I hear you on the API costs. You should see my OpenAI bills from building Plandex :-/

If you're thinking it is expensive, wait until you start to play with Claude Opus. Sooner or later I will declare bankrupt

Nice product BTW. I really liked the UI, is very polished

> You should see my OpenAI bills from building Plandex :-/

Sorry if you have answered this before, but can you estimate how many man hours were saved using OpenAI or was the high usage more test related?

I have used Plandex a lot to help build Plandex faster, but yeah the high API costs are much more due to testing, where I need to run large tasks over and over in rapid succession in order to debug problems or iterate on the built-in prompts.
Can we get someone to automate stuff like copying files, renaming stuff, setting env variables, any common tasks done in an OS.
You could do this with Plandex (or Aider... or ChatGPT) by having it output a shell script then `chmod +x` it and run it. I experimented early on with doing script execution like this in Plandex, but decided to just focus on writing and updating files, as it seemed questionable whether execution could be made reliable enough to be worthwhile without significant model advances. That said, I'd like to revisit it eventually, and some more constrained tasks like copying and moving files around are likely doable without full-on shell script execution, though some scary failure cases are possible here if the model gets the paths wrong in a really bad way.

OpenInterpreter is another project you could check out that is more focused on code/script execution: https://github.com/OpenInterpreter/open-interpreter

I feel like what I am saying should be natively supported.

If youre worried about changes getting it wrong, just show a prompt with all the batched changes.

me > build my jar, move it to the last folder I copied it to, and run it. LLM > built jar xyz.jar moving jar to x/y/z me > yes. me > redo last command.

Provide rollback/log for these features if need be.

I really dont think you even need an LLM for this. I feel like I can do it with a simple classifier. It just needs to be hooked into to OS, so that it can scan what you were doing, and replicate it.

For example if I keep opening up folder x and dropping a file called build.jar to folder y, a program should be able to easily understand "copy the new jar over"

I imagine at point this is going to be done at the OS level

It's a great concept and I agree it will definitely exist at some point, but working a lot with GPT-4 has made me viscerally aware of how many different ways something like "build my jar, move it to the last folder I copied it to, and run it" can be spectacularly misinterpreted, and how much context is needed for that command to have any hope of being understood. The other big issue is that there is no rollback for a `rm` or `mv` command that screws up your system.

I had similar ideas when I started on Plandex. I wanted it to be able to install dependencies when needed, move files around, etc., but I quickly realized that there's just so much the model needs to know about the system and its state to even have a chance of getting it right. That's not to say it's impossible. It's just a really hard problem and I'd guess the first projects/products to nail it will either come from the OS vendors themselves, or else from people focusing very specifically on that challenge.

Youre right there is a lot of ambiguity there. I think being able to scan user actions helps a ton with this though, because you know exactly the steps the user took. Most of the times I want this is when I literally have to repeat the same set of actions 5+ times and writing a script to do it isnt worth it. I want to be able to just save/train the model and have it do what I want. Today I literally built a jar 50 times, with each time having to open up two folders and copying files between the two same directories. Massively annoying.

There is still some ambiguity there because cases might slightly differ, youre right.

For rm/mv. mv is easily reversible no? You just need to store some context. Same with rm, just copy it to a temp directory. But again with a confirmation prompt its a non issue either way.

Also maybe we need a slightly different kind of LLM, which instead of just assuming its top predictions are correct, gives you actions at critical steps on how to proceed.

build a jar. > I can build a jar with x,y,z, which do you want?

Can you describe how you read in a repo any better than aider?

Aider has a few blog posts speaking to it.

I haven't yet tried incorporating tree-sitter as Aider does to load in all definitions in the repo. In Plandex, the idea is more to load in just the files are relevant to what you're building before giving a prompt. You can also load directory layouts (with file names only) with `plandex load some-dir --tree`.

I like the idea of something like `plandex load some-dir --defs` to load definitions with tree-sitter. I don't think I'd load the whole repo's defs by default like Aider does (I believe?), because that could potentially use a lot of tokens in a large repo and include a lot of irrelevant definitions. One of Plandex's goals is to give the user granular control over what's in context.

But for now if you wanted to do something where definitions across the whole repo would be helpful (vs. loading in specific files or directories) then Aider is better at that.

But.. it was said Plandex is similar or worthy of consideration next to something like Aider.. when this post is about Aider.

Understanding a codebase, along with the in/outs between the calls is pretty vital to any codebase, especially the larger a codebase gets.

I'm not attached to the way Aider or Plandex does anything, but I'm still not clear on which scenarios it's worth considering compared to Aider, or vice Versa. Aider seems pretty unique and stands alone on a number of things. I'll still install Plandex and try it out.

Without details, it's a little surprising a post like this could get upvoted so much.

Plandex isn't really focused on understanding a whole codebase. It can be used for that to some extent, but it's more designed for building larger features where you'd load in maybe 5-20 relevant files and then have Plandex build the whole feature across potentially dozens of steps and model calls. With Aider (or ChatGPT) it would require a lot more back-and-forth and user interaction to get a similar result.

Like I said, I think Aider's use of tree-sitter is a great concept and something I'd like to incorporate in some way. I'm not at all trying to claim that Plandex is 'better' than Aider for every use case. I think they are suited to different kinds of tasks.

I apologize if I'm not posting this in the correct place, but I've been trying to test this out (looks like it'll be fantastic, btw) and I keep running into a 429 error that I've exceeded my current quota for chatgpt but I really don't think I have, which leads me to believe that maybe it's not really taking my api key when I run the export command. Is there a way to check or another reason I could be getting this error?
You'd be getting a different error if your key wasn't getting through at all. Can you double check that you're using the right OpenAI api key, have enough api credits (as distinct from chatgpt quota), and haven't hit any max spend limits? You can check here: https://platform.openai.com/account/api-keys
Any chance for multi agents and/or a vs-code extension(for diffing / applying changes)? nmv on the vscode extension, I just found your other comment.
Could you explain what you mean by "multi agents"?
(comment deleted)
I revisited Aider a couple of days ago, after going in circles with AutoGPT - which seemed to either forget or go lazy after a few prompts - to the point it refused to do something that it did a few prompts before. Then Aider delivered from the first prompt.

PS. I've gathered a list of LLM agents (for coding and general purpose) https://docs.google.com/spreadsheets/d/1M3cQmuwhpJ4X0jOw5XWT...

I'm interested in this and will probably set it up but I wish more AI tools were better integrated to my IDE. I know GH Copilot is and other big AI tools have plugins with chat/edit features but most of the cool open source doesn't seem to support IDEA/JetBrains.

I see the power of LLMs. I use GH Copilot, I use ChatGPT, but I crave deeper integration in my existing toolset. I need to force myself to try in-IDE Copilot Chat. My habit is to go to ChatGPT for anything of that nature and I'm not sure why that is. Sometimes it's the same way I break down my search to for things "I know I can find" then put together the results. In the same way I break down the problem into small pieces and have ChatGPT write them individually or somethings additively.

I didn't get time to test it beyond installing it on VSCode today, but take a look at https://GitHub.com/continuedev/continue, Apache 2.0 license, and they have an IDEA/Jetbrains plugin. Plus codebase context, full configurability to use local or remote LLMs.
I probably need to give it another try but I tried that before with my own GPT-4 key, a local model, and their models and just got errors last time I tried it. I hope that was just a temp issue but because of that I moved on. Also I've tried Cody Pro (again, weird errors and when it did work I felt like Copilot would have done better).
Aider works a little different where it doesn't just code complete or focus on a function level. It can solve much bigger problems.
I've been using https://cursor.sh/ heavily for about 2 months and I'm pretty happy.

Cursor is a fork of VSCode focused on AI. I'd prefer to use something totally open-source, but Cursor is free, gets regular updates, and I can use my OpenAI API key.

The diff view works well with AI coding assistants. I end up parallelizing more. I let cursor do its thing while I'm already looking at the next file.

I love aider too! Have used it to automate things such as maintaining a translated version of the page in a git pre-commit hook.

What would be since is a single plugin that focuses only on UX and allows plug an play for AI models. I think we would benefit immensely from such a concept.
In my experience, Supermaven makes Copilot look like a joke, and they’ve just released a Jetbrains plugin. YMMV. It’s just code suggestions though, no chat box.
Have you compared it to Sourcegraph Cody which also has a Jetbrains plugin? Same monthly cost as Supermaven.
I’ve tried Cody Pro. I canceled my subscription in 3 days. The plugin (for JetBrains at least) gave auth and other errors regularly and when it did work its completions were “meh” at best.

I’ll admit some of that might be from me being used to what I get from GH Copilot but basic stuff like initializing a variable called “count” with `0` or “++”-ing it in a loop were both things it didn’t auto-complete. I switched back to Copilot and it did exactly what I expected.

The polish is lacking with Cody and the errors are completely unacceptable in a paid product. I’ve seen 2 Copilot outages the entire time I’ve been using it (since before GA) so to have Cody barf up stupid errors multiple times in a 3-day period is just ridiculous.

I’ll be trying this today, thank you for the suggestion. 300K context window is awesome.

I actually like completions more, it feels more natural. I’m fine to go to ChatGPT/Opus to chat if needed.

Aider has a big problem when working with python codebase.

1. Its dependencies will conflict with your code requirements.

2. If you don't install it within the code environment, you can use `aider run` where you can run local commands and pipe their outputs.

3. You will need to use all it's dependencies even in prod environment that can increase the attack surface.

So until they introduce a global binary install, I suggest using Plandex which is based on Go and can work across any environment within the system

Thanks for trying aider, and sorry to hear you had dependency conflicts.

You can install aider with pipx to avoid this. There's a FAQ entry that explains how:

https://aider.chat/docs/faq.html#how-to-use-pipx-to-avoid-py...

Also, why would you want to install aider in a production environment? It's a development tool, I wouldn't expect anyone to use it in prod. But maybe there's a use case I'm not thinking of?

Thank you, didn't know about pipx possibility. Will give it a shot.

I don't want aider in prod environment. Im saying its hard to remove it from prod if we can't isolate it from code dependencies as its hard to maintain multiple requirements.txt for different envs.

This is the correct solution, use pipx to install any Python cli and save yourself a ton of hassle.
When working alone remotely from home, I simulate pair programming with a methodology I call "The Stranger". I sit on one of my hands until it becomes numb and tingly, and then it feels like somebody else is typing and moving the mouse!
I use synthetic aperture pair programming. I write some code and get it working. Then I get pulled off it for a few months and come back to it.

Me + 3 months: da fuk.

I have used this technique for months and it’s great https://x.com/arjie/status/1575201117595926530

I just have copilot in my editor and switch into my editor with C-x C-e for AI completion. I use neovim like example but you can use whatever you like.

EDIT: Oh never mind. I see what it is now. It’s a terminal based flow for editing code. Mine is for command line writing live.

That’s cool, but is there a way to use another vendor instead of GitHub CoPilot?
There’s the fauxpilot project. This is just the minimal stuff to use the AI completer. But you can sub out faux pilot and get the same result (modulo quality).
I just tried it and it's amazingly cool, but the quality of the output just isn't there for me yet. It makes too much subtle errors to be as useful as the screenshots and the gifs makes it look
I agree with you. It's okay at really simple code changes for really simple repos, but it falls apart for anything outside the ordinary.

I'm sure I'll have to eat these words, but: This just doesn't feel like the right interface to me. LLMs are incredible at generating "inroads" to a problem, but terrible at execution. Worse yet at anticipating future problems.

All this might very well change. But until it does, I just want my LLMs to help me brainstorm and help me with syntax. I think there's a sweet spot somewhere between this tool and Copilot, but I'm not sure where.

Hi, for somewhere between GitHub Copilot and aider, you can try the desktop app 16x Prompt. I have been using it daily for the past few months and it suits my working style nicely.

It is capable of handling complex tasks like feature development and refactoring across multiple files, but it doesn't try to generate diff and apply them automatically.

Instead, you will get a response from LLM that is easy to read and allow you as a developer to quickly apply to your existing codebase.

You can check it out here: https://prompt.16x.engineer/

I appreciate @anotherpaulg's continual benchmarking of LLM performance with aider, for example:

> OpenAI just released GPT-4 Turbo with Vision and it performs worse on aider’s benchmark suites than all the previous GPT-4 models. In particular, it seems much more prone to “lazy coding” than the GPT-4 Turbo preview models.

https://aider.chat/2024/04/09/gpt-4-turbo.html

If you prefer GUI with more space to write task requirements, or use your existing ChatGPT/Claude subscription without additional API costs, you can check out my desktop app: https://prompt.16x.engineer/
Everyone has one, I just made a script to print all the files in the current folder to the terminal. I have .context-ignore files to exclude some patterns, similar to .gitignore The first file is a README.md that contains my initial description of what I am working on. At the end I type a new command. I copy & paste the text into chatGPT web interface.

I think I used it for 10-15 rounds of iteration on my latest project and it generated about 50% of the code of a web app with Python backend. Pretty sweet and costs nothing on top of the web subscription. The funny part is that I was using this AI coding tool to build another AI tool to manage a collection of prompts and demonstrations including automatic prompt evaluation, so I was using an AI tool to make another AI tool.

That's exactly how I started as well, I was using a similar workflow to build an AI-driven game.

Then I thought maybe it's a good idea to turn it into something less ad-hoc, more user-friendly, and work for any project.

If you're interested in this sort of stuff, you might like this diff-based CLI tool I wrote:

https://github.com/freuk/iter

It runs on Groq (the company I work for), so it's super snappy.

Aider is the only tool I use for coding now with ChatGPT.

Copilot is pretty good but I like the split context of declaring what you are working on in the CLI.

It still suffers from ChatGPT laziness sometimes, you can see it retrying several times to get a correct output before giving up.

> GPT can write and edit code in most popular languages: python, javascript, typescript, html, css, etc.

I love how everyone always leaves PHP off these lists of "popular languages" despite the fact that 80% of the web runs on PHP.

PHP has had enormous staying power despite its idiosyncrasies.

I would however be curious to know what percentage of the 80% (or so) is WordPress et al. Since those largely don't involve folks actually writing code. I suspect a very small amount of PHP code is being run a lot.

PHP is still my go to for anything web-page based that's not a single page app. It's just a really nice solution for protoyping and making web quickly. I mean, custom stuff, not wordpress.

A lot of my successful projects have been rewritten later in nodejs. But for getting something up and running to test a concept, PHP is great if you're comfortable with its idiosyncracies.

I'd say Python is just as idiosyncratic, and its packaging system is just too much of a pain point. And Node doesn't ship with mature database interfaces, its dependencies are scary, there's more concern about runaway scripts, crashes are harder to recover from, and a lot of times all you really want from a router is to serve your file structure with some access rules.

I think PHP is still the best choice for prototyping dynamic HTML and logic fast, without any packages or plug-ins. A lotta times I still even use it for short CLI scripts and cron tasks that do database ops.

+1

I had a largish website with few thousand static webpages. Over a period the pages grew into around 100K with some server side features. Over the course of 10 years I did and redid this site in multiple technologies. React, Angular, Spring Boot + Freemarker etc.

However the PHP power version of it remains best for SEO has near zero downtime and no maintenance what so ever runs on a VM that shares like 10 other websites. traffic serves is around 100K visits a day.

Languages that can create beginners in programming who can ship early and often are invaluable.

I don’t use very much php, but would be remiss if I left my opinion of it as dated as whisper campaign rumors based on interpretation and preference.

Packages like Laravel and especially technologies like Hotwire are nothing to overlook.

Standardized and capable frameworks that have large workforces can be quite valuable at time of valuation and due diligence. Specialized and brittle techs can be a challenge.

I’ve updated the list to include php. Sorry for the oversight!
(comment deleted)
Python projects depress me because of the dependency management problem.
No problem, just install it in a virtualized containerized pyenv virtualenv pipx poetry conda dies
Exactly.

How do Python people put up with that? Have none of them tried to run multiple Python projects over time on the same Linux install with commandline access to all of them at once?

I’m still waiting for that bastard Devin to write my killer app. Now you want me to code my own killer app with an AI micromanage me?
exactly. who's training who here? :)