Stop copying code chunks. Start letting AI agents work directly with your files.
TL;DR: Use terminal-based AI tools to give your assistant direct access to your local files and test suites.
Common Mistake â
You copy code snippets into a web browser chat like ChatGPT, Claude, or Grok.
You manually move code back and forth and give small chunks of code, filling up the context window.
You lose the context of your folder structure, relations among modules, and the whole architecture.
The AI often (wrongly) guesses your project layout and hallucinates.
When you do this, you get inconsistent code and outdated logic.
Problems Addressed đ
Context Tax: Manual copying wastes your focus.
Hallucinations: The AI suggests libraries you don't actually have.
Isolated logic: The assistant doesn't know if your code even builds.
Manual effort: You have to run every test and fix every error yourself.
You're basically playing assistant to the AI, running around doing the busywork.
How to Do It đ ī¸
Download a CLI or IDE tool like Claude Code, OpenCode, Windsurf, or similar, and let it access ALL your codebase.
(You'll need to check compliance, set up safeguards, and respect any NDAs).
Open your terminal and start an interactive session. Let the agent navigate through all your code.
Describe what you want to accomplish at a high level and delegate to the orchestrator agent.
Review the proposed plan in the terminal.
Approve the changes to update your local files.
Let the agent run your tests and fix failures automatically.
Benefits đ¯
Full project context through local AST and RAG indexing.
Self-healing code through automated shell feedback loops.
Multi-file edits in a single prompt.
Parallel development using multiple agent instances.
Iterative incremental learning and experimentation. Baby steps.
Context đ§
We were all blown away when ChatGPT came out.
I wrote an article 2 days after its release, understanding it was a game-changer.
Even people like me who had been working with earlier GPT models.
Four years later, you still see many developers coding this way.
It works for small algorithms and functions, but falls apart for real software engineering.
Prompt Reference đ
Bad Prompt
// Please fix the login bug in this snippet:
async function loginUser(email, password) {
const url = 'https://api.penrosebrain.com/login';
try {
const response = await fetch(url, {
method: 'PUT',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({ email, password }),
});
} catch (error) {
console.error('There was an error:', error.message);
alert(error.message);
}
}
Good Prompt
// opencode: "Create a failing text, fix the login bug, run tests,
// Ensure it passes the new test and all the previous ones
// Create a Pull Request so I can review it
async function loginUser(email, password) {
const url = 'https://api.penrosebrain.com/login';
try {
const response = await fetch(url, {
method: 'PUT',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({ email, password }),
});
} catch (error) {
console.error('There was an error:', error.message);
alert(error.message);
}
}
Considerations â ī¸
CLI agents have a learning curve.
Always review all changes before committing them.
Use a sandbox environment if you run untrusted code.
Type đ
[X] Semi-Automatic
Limitations â ī¸
Don't use this for tiny, one-off scripts.
Web chats work better for creative brainstorming or generating images.
High token usage in long sessions can drive up your API costs.
Tags đˇī¸
- Complexity
Level đ
[X] Intermediate
Related Tips đ
AI Coding Tip 003 - Force Read-Only Planning
Maxi Contieri ãģ Jan 20
AI Coding Tip 006 - Review Every Line Before Commit
Maxi Contieri ãģ Feb 13
Connect external data using the Model Context Protocol (MCP).
Run local models if you need 100% privacy.
Conclusion đ
Move your AI assistant to the terminal.
You'll work faster and make fewer mistakes.
When you delegate the boring parts, you can focus on architecture and high-level design.
More Information âšī¸
Why CLIs Are Better for AI Coding Agents Than IDEs
How Cursor Actually Indexes Your Codebase
Aider - AI Pair Programming in your Terminal
OpenCode vs Claude Code: Comparing AI Coding Agents
AI Coding Assistants for Large Codebases
Boosting My Developer Productivity with AI in 2025
Introducing Advanced Tool Use on the Claude Developer Platform
What is OpenCode? - AI Quick Reference
Also Known As đ
Agentic Coding
Terminal Agents
Autonomous Coding Loops
Tools đ§°
Claude Code, OpenCode, Aider, Codex CLI.
Disclaimer đĸ
The views expressed here are my own.
I am a human who writes as best as possible for other humans.
I use AI proofreading tools to improve some texts.
I welcome constructive criticism and dialogue.
I shape these insights through 30 years in the software industry, 25 years of teaching, and writing over 500 articles and a book.
This article is part of the AI Coding Tip series.
Top comments (0)