<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: DanXiao</title>
    <description>The latest articles on DEV Community by DanXiao (@_8d31359a797ee088ecde8).</description>
    <link>https://dev.to/_8d31359a797ee088ecde8</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3480699%2Fe6267b28-a6f4-4e32-8078-153a113c7553.png</url>
      <title>DEV Community: DanXiao</title>
      <link>https://dev.to/_8d31359a797ee088ecde8</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/_8d31359a797ee088ecde8"/>
    <language>en</language>
    <item>
      <title>Understanding Intelligent Agents Starting with Claude Agent SDK</title>
      <dc:creator>DanXiao</dc:creator>
      <pubDate>Sun, 25 Jan 2026 04:49:41 +0000</pubDate>
      <link>https://dev.to/_8d31359a797ee088ecde8/understanding-intelligent-agents-starting-with-claude-agent-sdk-2omb</link>
      <guid>https://dev.to/_8d31359a797ee088ecde8/understanding-intelligent-agents-starting-with-claude-agent-sdk-2omb</guid>
      <description>&lt;h2&gt;
  
  
  What is the Claude Agent SDK?
&lt;/h2&gt;

&lt;p&gt;In simple terms, it is a development framework/library that allows developers to use Claude as an "intelligent brain" to build automated agents, which have the ability to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Read files, execute commands, search the web, and more&lt;/li&gt;
&lt;li&gt;Automatically manage conversation context, avoiding context misalignment&lt;/li&gt;
&lt;li&gt;Run complex workflows rather than single Q&amp;amp;A&lt;/li&gt;
&lt;li&gt;Support Python and TypeScript/Node.js development environments&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Agent Runtime (Agent Loop)
&lt;/h3&gt;

&lt;p&gt;The SDK includes a complete agent loop, which consists of:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Decision: Understand the task&lt;/li&gt;
&lt;li&gt;Planning: Choose the right tools and steps&lt;/li&gt;
&lt;li&gt;Execution: Invoke tools (such as files, commands, web, etc.)&lt;/li&gt;
&lt;li&gt;Verification: Check execution results and proceed to the next step&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This means you don't have to write coordination logic yourself; just use query() to let the SDK decompose, execute, and provide feedback on the task.&lt;/p&gt;

&lt;p&gt;📌 Compared to traditional LLM APIs, the Agent SDK is not just a single prompt → response; it is a system that runs continuously, maintains state, and can perform actions.&lt;/p&gt;

&lt;h3&gt;
  
  
  What functions and tools are supported?
&lt;/h3&gt;

&lt;p&gt;The SDK provides a lot of built-in functions, including but not limited to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;File operations (reading, editing, creating files)&lt;/li&gt;
&lt;li&gt;Command execution (running shell or scripts)&lt;/li&gt;
&lt;li&gt;Code editing and generation&lt;/li&gt;
&lt;li&gt;Web search, API calls, etc. (integrated via MCP standards)&lt;/li&gt;
&lt;li&gt;Managing permissions and tool access control mechanisms (to prevent dangerous operations)&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  What underlying models are supported?
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;The SDK internally drives agent logic and tool execution through the Claude Code runtime.&lt;/li&gt;
&lt;li&gt;You need to set the ANTHROPIC_API_KEY and connect to Anthropic's API for authentication.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So based on the official design, it essentially supports the Claude series of models (like Claude Agent / Claude Code) and is built around this ecosystem.&lt;/p&gt;

&lt;h4&gt;
  
  
  But can access other platforms via third-party API providers
&lt;/h4&gt;

&lt;p&gt;The documentation clearly states that you can configure some environment variables to let the SDK use:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Amazon Bedrock&lt;/li&gt;
&lt;li&gt;Google Vertex AI&lt;/li&gt;
&lt;li&gt;Microsoft Foundry&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;As underlying model providers (though you still need credentials and settings for these platforms).&lt;/p&gt;

