top of page
Search

Creating Python Agents with Intent: From Claude Code to Local Executio

  • Writer: Mark Kendall
    Mark Kendall
  • 23 hours ago
  • 3 min read


Creating Python Agents with Intent: From Claude Code to Local Execution




Intro



There’s a lot of noise right now around AI agents, autonomous systems, and “just let the AI build it.”

In practice, most teams get stuck in confusion because they blur the line between generation and execution.


This article cuts through that.


If you want to build reliable Python-based agents — not demos, not hype — but systems you can actually run, evolve, and trust, you need a clean workflow.


This is the standard.





What Is an “Intent-Driven Python Agent”?



An intent-driven Python agent is not just code generated by AI.


It’s a system that follows a clear separation:


  • Intent (what should be built)

  • Generation (AI creates the code)

  • Execution (you run it locally like any real system)



The mistake most people make is trying to collapse all three into a single tool.


That leads to fragile, unmaintainable setups.


Instead, think of it like this:


Claude Code is your builder.

Python is your runtime.


That separation changes everything.





The Standard Workflow (No Confusion, No Chaos)



This is the repeatable pattern you should follow every time.



Step 1 — Generate the Agent (Claude Code)



You start with an intent.md file that defines:


  • What the agent does

  • The structure

  • The constraints

  • The expected outputs



You then ask Claude Code:


“Build this project from intent.md


Claude generates:


  • File structure

  • Python modules

  • Requirements

  • Basic wiring



At this point, the agent is created, but not yet running.





Step 2 — Move to Execution Mode (Local Python)



Now you leave Claude.


You open the generated project in Visual Studio Code as a normal Python project.


This is where many people get confused — but it’s actually simple:


You are now just running Python.


No magic. No AI loop. Just a program.





Step 3 — Create an Isolated Environment



Every agent should run in its own environment.


From the terminal:

python -m venv venv

Activate it:


Mac/Linux:

source venv/bin/activate

Windows:

venv\Scripts\activate

This ensures:


  • No dependency conflicts

  • Clean reproducibility

  • Isolation between agents






Step 4 — Install Dependencies



Once the environment is active:

pip install -r requirements.txt

This installs everything the agent needs.


You do not manually install libraries one by one.


The project defines its own runtime.





Step 5 — Configure the LLM (API Key)



Create a .env file in the root of the project:

OPENAI_API_KEY=your_key_here

The code will load this at runtime.


This is how your agent connects to an LLM.





Step 6 — Run the Agent



From the terminal:

python main.py

That’s it.


If the intent and generation were correct, the agent will:


  • Execute its pipeline

  • Call the LLM

  • Produce output (e.g., a markdown article)






Why This Matters



This approach may seem simple, but it solves a major problem in the current AI landscape.


Most developers are trying to:


  • Run agents inside AI tools

  • Mix prompts with execution

  • Skip environment management



That leads to systems that:


  • Break easily

  • Can’t be reproduced

  • Can’t scale



By separating generation from execution, you get:


  • Stability

  • Control

  • Repeatability



And most importantly:


You can build multiple agents without chaos.





The Real Shift: From Coding to Operating Systems



When you follow this pattern consistently, something changes.


You stop thinking:


“How do I write this code?”


And start thinking:


“What system do I want to generate and run?”


That’s the shift toward Intent-Driven Engineering.


You are no longer just a developer.


You are operating a system that:


  • Generates capability

  • Executes independently

  • Evolves over time






Key Takeaways



  • Always separate generation (Claude) from execution (Python)

  • Use intent.md to define systems, not just prompts

  • Run every agent in its own virtual environment

  • Let requirements.txt define dependencies — don’t guess

  • Use .env for API keys and configuration

  • Treat every agent as a real application, not a demo






Final Thought



The future of engineering is not about writing more code faster.


It’s about building systems that can generate, run, and evolve with minimal friction.


This workflow is the foundation.


Start simple. Run it locally. Repeat it.


That’s how real capability is built.

---



 
 
 

Recent Posts

See All

Comments

Rated 0 out of 5 stars.
No ratings yet

Add a rating
Post: Blog2_Post

Subscribe Form

Thanks for submitting!

©2020 by LearnTeachMaster DevOps. Proudly created with Wix.com

bottom of page