Urgent.News

What's breaking now, across thousands of outlets.

AI

My agent.md to improve LLM-assisted code quality

In mid-2025, the reporter first attempted to utilize an LLM for coding, but was not satisfied with the results. The code produced did not even compile when working on libadbmdns, a Rust implementation of mDNS. In January 2026, the reporter revisited LLMs with better success. The model not only wrote a complex indexed-binary heap class but also identified an obscure bug in the polling crate due to the Windows IOCP implementation.

However, the code quality was poor, with no comments or structure, making it challenging to use LLMs for production-level work.

In March 2026, the reporter tried agentic IDEs like Antigravity and VS Code's Claude Code plugin. This allowed for iterative coding, and the reporter found themselves reviewing the code with suggestions such as avoiding magic numbers, adding comments, and using short function names. The code quality improved significantly, but the process was tedious, as the reporter had to repeat suggestions in each new session.

To fine-tune coding style preferences, the reporter placed a file named agent.md in the root of a project. This allowed the coding harness to load the file and inject it into the prompt. The reporter shared their version of agent.md as a starting point. Although this trick improved the generated code, LLMs still hallucinate and cannot be fully trusted, requiring constant verification and iteration.

The reporter still focuses on architecture and design rather than code style. The phenomenon of context dilution or attention dilution, where LLMs pay less attention to instructions in the middle of the context, can be minimized by asking the agent to update agent.md instead of opening an editor each time a new rule is added.

Written by urgent.news from Hacker News's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at fabiensanglard.net →

More in AI

I Built an AI That Fixes Terraform Drift Automatically

I Built an AI That Fixes Terraform Drift Automatically If you've worked with Terraform long enough, you know the feeling. You run terraform plan and suddenly there are 12 unexpected changes.

  • tfdrift remediate AI tool fixes Terraform drift automatically
  • Detects drift across all Terraform workspaces and classifies severity
  • Uses Claude or GPT-4o to generate remediation file for human review

Cooper Sharp Proves That American Cheese Can Be Great Cheese

John Moltz, in his weekly members-only column for Six Colors (no gift links, but Moltz’s column is worth the subscription in and of itself): This week Anthropic announced that in order to identify AI…

  • Anthropic plans to watermark AI-generated text
  • Tech commentator John Gruber criticizes strategy
  • Concerns about model training and AI inbreeding

More from Sunday 23 August →