&lt;h2&gt;
  
  
  Comparison with Codex CLI
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Comparison Point&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Claude Agent SDK&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;codex-cli&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Nature&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Development framework (SDK)&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Command-line tool (CLI)&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Target Users&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;People building &lt;strong&gt;systems/products/agent platforms&lt;/strong&gt;
&lt;/td&gt;
&lt;td&gt;Developers for &lt;strong&gt;daily coding tasks&lt;/strong&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Usage&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Integrated into your project via &lt;strong&gt;code&lt;/strong&gt;
&lt;/td&gt;
&lt;td&gt;Used directly in the &lt;strong&gt;terminal&lt;/strong&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Can it run long-term?&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;✅ Yes (persistent agent)&lt;/td&gt;
&lt;td&gt;❌ No (one command, one result)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Automatic multi-step execution&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;✅ Can split tasks and execute steps automatically&lt;/td&gt;
&lt;td&gt;❌ You have to issue each step manually&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;“Think-Execute Loop”&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;✅ Built-in Agent Loop&lt;/td&gt;
&lt;td&gt;❌ Not available&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Can run as a background service&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;✅ Yes&lt;/td&gt;
&lt;td&gt;❌ Not suitable&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;File / Code manipulation&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;✅ Yes (controllable and programmable)&lt;/td&gt;
&lt;td&gt;✅ Yes (mostly local development)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Execute shell commands&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;✅ Yes&lt;/td&gt;
&lt;td&gt;✅ Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Extensible tools&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;✅ Very strong (MCP / custom tools)&lt;/td&gt;
&lt;td&gt;⚠️ Limited&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Multi-agent collaboration&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;✅ Supported&lt;/td&gt;
&lt;td&gt;❌ Not supported&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Production-ready&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;✅ Designed for product use&lt;/td&gt;
&lt;td&gt;❌ Not designed for production&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Learning curve&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Medium&lt;/td&gt;
&lt;td&gt;Low&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Abstraction level&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;High&lt;/strong&gt; (like building a robot)&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;Low&lt;/strong&gt; (like using a tool)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;My own understanding:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;codex-cli is "an AI tool"&lt;/li&gt;
&lt;li&gt;Claude Agent SDK is "a tool for developers to create AI agents"&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Process of developing an agent with Claude agent
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1️⃣ Clarify requirements
&lt;/h3&gt;

&lt;p&gt;Determine what kind of agent you want to develop, what its role is, what tasks it will be responsible for, and what outputs count as success, avoiding vague goals from the start.&lt;/p&gt;

&lt;h3&gt;
  
  
  2️⃣ Define roles
&lt;/h3&gt;

&lt;p&gt;Write a long-term effective system prompt for the agent, clarifying its identity, responsibilities, working style, and basic rules, rather than a one-time Q&amp;amp;A prompt.&lt;/p&gt;

&lt;h3&gt;
  
  
  3️⃣ Configure tools
&lt;/h3&gt;

&lt;p&gt;Decide which tools the agent can use, such as reading and writing files, executing commands, or accessing APIs, only granting necessary permissions to avoid uncontrolled behavior.&lt;/p&gt;

&lt;h3&gt;
  
  
  4️⃣ Launch the agent
&lt;/h3&gt;

&lt;p&gt;Pass the goals and configurations through the Claude Agent SDK, start the agent loop, allowing the agent to decompose tasks and execute them step by step.&lt;/p&gt;

&lt;h3&gt;
  
  
  5️⃣ Observe behavior
&lt;/h3&gt;

&lt;p&gt;Check the agent's execution process and the sequence of tool calls to determine whether it is working as expected and if there are any repetitions, deviations from goals, or failures.&lt;/p&gt;

&lt;h3&gt;
  
  
  6️⃣ Iterate and optimize
&lt;/h3&gt;

&lt;p&gt;Continuously adjust the role descriptions, tool permissions, and output formats based on the running results to make the agent more stable and efficient.&lt;/p&gt;

&lt;h3&gt;
  
  
  7️⃣ System integration
&lt;/h3&gt;

&lt;p&gt;Integrate the mature agent into scheduled tasks, APIs, or multi-agent processes, making it part of the system rather than a one-off script.&lt;/p&gt;

&lt;h2&gt;
  
  
  Comparison with Langchain
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;strong&gt;Comparison Point&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;Claude Agent SDK&lt;/th&gt;
&lt;th&gt;LangChain&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Core Positioning&lt;/td&gt;
&lt;td&gt;Executable agent, automatically splits tasks and calls tools&lt;/td&gt;
&lt;td&gt;Agent framework, combines LLM + tools + workflow&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Model Binding&lt;/td&gt;
&lt;td&gt;Deeply integrated with Claude&lt;/td&gt;
&lt;td&gt;Model-agnostic, can use OpenAI / Anthropic / others&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Execution Method&lt;/td&gt;
&lt;td&gt;Built-in Agent Loop, long-running with persistent state&lt;/td&gt;
&lt;td&gt;Requires manual composition of logic, on-demand execution&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Complex Workflow Support&lt;/td&gt;
&lt;td&gt;Primarily single-agent execution; complex workflows need external orchestrator&lt;/td&gt;
&lt;td&gt;Built-in chains, vector DBs, supports complex workflows&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Target Users&lt;/td&gt;
&lt;td&gt;Quickly build production-grade agents, focus on task execution&lt;/td&gt;
&lt;td&gt;Developers who want flexible combination of models, tools, and workflows&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Claude Agent SDK provides a ready-made agent execution engine, enabling you to quickly create runnable agents; LangChain offers a framework and tools for you to build the structure and processes of your agent.&lt;/p&gt;

&lt;h2&gt;
  
  
  Reference Documentation
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://platform.claude.com/docs/en/agent-sdk/overview" rel="noopener noreferrer"&gt;https://platform.claude.com/docs/en/agent-sdk/overview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.langchain.com/oss/python/langchain/overview" rel="noopener noreferrer"&gt;https://docs.langchain.com/oss/python/langchain/overview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://avatarmaker.fun/pixel-style-cat-avatar" rel="noopener noreferrer"&gt;https://avatarmaker.fun/pixel-style-cat-avatar&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>agents</category>
      <category>ai</category>
      <category>automation</category>
      <category>llm</category>
    </item>
    <item>
      <title>My first AI-assisted web game: PuzzlePave</title>
      <dc:creator>DanXiao</dc:creator>
      <pubDate>Fri, 05 Sep 2025 03:00:31 +0000</pubDate>
      <link>https://dev.to/_8d31359a797ee088ecde8/my-first-ai-assisted-web-game-puzzlepave-486e</link>
      <guid>https://dev.to/_8d31359a797ee088ecde8/my-first-ai-assisted-web-game-puzzlepave-486e</guid>
      <description>&lt;h2&gt;
  
  
  Exploring AI Programming: An Unexpected Success
&lt;/h2&gt;

&lt;p&gt;After a month of using Cursor, I attempted to develop a small game called Puzzlepave through conversational AI programming for the first time. The game is based on the p5.js framework, about which I had no prior knowledge. With the help of Cursor's AI programming capabilities, I not only successfully completed the game development but also deeply experienced the immense potential of AI tools in programming. This article will share the surprises and challenges encountered during this development process and discuss how to address new issues brought by AI programming.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Surprises of AI Programming: Cursor's Powerful Advantages
&lt;/h2&gt;

&lt;p&gt;Using Cursor to develop Puzzlepave allowed me to experience the unique charm of AI programming tools. Here are some notable advantages:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Quick Start with Zero Foundation&lt;/strong&gt;: Despite having no experience with p5.js, Cursor's conversational guidance and code generation helped me quickly grasp the core concepts of the framework and directly produce runnable code. This allowed me to focus on game logic and creativity without spending weeks learning the framework.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Rapid Problem Solving and Bug Fixing&lt;/strong&gt;: During development, whenever I encountered errors, I could simply copy the error messages to Cursor, which would quickly identify the issue and provide solutions. For example, when implementing the grid logic for Puzzlepave, the AI swiftly fixed a bug caused by incorrect coordinate calculations, greatly improving development efficiency.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Challenges and Concerns: The Double-Edged Sword of AI Programming
&lt;/h2&gt;

&lt;p&gt;While Cursor brought surprises, using AI for programming also presented challenges, especially since I wasn’t fully familiar with p5.js or the generated code. Below are some key issues:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Code Readability Challenges&lt;/strong&gt;: Although AI-generated code was functional, it was sometimes structurally complex with deeply nested logic. Even with my experience in other frameworks and attempts to request modular designs from the AI, the code was still not perfect, making it difficult to read and understand, particularly with advanced p5.js features.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Iterative Maintenance Risks&lt;/strong&gt;: Due to my limited understanding of the code, adding new features or optimizing existing logic in the future could be challenging. For instance, modifying the game’s core mechanics might require refactoring AI-generated code, which poses a challenge for me.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Debugging Complexity&lt;/strong&gt;: If the game encounters bugs, especially those related to the underlying mechanisms of p5.js, I may struggle to identify the root cause quickly due to my lack of deep framework knowledge.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Project Control Risks&lt;/strong&gt;: The most concerning issue is that AI-generated code might one day become “only understandable by AI,” leading to a situation where the project cannot be iterated or critical bugs cannot be fixed, ultimately hitting a development bottleneck.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;These challenges made me realize that while AI programming is efficient, it requires new development strategies to ensure project sustainability.&lt;/p&gt;

&lt;h2&gt;
  
  
  Strategies to Address AI Programming Challenges
&lt;/h2&gt;

&lt;p&gt;To tackle the challenges of AI programming, I summarized two core strategies to reduce risks and improve project maintainability:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Modular Design: Encapsulating Risks, Enhancing Control
&lt;/h3&gt;

&lt;p&gt;Modular design involves breaking down complex systems into independent, reusable modules. In AI programming, modularity can effectively reduce code complexity and encapsulate potential risks, similar to how clear module designs improve maintainability when using open-source frameworks like React or Django.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Specific Approach&lt;/strong&gt;: While developing Puzzlepave, I requested Cursor to split the game logic into multiple modules, such as “game configuration,” “level configuration,” and “grid logic.” Each module’s code was stored independently, minimizing interference and reducing overall code complexity.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Advantages&lt;/strong&gt;: Modularity makes code easier to understand and maintain. If an issue arises in a specific module, I can debug or rewrite it independently without affecting the entire codebase. Like trusting the modular design of jQuery or TensorFlow, modular AI code facilitates future replacements or feature upgrades.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. Comprehensive Documentation: Safeguarding AI Programming
&lt;/h3&gt;

&lt;p&gt;Complete product and technical documentation are the “lifeline” of AI programming projects. Detailed documentation provides traceable context for AI-generated code.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Product Documentation&lt;/strong&gt;: Documenting Puzzlepave’s functional requirements, user interaction flows, and design goals. For example, I recorded the game’s core mechanics (e.g., puzzle movement rules) and user interface designs to ensure quick recollection of the project context during future iterations.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Technical Documentation&lt;/strong&gt;: Detailed records of the code’s directory structure, routing logic, and module divisions. For instance, I created clear directory descriptions for Puzzlepave’s code structure, outlining the responsibilities and interactions of modules like game configuration, level configuration, and grid logic, making it easy to locate and understand code.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Reference
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://puzzlepave.com/" rel="noopener noreferrer"&gt;https://puzzlepave.com/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
  </channel>
</rss>
