<?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: chowyu</title>
    <description>The latest articles on DEV Community by chowyu (@chowyu12).</description>
    <link>https://dev.to/chowyu12</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3971363%2F1a718455-75dc-463a-940e-b06417e82f97.png</url>
      <title>DEV Community: chowyu</title>
      <link>https://dev.to/chowyu12</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/chowyu12"/>
    <language>en</language>
    <item>
      <title>AIClaw Now Returns Tool Output Attachments You Can Actually Download</title>
      <dc:creator>chowyu</dc:creator>
      <pubDate>Sun, 28 Jun 2026 11:48:42 +0000</pubDate>
      <link>https://dev.to/chowyu12/aiclaw-now-returns-tool-output-attachments-you-can-actually-download-23jo</link>
      <guid>https://dev.to/chowyu12/aiclaw-now-returns-tool-output-attachments-you-can-actually-download-23jo</guid>
      <description>&lt;p&gt;AIClaw already let agents run tools, generate files, and continue working across steps. The weak point was the handoff back to the user: a tool might create a report, image, or data file, but the final answer did not always make that output obvious or directly downloadable.&lt;/p&gt;

&lt;p&gt;Recent AIClaw changes tightened that workflow. Tool-generated files are now collected, deduplicated, exposed in API responses and streaming completion chunks, linked into the final assistant message, and rendered by the chat UI through stable &lt;code&gt;/public/files/&amp;lt;uuid&amp;gt;&lt;/code&gt; download URLs.&lt;/p&gt;

&lt;p&gt;This is not a cosmetic change. It closes the loop between tool execution and user-visible results.&lt;/p&gt;

&lt;h2&gt;
  
  
  The problem
&lt;/h2&gt;

&lt;p&gt;In a tool-using agent system, “I created the file” is not enough. Users need to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;know that a file was produced&lt;/li&gt;
&lt;li&gt;see which final answer it belongs to&lt;/li&gt;
&lt;li&gt;download it without searching through logs&lt;/li&gt;
&lt;li&gt;keep that file associated with the conversation history&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Without that, generated artifacts are easy to lose, especially when an agent uses multiple tools or delegates work to sub-agents.&lt;/p&gt;

&lt;h2&gt;
  
  
  What changed in AIClaw
&lt;/h2&gt;

&lt;p&gt;The recent attachment work is visible across the backend and frontend.&lt;/p&gt;

&lt;p&gt;On the execution side, AIClaw now:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;collects file outputs returned by tools&lt;/li&gt;
&lt;li&gt;scans sandbox directories for newly created files when a tool does not explicitly return a file result&lt;/li&gt;
&lt;li&gt;pulls generated files back out of &lt;code&gt;sub_agent&lt;/code&gt; results&lt;/li&gt;
&lt;li&gt;deduplicates attachments before the final response is stored or streamed&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can see that in the tool execution path:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="///Users/yu/go/src/github.com/chowyu12/aiclaw/internal/agent/tool_call.go"&gt;&lt;code&gt;/Users/yu/go/src/github.com/chowyu12/aiclaw/internal/agent/tool_call.go&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="///Users/yu/go/src/github.com/chowyu12/aiclaw/internal/agent/executor.go"&gt;&lt;code&gt;/Users/yu/go/src/github.com/chowyu12/aiclaw/internal/agent/executor.go&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The final assistant response now appends an attachment section with Markdown links such as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;Attachment List:
&lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;report.csv&lt;/span&gt;&lt;span class="p"&gt;](&lt;/span&gt;&lt;span class="sx"&gt;/public/files/&lt;/span&gt;&lt;span class="nt"&gt;&amp;lt;uuid&amp;gt;&lt;/span&gt;)
&lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;chart.png&lt;/span&gt;&lt;span class="p"&gt;](&lt;/span&gt;&lt;span class="sx"&gt;/public/files/&lt;/span&gt;&lt;span class="nt"&gt;&amp;lt;uuid&amp;gt;&lt;/span&gt;)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the current Chinese codebase revision, that section is rendered as &lt;code&gt;附件列表&lt;/code&gt; in the saved final content.&lt;/p&gt;

&lt;p&gt;The response payload also includes files directly:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;blocking chat responses now return &lt;code&gt;files&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;streaming &lt;code&gt;done&lt;/code&gt; chunks now include &lt;code&gt;files&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That path is visible in:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="///Users/yu/go/src/github.com/chowyu12/aiclaw/internal/model/message.go"&gt;&lt;code&gt;/Users/yu/go/src/github.com/chowyu12/aiclaw/internal/model/message.go&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="///Users/yu/go/src/github.com/chowyu12/aiclaw/internal/handler/chat.go"&gt;&lt;code&gt;/Users/yu/go/src/github.com/chowyu12/aiclaw/internal/handler/chat.go&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="///Users/yu/go/src/github.com/chowyu12/aiclaw/web/src/api/chat.ts"&gt;&lt;code&gt;/Users/yu/go/src/github.com/chowyu12/aiclaw/web/src/api/chat.ts&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;On the frontend, the chat view turns those file objects into clickable downloads through &lt;code&gt;/public/files/${file.uuid}&lt;/code&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="///Users/yu/go/src/github.com/chowyu12/aiclaw/web/src/views/chat/Index.vue"&gt;&lt;code&gt;/Users/yu/go/src/github.com/chowyu12/aiclaw/web/src/views/chat/Index.vue&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why this matters in practice
&lt;/h2&gt;

&lt;p&gt;This feature is useful anywhere an AIClaw agent produces artifacts instead of pure text.&lt;/p&gt;

&lt;p&gt;Examples:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;A &lt;code&gt;code_interpreter&lt;/code&gt; task generates a CSV and a PNG chart.&lt;/li&gt;
&lt;li&gt;A browser automation flow saves a screenshot or extracted document.&lt;/li&gt;
&lt;li&gt;A sub-agent writes a research summary file and passes it back to the parent run.&lt;/li&gt;
&lt;li&gt;A shell command creates a log bundle or transformed dataset in the sandbox.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Before this improvement, users could still end up asking, “Where did the file go?”&lt;/p&gt;

&lt;p&gt;Now the expected workflow is much cleaner:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The tool runs.&lt;/li&gt;
&lt;li&gt;AIClaw captures the output files.&lt;/li&gt;
&lt;li&gt;The final answer includes explicit download links.&lt;/li&gt;
&lt;li&gt;The API and streamed completion both carry the file metadata.&lt;/li&gt;
&lt;li&gt;The UI renders the attachments as part of the conversation result.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That means AIClaw behaves more like a practical work system and less like a text-only chatbot that happens to call tools.&lt;/p&gt;

&lt;h2&gt;
  
  
  A small detail that matters: sub-agent outputs
&lt;/h2&gt;

&lt;p&gt;One useful part of this change is that file outputs are not limited to the top-level agent.&lt;/p&gt;

&lt;p&gt;The executor now extracts file references from &lt;code&gt;sub_agent&lt;/code&gt; results and folds them back into the parent response. That matters because many real AIClaw workflows split research, scraping, or data prep into delegated tasks. If child artifacts disappear at the parent boundary, the system feels unreliable.&lt;/p&gt;

&lt;p&gt;Bringing those files back into the parent answer makes nested agent execution much easier to trust.&lt;/p&gt;

&lt;h2&gt;
  
  
  Another practical improvement: better streaming behavior
&lt;/h2&gt;

&lt;p&gt;The same change set also adds SSE ping support in chat streaming handlers. That is separate from attachments, but it helps long-running tool workflows stay alive while the agent is still working.&lt;/p&gt;

&lt;p&gt;For attachment-heavy runs, that pairing is useful:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;streaming stays active during long tool work&lt;/li&gt;
&lt;li&gt;the final &lt;code&gt;done&lt;/code&gt; chunk can carry the generated files&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why I picked this feature
&lt;/h2&gt;

&lt;p&gt;This is a good example of AIClaw’s local-first, tool-oriented design philosophy. The platform is not just trying to produce a nice paragraph. It is trying to complete work and return the artifacts that work produces.&lt;/p&gt;

&lt;p&gt;Generated files are often the real output. Making them first-class in the response path is the right move.&lt;/p&gt;

&lt;p&gt;If you are building with AIClaw, this is the kind of feature that improves daily usability more than another abstract prompt tweak.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>opensource</category>
      <category>webdev</category>
      <category>agents</category>
    </item>
    <item>
      <title>AIClaw Separates Persistent Memory From Session Search</title>
      <dc:creator>chowyu</dc:creator>
      <pubDate>Thu, 25 Jun 2026 11:55:44 +0000</pubDate>
      <link>https://dev.to/chowyu12/aiclaw-separates-persistent-memory-from-session-search-1hnk</link>
      <guid>https://dev.to/chowyu12/aiclaw-separates-persistent-memory-from-session-search-1hnk</guid>
      <description>&lt;p&gt;One of the fastest ways to make an agent messy is to treat every kind of memory as the same thing.&lt;/p&gt;

&lt;p&gt;User preferences, project conventions, environment facts, old debugging sessions, and last week's conversation snippets do not belong in one undifferentiated bucket. AIClaw's current design avoids that by splitting long-term memory into two explicit mechanisms:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;persistent memory for durable facts&lt;/li&gt;
&lt;li&gt;session search for historical conversation recall&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That split is worth looking at because it solves real operating problems for self-hosted agents.&lt;/p&gt;

&lt;h2&gt;
  
  
  The design goal
&lt;/h2&gt;

&lt;p&gt;There are three failure modes that show up quickly in agent systems:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;everything is stuffed into the prompt, so context grows until it becomes noisy and expensive&lt;/li&gt;
&lt;li&gt;everything is hidden in a database blob, so operators cannot inspect or edit it cleanly&lt;/li&gt;
&lt;li&gt;old conversations are either forgotten completely or reloaded too aggressively&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;AIClaw addresses those problems with two different tools that do two different jobs.&lt;/p&gt;

&lt;h2&gt;
  
  
  Persistent memory is stored as editable files
&lt;/h2&gt;

&lt;p&gt;The repository documents persistent memory in &lt;a href="///Users/yu/go/src/github.com/chowyu12/aiclaw/README.md"&gt;&lt;code&gt;README.md&lt;/code&gt;&lt;/a&gt; and implements it in &lt;a href="///Users/yu/go/src/github.com/chowyu12/aiclaw/internal/tools/memorytool/memory.go"&gt;&lt;code&gt;internal/tools/memorytool/memory.go&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Instead of hiding long-term memory in opaque storage, AIClaw keeps it in plain text files:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;MEMORY.md&lt;/code&gt; for durable agent notes, environment facts, and conventions&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;USER.md&lt;/code&gt; for user preferences and communication style&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is a practical choice. Operators can inspect, review, and edit those files directly when needed, which is much easier than debugging memory behavior through serialized blobs.&lt;/p&gt;

&lt;h2&gt;
  
  
  The current session gets a frozen snapshot
&lt;/h2&gt;

&lt;p&gt;AIClaw does not continuously mutate the active system prompt every time memory changes.&lt;/p&gt;

&lt;p&gt;At session start, it loads a snapshot of &lt;code&gt;MEMORY.md&lt;/code&gt; and &lt;code&gt;USER.md&lt;/code&gt; and injects that into the prompt. The loader in &lt;a href="///Users/yu/go/src/github.com/chowyu12/aiclaw/internal/agent/prompt_loaders.go"&gt;&lt;code&gt;internal/agent/prompt_loaders.go&lt;/code&gt;&lt;/a&gt; calls &lt;code&gt;memorytool.LoadSnapshot(...)&lt;/code&gt; and joins the resulting memory blocks into the runtime prompt.&lt;/p&gt;

&lt;p&gt;That means memory writes during a session affect future sessions, not the already-running one.&lt;/p&gt;

&lt;p&gt;This is a strong constraint, and I think it is the right one. It keeps prompt behavior stable inside a run and avoids a hard-to-debug class of issues where the agent silently changes its own instructions halfway through execution.&lt;/p&gt;

&lt;h2&gt;
  
  
  Memory growth is bounded
&lt;/h2&gt;

&lt;p&gt;The memory tool also has explicit limits:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;MEMORY.md&lt;/code&gt; is capped at 2200 characters&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;USER.md&lt;/code&gt; is capped at 1375 characters&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When usage gets high enough, AIClaw switches the injected snapshot into an index mode. Instead of pushing full entry bodies into the prompt, it injects a compact list of entry IDs, tags, and short summaries.&lt;/p&gt;

&lt;p&gt;If the agent later needs one of those full entries, it can fetch it explicitly with &lt;code&gt;memory(action=recall, ids=[...])&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;That is a smart tradeoff. Long-term memory stays available, but the prompt does not have to pay the full token cost every time.&lt;/p&gt;

&lt;h2&gt;
  
  
  Memory writes are treated as a security surface
&lt;/h2&gt;

&lt;p&gt;This part is easy to miss, but important.&lt;/p&gt;

&lt;p&gt;The memory tool scans content before saving it. The implementation rejects suspicious injection-style patterns and invisible Unicode characters that could be used to smuggle prompt instructions into future sessions.&lt;/p&gt;

&lt;p&gt;That makes sense because memory is not just stored data in AIClaw. It is future system-prompt material.&lt;/p&gt;

&lt;h2&gt;
  
  
  Session search solves a different problem
&lt;/h2&gt;

&lt;p&gt;Persistent memory is for stable facts. Historical conversation lookup is different.&lt;/p&gt;

&lt;p&gt;Sometimes the agent does not need a durable note. It needs to answer questions like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What did we discuss in the earlier deployment thread?&lt;/li&gt;
&lt;li&gt;Which error message showed up last time?&lt;/li&gt;
&lt;li&gt;What did the user say about this workflow in a prior session?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That is what &lt;a href="///Users/yu/go/src/github.com/chowyu12/aiclaw/internal/tools/sessionsearch/session_search.go"&gt;&lt;code&gt;internal/tools/sessionsearch/session_search.go&lt;/code&gt;&lt;/a&gt; is for.&lt;/p&gt;

&lt;p&gt;The tool has two modes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;no query: return recent conversations with previews&lt;/li&gt;
&lt;li&gt;query provided: search prior messages and return matching snippets&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  SQLite gets FTS5, other databases still work
&lt;/h2&gt;

&lt;p&gt;The search implementation in &lt;a href="///Users/yu/go/src/github.com/chowyu12/aiclaw/internal/store/gormstore/fts.go"&gt;&lt;code&gt;internal/store/gormstore/fts.go&lt;/code&gt;&lt;/a&gt; adds a practical optimization.&lt;/p&gt;

&lt;p&gt;When AIClaw runs on SQLite, it initializes an FTS5 virtual table plus triggers to keep the search index synchronized with new and deleted messages. It also backfills existing data on startup.&lt;/p&gt;

&lt;p&gt;When FTS5 is unavailable, AIClaw falls back to a SQL &lt;code&gt;LIKE&lt;/code&gt; search path.&lt;/p&gt;

&lt;p&gt;That is exactly the kind of graceful degradation I want in a local-first system. SQLite gets a fast search path, but the feature does not disappear on other databases.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why the split matters operationally
&lt;/h2&gt;

&lt;p&gt;This is the real value of the feature:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;durable facts go into editable memory files&lt;/li&gt;
&lt;li&gt;old conversation details stay in searchable archives&lt;/li&gt;
&lt;li&gt;the active prompt remains more compact&lt;/li&gt;
&lt;li&gt;and both behaviors are explicit enough to inspect&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That is better than trying to solve all recall problems with one giant "memory" abstraction.&lt;/p&gt;

&lt;h2&gt;
  
  
  A practical workflow
&lt;/h2&gt;

&lt;p&gt;If I were operating AIClaw day to day, I would use it like this:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Save stable rules, preferences, and environment facts with the &lt;code&gt;memory&lt;/code&gt; tool.&lt;/li&gt;
&lt;li&gt;Use &lt;code&gt;session_search&lt;/code&gt; when you need to retrieve something from older conversations.&lt;/li&gt;
&lt;li&gt;Let the snapshot and index-mode design keep the active prompt lean.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That is a more durable model for long-running agents than simply loading more chat history and hoping the model figures out what still matters.&lt;/p&gt;

&lt;p&gt;AIClaw's memory layer is not flashy, but it is disciplined. For self-hosted agent systems, that discipline is usually what keeps advanced features usable after the first demo.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>opensource</category>
      <category>agents</category>
      <category>productivity</category>
    </item>
    <item>
      <title>How AIClaw Extends Agents with Custom Tools and MCP Servers</title>
      <dc:creator>chowyu</dc:creator>
      <pubDate>Tue, 23 Jun 2026 11:54:53 +0000</pubDate>
      <link>https://dev.to/chowyu12/how-aiclaw-extends-agents-with-custom-tools-and-mcp-servers-6cm</link>
      <guid>https://dev.to/chowyu12/how-aiclaw-extends-agents-with-custom-tools-and-mcp-servers-6cm</guid>
      <description>&lt;p&gt;Most agent demos look flexible until you need them to talk to your own systems.&lt;/p&gt;

&lt;p&gt;That is where AIClaw takes a practical route. The project ships with a broad built-in toolset, but it also lets you extend agents through custom HTTP tools, script tools, and MCP servers without changing the core runtime.&lt;/p&gt;

&lt;p&gt;This is not a new feature announcement. It is an existing part of the current repository that is worth a deeper look because it changes what an AIClaw deployment can actually do in day-to-day work.&lt;/p&gt;

&lt;h2&gt;
  
  
  The problem: built-ins are not enough
&lt;/h2&gt;

&lt;p&gt;Built-in tools cover the common cases well: files, shell, browser automation, web search, web fetch, memory, session search, scheduled jobs, code interpretation, and sub-agents.&lt;/p&gt;

&lt;p&gt;But real deployments usually need one more layer:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Call an internal HTTP API.&lt;/li&gt;
&lt;li&gt;Wrap a small script around an existing operational workflow.&lt;/li&gt;
&lt;li&gt;Reuse external MCP tools from another server process.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Without that layer, the agent can reason, but it cannot reach the systems that matter in your environment.&lt;/p&gt;

&lt;h2&gt;
  
  
  AIClaw's extension model
&lt;/h2&gt;

&lt;p&gt;The current README describes AIClaw's tool system as a combination of:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;built-in tools&lt;/li&gt;
&lt;li&gt;custom HTTP tools&lt;/li&gt;
&lt;li&gt;custom command tools&lt;/li&gt;
&lt;li&gt;MCP server tools&lt;/li&gt;
&lt;li&gt;skill-defined tools&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In the runtime, those paths are normalized into the same execution flow.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;internal/agent/tool.go&lt;/code&gt; builds tracked tools from the configured definitions. Built-ins get their native handlers, HTTP tools are wrapped with &lt;code&gt;NewHTTPHandler&lt;/code&gt;, command tools use &lt;code&gt;NewCommandHandler&lt;/code&gt;, script tools use &lt;code&gt;NewScriptHandler&lt;/code&gt;, and MCP tools are loaded from connected servers before the model call.&lt;/p&gt;

&lt;p&gt;That matters because extension points do not become second-class behavior. They still participate in the same execution loop, step tracking, and agent prompt assembly.&lt;/p&gt;

&lt;h2&gt;
  
  
  Custom tools from the web console
&lt;/h2&gt;

&lt;p&gt;The current tool management UI gives you a practical authoring flow instead of requiring hand-written runtime config.&lt;/p&gt;

&lt;p&gt;On the Tools page you can:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create a tool with a name, description, timeout, and enabled state.&lt;/li&gt;
&lt;li&gt;Choose a handler type.&lt;/li&gt;
&lt;li&gt;Define the function schema that the model will see.&lt;/li&gt;
&lt;li&gt;Bind the tool to agents that should be allowed to call it.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The form currently exposes two handler types directly in the UI:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;HTTP Callback&lt;/li&gt;
&lt;li&gt;Script&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For HTTP tools, AIClaw lets you define a request URL and method, with &lt;code&gt;{param_name}&lt;/code&gt; placeholders that are substituted from model-supplied arguments at runtime.&lt;/p&gt;

&lt;p&gt;For script tools, the form supports:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Python&lt;/li&gt;
&lt;li&gt;JavaScript&lt;/li&gt;
&lt;li&gt;Shell&lt;/li&gt;
&lt;li&gt;Go&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The same page also lets you describe the function in a structured way or switch to raw JSON mode for the full function definition.&lt;/p&gt;

&lt;p&gt;That is a useful design choice. It keeps the operational handler config and the model-visible function schema separate, which makes tools easier to tune without rewriting everything.&lt;/p&gt;

&lt;h2&gt;
  
  
  MCP servers as first-class runtime inputs
&lt;/h2&gt;

&lt;p&gt;AIClaw also has a dedicated MCP management page.&lt;/p&gt;

&lt;p&gt;The current MCP settings flow supports:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;stdio&lt;/code&gt; transport&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;sse&lt;/code&gt; transport&lt;/li&gt;
&lt;li&gt;endpoint configuration&lt;/li&gt;
&lt;li&gt;argument lists&lt;/li&gt;
&lt;li&gt;enabled or disabled state&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The runtime API behind that page is straightforward: &lt;code&gt;GET /api/v1/runtime/mcp&lt;/code&gt; reads the workspace MCP list, and &lt;code&gt;PUT /api/v1/runtime/mcp&lt;/code&gt; replaces it.&lt;/p&gt;

&lt;p&gt;The runtime side is more interesting.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;internal/tools/mcp/client.go&lt;/code&gt; connects to each enabled MCP server, initializes the client, lists available tools, and then exposes them to the agent executor. In &lt;code&gt;internal/agent/executor.go&lt;/code&gt;, MCP tools are connected before execution so they can be merged into the available tool set for the request.&lt;/p&gt;

&lt;p&gt;This gives AIClaw two useful extension paths:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;create narrow custom tools inside AIClaw when the integration is simple&lt;/li&gt;
&lt;li&gt;mount an external MCP server when the tool suite already exists elsewhere&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Safety and operability details that matter
&lt;/h2&gt;

&lt;p&gt;The implementation is more pragmatic than flashy, and that is a good thing.&lt;/p&gt;

&lt;p&gt;A few concrete examples from the current codebase:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;HTTP tool calls use a shared HTTP client with connection pooling instead of rebuilding a client on every invocation.&lt;/li&gt;
&lt;li&gt;Command tools apply additional safety checks on top of the normal shell safeguards, including blocking patterns like outbound shell access and risky recursive deletes.&lt;/li&gt;
&lt;li&gt;Tool calls are wrapped as tracked steps, so custom and MCP-backed calls show up in the same execution timeline as built-ins.&lt;/li&gt;
&lt;li&gt;The MCP manager is reused at the executor level instead of being torn down after every request.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These are not marketing details. They are the difference between "extensible in theory" and "usable under load".&lt;/p&gt;

&lt;h2&gt;
  
  
  A practical workflow
&lt;/h2&gt;

&lt;p&gt;If you want to extend an AIClaw agent today, the workflow is roughly:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Start with the smallest possible integration.&lt;/li&gt;
&lt;li&gt;If the system is just one API call, create a custom HTTP tool.&lt;/li&gt;
&lt;li&gt;If the integration needs local logic, wrapping, or formatting, use a script tool.&lt;/li&gt;
&lt;li&gt;If you already have a larger tool surface implemented elsewhere, register it as an MCP server.&lt;/li&gt;
&lt;li&gt;Attach only the needed tools to the target agent.&lt;/li&gt;
&lt;li&gt;Inspect the execution log after real runs to verify the tool contract is clear enough for the model.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;A good example is an internal support workflow:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;one HTTP tool for looking up a ticket by ID&lt;/li&gt;
&lt;li&gt;one script tool for normalizing the raw result into a concise summary&lt;/li&gt;
&lt;li&gt;one MCP server for a broader internal knowledge or operations toolkit&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That combination keeps the default agent prompt small while still giving the agent a path into real systems.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why this matters
&lt;/h2&gt;

&lt;p&gt;The strongest agent products are not the ones with the longest built-in tool list. They are the ones that let you adapt the tool surface to your own environment without fighting the runtime.&lt;/p&gt;

&lt;p&gt;AIClaw's current design gets that mostly right:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;built-ins for common work&lt;/li&gt;
&lt;li&gt;custom tools for narrow integrations&lt;/li&gt;
&lt;li&gt;MCP for external tool ecosystems&lt;/li&gt;
&lt;li&gt;shared execution logging so everything stays inspectable&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you are building self-hosted agents, that is the layer that turns a chat UI into an actual operations surface.&lt;/p&gt;

&lt;p&gt;Repo: &lt;a href="https://github.com/chowyu12/aiclaw" rel="noopener noreferrer"&gt;AIClaw on GitHub&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>opensource</category>
      <category>agents</category>
      <category>webdev</category>
    </item>
    <item>
      <title>AIClaw Adds Configurable Web Search Without Hiding Execution Details</title>
      <dc:creator>chowyu</dc:creator>
      <pubDate>Sat, 20 Jun 2026 08:36:03 +0000</pubDate>
      <link>https://dev.to/chowyu12/aiclaw-adds-configurable-web-search-without-hiding-execution-details-70f</link>
      <guid>https://dev.to/chowyu12/aiclaw-adds-configurable-web-search-without-hiding-execution-details-70f</guid>
      <description>&lt;p&gt;Most AI agent products say they can "search the web," but they often collapse several very different behaviors into one checkbox.&lt;/p&gt;

&lt;p&gt;In the current AIClaw repository, web search is modeled more explicitly:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;some models can use built-in provider-side search&lt;/li&gt;
&lt;li&gt;other agents can call an external &lt;code&gt;web_search&lt;/code&gt; tool through a configured search engine&lt;/li&gt;
&lt;li&gt;both paths are visible in runtime behavior instead of being hidden behind vague magic&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That separation matters if you run agents in production and want control over cost, provider choice, prompts, and auditability.&lt;/p&gt;

&lt;h2&gt;
  
  
  What changed in AIClaw
&lt;/h2&gt;

&lt;p&gt;Recent AIClaw changes added a full search engine configuration surface and the agent-side wiring needed to use it:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;a new Search Engine page in the web console&lt;/li&gt;
&lt;li&gt;persisted search engine configs in the backend&lt;/li&gt;
&lt;li&gt;external search support for Tavily, SerpAPI, and Aliyun IQS&lt;/li&gt;
&lt;li&gt;agent settings for &lt;code&gt;builtin&lt;/code&gt; versus &lt;code&gt;external&lt;/code&gt; web search mode&lt;/li&gt;
&lt;li&gt;runtime handling that enables model-native search only when that mode is selected&lt;/li&gt;
&lt;li&gt;a follow-up UI fix that turns web search on automatically when an external engine is chosen&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is not just a README claim. The repository now includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;internal/handler/search_engine.go&lt;/code&gt; for CRUD and test endpoints&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;internal/tools/websearch/search.go&lt;/code&gt; for provider-specific search execution&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;web/src/views/search-engine/Index.vue&lt;/code&gt; for the console UI&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;web/src/views/agent/Form.vue&lt;/code&gt; for per-agent mode and engine selection&lt;/li&gt;
&lt;li&gt;tests covering built-in and external search behavior&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why two search modes are better than one
&lt;/h2&gt;

&lt;p&gt;AIClaw now documents two distinct modes in &lt;a href="///Users/yu/go/src/github.com/chowyu12/aiclaw/README.md"&gt;&lt;code&gt;README.md&lt;/code&gt;&lt;/a&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;built-in mode: AIClaw sets &lt;code&gt;extra_body: {"enable_search": true}&lt;/code&gt; for models that support provider-native search&lt;/li&gt;
&lt;li&gt;external mode: AIClaw exposes a &lt;code&gt;web_search&lt;/code&gt; tool and routes calls through a saved search engine config&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That design solves a real operational problem.&lt;/p&gt;

&lt;p&gt;Built-in model search is convenient when the provider already supports it well. In AIClaw, the prompt layer explicitly tells the model that recent and time-sensitive questions can use built-in search. The runtime also records a &lt;code&gt;web_search&lt;/code&gt; execution step that shows the request configuration used for that model call.&lt;/p&gt;

&lt;p&gt;External search is different. Sometimes you do not want your search behavior tied to one model vendor. Sometimes you want to standardize on a search provider across multiple model backends. Sometimes you want to rotate providers, test them independently, or keep search visible as a normal tool call with structured input and output.&lt;/p&gt;

&lt;p&gt;AIClaw supports that split instead of forcing one compromise.&lt;/p&gt;

&lt;h2&gt;
  
  
  How the flow works
&lt;/h2&gt;

&lt;p&gt;The user workflow is straightforward:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open the Search Engine page in the AIClaw admin console.&lt;/li&gt;
&lt;li&gt;Create one or more search configs.&lt;/li&gt;
&lt;li&gt;Pick the provider: Tavily, SerpAPI, or Aliyun IQS.&lt;/li&gt;
&lt;li&gt;Save the API key and optional base URL.&lt;/li&gt;
&lt;li&gt;Test the config before using it live.&lt;/li&gt;
&lt;li&gt;Open an agent.&lt;/li&gt;
&lt;li&gt;Enable web search.&lt;/li&gt;
&lt;li&gt;Choose &lt;code&gt;external&lt;/code&gt; mode if you want tool-based search.&lt;/li&gt;
&lt;li&gt;Select one enabled search engine for that agent.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;On the backend, AIClaw validates that external mode is only accepted when a real enabled search engine is selected. That check lives in &lt;code&gt;validateExternalWebSearch&lt;/code&gt; inside &lt;a href="///Users/yu/go/src/github.com/chowyu12/aiclaw/internal/handler/agent.go"&gt;&lt;code&gt;internal/handler/agent.go&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The frontend follow-up fix is also important. In &lt;a href="///Users/yu/go/src/github.com/chowyu12/aiclaw/web/src/views/agent/Form.vue"&gt;&lt;code&gt;web/src/views/agent/Form.vue&lt;/code&gt;&lt;/a&gt;, selecting external mode now auto-selects the first enabled engine when possible, and selecting an engine automatically enables web search. That sounds small, but it removes a common configuration footgun: "I picked an engine, why is search still off?"&lt;/p&gt;

&lt;h2&gt;
  
  
  Provider behavior is implemented, not hand-waved
&lt;/h2&gt;

&lt;p&gt;AIClaw does not treat external search as a generic proxy blob. The repository includes explicit provider logic:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Tavily uses &lt;code&gt;https://api.tavily.com/search&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;SerpAPI uses &lt;code&gt;https://serpapi.com/search.json&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Aliyun IQS uses &lt;code&gt;https://cloud-iqs.aliyuncs.com/search/unified&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The tool normalizes limits, validates config state, trims oversized snippets, and returns structured results with title, URL, and snippet fields.&lt;/p&gt;

&lt;p&gt;That means the agent can use web results in a predictable format regardless of provider, while operators still choose the engine that fits their environment.&lt;/p&gt;

&lt;h2&gt;
  
  
  The observability part is the real strength
&lt;/h2&gt;

&lt;p&gt;My favorite part is that AIClaw keeps search behavior observable.&lt;/p&gt;

&lt;p&gt;For built-in search, the runtime records that model-native search was enabled and stores the request configuration in a &lt;code&gt;web_search&lt;/code&gt; step.&lt;/p&gt;

&lt;p&gt;For external search, the agent uses the regular &lt;code&gt;web_search&lt;/code&gt; tool path, so tool input, output, duration, and errors stay visible in chat progress and execution logs.&lt;/p&gt;

&lt;p&gt;This fits the broader AIClaw design direction: runtime plan state, generated files, execution steps, memory, and now search behavior are treated as first-class runtime objects instead of hidden implementation details.&lt;/p&gt;

&lt;p&gt;If you are operating agents for real work, that is a better tradeoff than a black-box "browse the web" toggle.&lt;/p&gt;

&lt;h2&gt;
  
  
  A practical example
&lt;/h2&gt;

&lt;p&gt;Imagine two agents:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;a news-monitoring agent using a model with strong built-in search support&lt;/li&gt;
&lt;li&gt;a research or compliance agent that must use a specific external search provider&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In AIClaw, those do not need the same search path.&lt;/p&gt;

&lt;p&gt;The first agent can stay in built-in mode for a tighter provider-integrated experience.&lt;/p&gt;

&lt;p&gt;The second agent can switch to external mode, bind to a chosen engine, and keep the search action visible as a tool call with inspectable results.&lt;/p&gt;

&lt;p&gt;That is a more production-friendly model than pretending every search use case is identical.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why this feature stood out
&lt;/h2&gt;

&lt;p&gt;I picked this topic because it is a concrete feature with recent implementation depth across backend, runtime, tests, and UI:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;feature commit: configurable search engines&lt;/li&gt;
&lt;li&gt;follow-up fix: external search becomes active as soon as an engine is selected&lt;/li&gt;
&lt;li&gt;documented behavior in the README&lt;/li&gt;
&lt;li&gt;explicit tests for built-in versus external execution&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That combination makes it a good example of how AIClaw is evolving: not just adding another capability, but making the capability configurable and inspectable.&lt;/p&gt;

&lt;p&gt;AIClaw is open source and self-hosted, so these details matter. When you control the stack, you also need to control how the agent reaches the outside world.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>opensource</category>
      <category>webdev</category>
      <category>agents</category>
    </item>
    <item>
      <title>How AIClaw Compresses Long Agent Conversations Without Losing the Important Parts</title>
      <dc:creator>chowyu</dc:creator>
      <pubDate>Fri, 19 Jun 2026 08:57:54 +0000</pubDate>
      <link>https://dev.to/chowyu12/how-aiclaw-compresses-long-agent-conversations-without-losing-the-important-parts-2h1c</link>
      <guid>https://dev.to/chowyu12/how-aiclaw-compresses-long-agent-conversations-without-losing-the-important-parts-2h1c</guid>
      <description>&lt;p&gt;Long-running agent sessions eventually hit the same problem: the model keeps accumulating chat history, tool outputs, intermediate decisions, and execution traces until the prompt becomes expensive or unstable. AIClaw has a built-in answer for that problem. It does not simply drop old messages. It compresses the middle of the conversation into a structured summary and keeps the parts that still matter for the next step.&lt;/p&gt;

&lt;p&gt;This is not a new release post. It is a deeper look at one existing AIClaw runtime feature: context compression.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Problem
&lt;/h2&gt;

&lt;p&gt;AIClaw is designed for tool-using work, not short chatbot replies. A single task can include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;multiple rounds of shell or browser tool calls&lt;/li&gt;
&lt;li&gt;long tool outputs&lt;/li&gt;
&lt;li&gt;plan-state progress updates&lt;/li&gt;
&lt;li&gt;follow-up fixes after the first attempt&lt;/li&gt;
&lt;li&gt;sub-agent results flowing back into the parent run&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That is useful context, but it also means the prompt grows fast. If the runtime sends everything back to the model forever, cost increases and the model starts paying attention to the wrong parts of the history.&lt;/p&gt;

&lt;p&gt;The README describes this capability briefly as:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Runtime compression: Long middle context can be summarized during execution.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The implementation behind that line is more specific than it sounds.&lt;/p&gt;

&lt;h2&gt;
  
  
  When AIClaw Decides To Compress
&lt;/h2&gt;

&lt;p&gt;The decision lives in &lt;code&gt;internal/agent/context_compressor.go&lt;/code&gt; and is wired into the main execution loop in &lt;code&gt;internal/agent/run.go&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Before each LLM round, AIClaw checks whether the current prompt is too large relative to the model context window.&lt;/p&gt;

&lt;p&gt;The current defaults are straightforward:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;compress when prompt usage reaches 50% of the model context window&lt;/li&gt;
&lt;li&gt;keep the system message at the head&lt;/li&gt;
&lt;li&gt;keep at least the latest 20 messages at the tail&lt;/li&gt;
&lt;li&gt;require at least 5 middle messages before compression is worth doing&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If the model provider reports real prompt-token usage, AIClaw uses that. Otherwise it falls back to an internal estimate. That matters because the trigger is based on actual prompt pressure, not just message count.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Gets Compressed, And What Stays Intact
&lt;/h2&gt;

&lt;p&gt;AIClaw uses a four-phase flow.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Prune old tool output first
&lt;/h3&gt;

&lt;p&gt;Before asking the model to summarize, AIClaw trims older tool messages outside the protected tail window. Tool outputs in that middle region are truncated to 200 runes. That keeps huge logs from dominating the summary prompt.&lt;/p&gt;

&lt;p&gt;This is an important design choice. The runtime does not try to summarize raw noise at full size first. It reduces obviously low-value bulk before paying for the summarization call.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Protect the head and the tail
&lt;/h3&gt;

&lt;p&gt;The compressor preserves:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the head of the conversation, especially the system prompt&lt;/li&gt;
&lt;li&gt;the latest tail of the conversation, where the current working state lives&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The part in the middle becomes the candidate for compression.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Ask an LLM for a structured summary
&lt;/h3&gt;

&lt;p&gt;Instead of generating a vague paragraph, AIClaw asks for a strict template with sections like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Goal&lt;/li&gt;
&lt;li&gt;Constraints And Preferences&lt;/li&gt;
&lt;li&gt;Progress&lt;/li&gt;
&lt;li&gt;Key Decisions&lt;/li&gt;
&lt;li&gt;Relevant Files&lt;/li&gt;
&lt;li&gt;Next Steps&lt;/li&gt;
&lt;li&gt;Critical Context&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is a practical choice for agent continuity. The summary is meant to preserve execution state, not produce pretty prose.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Rebuild the conversation with a summary message
&lt;/h3&gt;

&lt;p&gt;After summarization, AIClaw inserts a &lt;code&gt;[Context Compression Summary]&lt;/code&gt; message and appends a note to the system prompt that earlier conversation has been compressed.&lt;/p&gt;

&lt;p&gt;The result is smaller than the original history, but still carries forward the task objective, decisions, blockers, touched files, and next action.&lt;/p&gt;

&lt;h2&gt;
  
  
  Tool Calls Are Not Split Apart
&lt;/h2&gt;

&lt;p&gt;A subtle detail in the implementation is that AIClaw does not cut through an assistant/tool-call group. The compressor aligns the preserved tail boundary backward so a tool call and its tool results stay together.&lt;/p&gt;

&lt;p&gt;That matters because broken tool-call sequences are confusing for the next model round. If an assistant message says it called a tool but the corresponding tool results are missing from the preserved tail, the reconstructed context becomes misleading.&lt;/p&gt;

&lt;p&gt;There are tests for this behavior in &lt;code&gt;internal/agent/context_compressor_test.go&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Compression Is Iterative, Not One-Shot
&lt;/h2&gt;

&lt;p&gt;AIClaw also keeps the previous compression summary in memory during the active run. On the next compression pass, it does not start from zero. It sends:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the previous summary&lt;/li&gt;
&lt;li&gt;the newly accumulated conversation slice&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Then it asks the model to merge them into an updated structured summary.&lt;/p&gt;

&lt;p&gt;This makes repeated compression cheaper and more stable in long tasks. Instead of re-summarizing the entire old middle history every time, AIClaw incrementally rolls forward the important state.&lt;/p&gt;

&lt;h2&gt;
  
  
  Which Model Handles Compression
&lt;/h2&gt;

&lt;p&gt;The main execution loop prefers the agent's &lt;code&gt;FastModelName&lt;/code&gt; for compression when one is configured; otherwise it falls back to the primary model.&lt;/p&gt;

&lt;p&gt;That is a good default for a local-first agent platform:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the expensive or premium model stays focused on the real task&lt;/li&gt;
&lt;li&gt;the cheaper or faster model can handle summarization work&lt;/li&gt;
&lt;li&gt;prompt size stays under control during long sessions&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  A Practical Example
&lt;/h2&gt;

&lt;p&gt;Imagine a debugging session where an AIClaw agent:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;reads several Go files&lt;/li&gt;
&lt;li&gt;runs tests&lt;/li&gt;
&lt;li&gt;inspects logs&lt;/li&gt;
&lt;li&gt;edits code&lt;/li&gt;
&lt;li&gt;reruns tests&lt;/li&gt;
&lt;li&gt;asks a sub-agent to inspect a failing subsystem&lt;/li&gt;
&lt;li&gt;returns to the parent run for the final fix&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Without compression, the conversation history gradually becomes a pile of stale tool output. With compression, AIClaw can keep the current tail intact while rolling earlier work into a structured checkpoint that still remembers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;which files were already inspected&lt;/li&gt;
&lt;li&gt;which commands succeeded or failed&lt;/li&gt;
&lt;li&gt;what the user asked for&lt;/li&gt;
&lt;li&gt;which constraints matter&lt;/li&gt;
&lt;li&gt;what remains unresolved&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That is the difference between “shorter prompt” and “runtime continuity.”&lt;/p&gt;

&lt;h2&gt;
  
  
  Why This Feature Matters
&lt;/h2&gt;

&lt;p&gt;AIClaw is opinionated about execution state. It already treats plan state, generated files, execution steps, memory, and conversation history as first-class runtime data. Context compression fits the same design philosophy.&lt;/p&gt;

&lt;p&gt;The goal is not to make the transcript prettier. The goal is to keep an agent useful after a long stretch of real work.&lt;/p&gt;

&lt;p&gt;If you are building agents that mostly answer in one turn, this feature is easy to ignore. If you are building agents that browse, edit, run commands, and recover from failure across many rounds, it becomes part of the reliability story.&lt;/p&gt;

&lt;p&gt;AIClaw keeps that logic in the runtime rather than pushing the entire burden onto prompt engineering.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where To Look In The Code
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;internal/agent/context_compressor.go&lt;/code&gt;: compression thresholds, protected windows, summary prompt, iterative summary logic&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;internal/agent/run.go&lt;/code&gt;: where compression is triggered in the execution loop&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;internal/agent/context_compressor_test.go&lt;/code&gt;: tests for summary injection, iterative updates, tool-group preservation, and duplicate-note prevention&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;README.md&lt;/code&gt;: product-level runtime compression description&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;AIClaw is open source, self-hosted, and built for agents that do more than chat. Context compression is one of the small runtime details that makes that practical over longer sessions.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>opensource</category>
      <category>agents</category>
      <category>llm</category>
    </item>
    <item>
      <title>How AIClaw Splits Main and Fast Models for Sub-Agent Work</title>
      <dc:creator>chowyu</dc:creator>
      <pubDate>Thu, 18 Jun 2026 11:04:09 +0000</pubDate>
      <link>https://dev.to/chowyu12/how-aiclaw-splits-main-and-fast-models-for-sub-agent-work-1g5j</link>
      <guid>https://dev.to/chowyu12/how-aiclaw-splits-main-and-fast-models-for-sub-agent-work-1g5j</guid>
      <description>&lt;p&gt;AIClaw is not just a chat wrapper around one model. In the current repository, it lets you configure multiple providers, choose a primary model per agent, and optionally assign a separate fast model for lightweight sub-agent work.&lt;/p&gt;

&lt;p&gt;That matters because real agent runs are uneven. Some steps need a stronger model for planning or synthesis. Other steps are small delegated tasks: inspect a few files, try a shell command, summarize one branch of research, or explore a URL. Running every delegated step on the same expensive model is the simple design, but usually not the practical one.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Problem
&lt;/h2&gt;

&lt;p&gt;When an agent can call &lt;code&gt;sub_agent&lt;/code&gt;, the main task and the delegated task often have different cost and latency requirements.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The parent agent may need the best reasoning model you have.&lt;/li&gt;
&lt;li&gt;The child task may only need a cheaper and faster model.&lt;/li&gt;
&lt;li&gt;You still want both to stay inside the same agent definition and provider setup.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;AIClaw addresses that by separating:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the primary model used by the agent, and&lt;/li&gt;
&lt;li&gt;an optional fast model reserved for lightweight sub-agent execution.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The repository states this directly in the README:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Each provider can define its base URL, API key, and model list. Agents choose a provider model and can optionally define a fast model for lightweight sub-agent tasks.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  How The Provider Layer Is Structured
&lt;/h2&gt;

&lt;p&gt;In the current codebase, AIClaw supports multiple provider types, including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;OpenAI&lt;/li&gt;
&lt;li&gt;OpenAI-compatible APIs&lt;/li&gt;
&lt;li&gt;Qwen&lt;/li&gt;
&lt;li&gt;Kimi / Moonshot&lt;/li&gt;
&lt;li&gt;OpenRouter&lt;/li&gt;
&lt;li&gt;Claude&lt;/li&gt;
&lt;li&gt;Gemini&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Those provider definitions live in the backend model layer, and each provider stores:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;a name&lt;/li&gt;
&lt;li&gt;a provider type&lt;/li&gt;
&lt;li&gt;a base URL&lt;/li&gt;
&lt;li&gt;an API key&lt;/li&gt;
&lt;li&gt;a model list&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is not a hardcoded single-vendor path. It is meant to let one deployment route different agents through different model backends while preserving a unified agent workflow.&lt;/p&gt;

&lt;h2&gt;
  
  
  What The Web Console Exposes
&lt;/h2&gt;

&lt;p&gt;The admin console has a dedicated Providers page for managing model backends, and the Agent form consumes those provider definitions.&lt;/p&gt;

&lt;p&gt;Two parts of the UI are especially useful here:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The Providers page can fetch remote model lists from the configured provider endpoint.&lt;/li&gt;
&lt;li&gt;The Agent form lets you choose both a primary model and an optional fast model from the same provider.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The current provider UI merges remote and local model lists, and the agent editor exposes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;主模型&lt;/code&gt; / main model&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;快速模型&lt;/code&gt; / fast model&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The tooltip for the fast model is explicit: it is the lightweight model used when a sub-agent is invoked with &lt;code&gt;model=fast&lt;/code&gt;, and if left empty it falls back to the main model.&lt;/p&gt;

&lt;h2&gt;
  
  
  How The Runtime Uses The Fast Model
&lt;/h2&gt;

&lt;p&gt;The interesting part is that this is not only a configuration field. The runtime actually switches models during delegated execution.&lt;/p&gt;

&lt;p&gt;In &lt;code&gt;internal/agent/subagent.go&lt;/code&gt;, AIClaw checks the sub-agent model hint before running the delegated task:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;modelHint&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s"&gt;"fast"&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;ec&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ag&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;FastModelName&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="s"&gt;""&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;ec&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ag&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ModelName&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ec&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ag&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;FastModelName&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So the parent agent can keep its primary model, while the child execution swaps to the fast model only for that delegated run.&lt;/p&gt;

&lt;p&gt;That keeps the behavior predictable:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;no extra provider objects are needed just to optimize sub-agent cost&lt;/li&gt;
&lt;li&gt;the parent and child stay within the same agent configuration&lt;/li&gt;
&lt;li&gt;the optimization is explicit instead of hidden behind heuristics&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why This Design Is Practical
&lt;/h2&gt;

&lt;p&gt;This design works well for common agent patterns:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Deep reasoning in the parent, fast exploration in children&lt;/li&gt;
&lt;li&gt;Expensive final synthesis, cheap parallel research branches&lt;/li&gt;
&lt;li&gt;One provider account, multiple model tiers&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Set the main model to &lt;code&gt;gpt-4.1&lt;/code&gt;, &lt;code&gt;claude-sonnet&lt;/code&gt;, or another stronger general model.&lt;/li&gt;
&lt;li&gt;Set the fast model to something like &lt;code&gt;gpt-4o-mini&lt;/code&gt; or another lower-latency option from the same provider.&lt;/li&gt;
&lt;li&gt;Let delegated &lt;code&gt;sub_agent&lt;/code&gt; tasks use &lt;code&gt;model=fast&lt;/code&gt; when they are mostly collecting facts or doing narrow execution.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That gives you a more controllable tradeoff than “always use the big model” or “force every agent to be cheap.”&lt;/p&gt;

&lt;h2&gt;
  
  
  Why I Picked This Feature
&lt;/h2&gt;

&lt;p&gt;Today’s article is not based on a brand-new release commit. Instead, it is a deeper look at an existing AIClaw capability that is already concrete in the repository and easy to miss if you only skim the README.&lt;/p&gt;

&lt;p&gt;Recent drafts already covered runtime plan state, execution logs, skills, and channel session continuity. This provider-and-fast-model path is a different product surface and a useful one if you are designing multi-step agents that need cost control without losing structure.&lt;/p&gt;

&lt;h2&gt;
  
  
  Practical Workflow In AIClaw
&lt;/h2&gt;

&lt;p&gt;A clean setup looks like this:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Add a provider in the Providers page with base URL, API key, and model list.&lt;/li&gt;
&lt;li&gt;Fetch remote models from that provider when available.&lt;/li&gt;
&lt;li&gt;Create or edit an agent.&lt;/li&gt;
&lt;li&gt;Pick the main model for the parent task.&lt;/li&gt;
&lt;li&gt;Optionally pick a fast model for lightweight sub-agent tasks.&lt;/li&gt;
&lt;li&gt;Let the agent delegate narrow work through &lt;code&gt;sub_agent&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Because AIClaw keeps sub-agent traces visible in the parent timeline, this remains observable instead of becoming a black box.&lt;/p&gt;

&lt;h2&gt;
  
  
  Closing
&lt;/h2&gt;

&lt;p&gt;Many agent products talk about orchestration, but the useful details are usually in the runtime tradeoffs. AIClaw’s provider setup plus fast-model override is a good example of a small design choice that improves real-world agent operation: better latency and cost control without splitting your workflow across multiple disconnected agents.&lt;/p&gt;

&lt;p&gt;If you are building with AIClaw, this is one of the settings worth using early instead of treating every subtask like it deserves your heaviest model.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>opensource</category>
      <category>webdev</category>
      <category>agents</category>
    </item>
    <item>
      <title>How AIClaw Keeps Messaging-Channel Chats Stateful with `/new` and `/continue`</title>
      <dc:creator>chowyu</dc:creator>
      <pubDate>Wed, 17 Jun 2026 11:54:21 +0000</pubDate>
      <link>https://dev.to/chowyu12/how-aiclaw-keeps-messaging-channel-chats-stateful-with-new-and-continue-5gfc</link>
      <guid>https://dev.to/chowyu12/how-aiclaw-keeps-messaging-channel-chats-stateful-with-new-and-continue-5gfc</guid>
      <description>&lt;p&gt;External chat channels are convenient for AI agents, but they create a session problem fast.&lt;/p&gt;

&lt;p&gt;In a web UI, users can see a sidebar of conversations and click back into old work. In WeCom, Feishu, Telegram, or WhatsApp, that structure usually does not exist. You get a thread, a sender, and a stream of incoming messages. If the agent cannot map that external thread back to an internal conversation reliably, the result is either context loss or messy session sprawl.&lt;/p&gt;

&lt;p&gt;AIClaw solves that with a channel bridge that does more than relay messages. It binds external thread keys to internal conversation UUIDs, keeps archive-backed history available, and exposes a few small slash commands that let users control session continuity from inside the channel itself.&lt;/p&gt;

&lt;h2&gt;
  
  
  The practical problem
&lt;/h2&gt;

&lt;p&gt;A channel integration usually has three jobs:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;accept inbound messages from an external system&lt;/li&gt;
&lt;li&gt;route them to the right agent&lt;/li&gt;
&lt;li&gt;send the reply back to the same place&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That is enough for basic request/response behavior, but not enough for long-running agent work.&lt;/p&gt;

&lt;p&gt;Real usage needs session control:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;start a fresh conversation without deleting the old one&lt;/li&gt;
&lt;li&gt;continue an earlier conversation from inside the channel&lt;/li&gt;
&lt;li&gt;keep one external thread attached to one internal conversation&lt;/li&gt;
&lt;li&gt;avoid duplicate conversations when the first inbound messages arrive concurrently&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;AIClaw handles those cases in its channel runtime instead of pushing the problem into prompts.&lt;/p&gt;

&lt;h2&gt;
  
  
  The core design: thread binding
&lt;/h2&gt;

&lt;p&gt;When a channel message arrives, AIClaw derives one or more lookup keys from the inbound event. That can include the native thread key, alias keys, or the sender ID as a fallback.&lt;/p&gt;

&lt;p&gt;Those keys are stored in a &lt;code&gt;channel_threads&lt;/code&gt; mapping table that links:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;channel_id&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;thread_key&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;conversation_uuid&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If a mapping already exists, AIClaw reuses the conversation. If not, it creates a new conversation and binds every relevant lookup key to it.&lt;/p&gt;

&lt;p&gt;That sounds simple, but it matters a lot operationally:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the same external thread stays attached to the same internal conversation&lt;/li&gt;
&lt;li&gt;aliases can converge onto the same conversation&lt;/li&gt;
&lt;li&gt;channel messages become inspectable in the normal AIClaw conversation model&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There is also a concurrency guard. AIClaw uses a singleflight gate for the same &lt;code&gt;(channel, thread)&lt;/code&gt; key set so that concurrent first messages do not create duplicate conversations or duplicate bindings.&lt;/p&gt;

&lt;h2&gt;
  
  
  Slash commands that work inside the channel
&lt;/h2&gt;

&lt;p&gt;The interesting part is that AIClaw does not make users jump back to the admin panel just to manage sessions.&lt;/p&gt;

&lt;p&gt;It intercepts a few slash commands before the LLM call:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;/new&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/reset&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/continue&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/continue N&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/archives&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/help&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That gives channel users lightweight session control with no extra UI.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;/new&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;/new&lt;/code&gt; creates a fresh conversation for the current channel thread.&lt;/p&gt;

&lt;p&gt;If the thread was already bound to an older conversation, AIClaw removes that binding, creates a new conversation record, and rebinds the current thread keys to the new conversation. The older conversation is not deleted. It can still be recovered later.&lt;/p&gt;

&lt;p&gt;This is the right behavior for channel-based agent usage because “start over” should not destroy prior work.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;/continue&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;/continue&lt;/code&gt; lists recent archived conversations for the same agent and channel user. The archive list is scoped by user identity, so one person does not accidentally browse another person’s channel history.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;/continue N&lt;/code&gt; switches the current thread binding to the selected archived conversation. After that, the next message in the same external thread continues that older context directly.&lt;/p&gt;

&lt;p&gt;This is the part I like most: AIClaw turns a plain messaging thread into a recoverable working session without inventing a separate UI surface.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why archives matter here
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;/continue&lt;/code&gt; workflow depends on session archives instead of raw database rows alone.&lt;/p&gt;

&lt;p&gt;AIClaw periodically regenerates a Markdown archive for a conversation after enough messages accumulate. The archive is generated without another model call and summarizes things such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;user goals&lt;/li&gt;
&lt;li&gt;tool usage counts&lt;/li&gt;
&lt;li&gt;recent assistant decisions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Those archive files live under the agent workspace and are sorted by update time when AIClaw builds the &lt;code&gt;/continue&lt;/code&gt; list.&lt;/p&gt;

&lt;p&gt;That design gives channel users a workable “recent sessions” experience while keeping the implementation cheap and inspectable.&lt;/p&gt;

&lt;h2&gt;
  
  
  A realistic channel workflow
&lt;/h2&gt;

&lt;p&gt;Here is a simple example:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;A WeCom user starts a deployment investigation in one channel thread.&lt;/li&gt;
&lt;li&gt;AIClaw binds that thread to a conversation and keeps all later messages in the same context.&lt;/li&gt;
&lt;li&gt;After the task is done, the user sends &lt;code&gt;/new&lt;/code&gt; to start a clean debugging session without mixing contexts.&lt;/li&gt;
&lt;li&gt;A day later, the user wants the original deployment investigation back.&lt;/li&gt;
&lt;li&gt;They send &lt;code&gt;/continue&lt;/code&gt;, pick the archived session number, and the same thread is rebound to that old conversation.&lt;/li&gt;
&lt;li&gt;The next message continues from the earlier session rather than starting cold.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That is a small feature on paper, but it removes a lot of friction from channel-native agent usage.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why I think this design is good
&lt;/h2&gt;

&lt;p&gt;There are a few design choices worth calling out:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;session control is implemented in the runtime, not hidden in prompts&lt;/li&gt;
&lt;li&gt;channel threads map onto first-class conversation records&lt;/li&gt;
&lt;li&gt;archives are cheap to generate and easy to inspect&lt;/li&gt;
&lt;li&gt;user-facing commands are small, memorable, and channel-friendly&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Most importantly, the system acknowledges that messaging channels are not just notification sinks. For many teams, they are the primary operating surface.&lt;/p&gt;

&lt;p&gt;If an agent platform wants to work there, it needs explicit session semantics, not only transport adapters.&lt;/p&gt;

&lt;p&gt;AIClaw’s channel bridge takes that seriously.&lt;/p&gt;




&lt;p&gt;AIClaw is an open-source, self-hosted AI agent platform written in Go with a Vue admin console. It supports built-in tools, custom tools, MCP servers, multi-provider models, runtime planning, sub-agents, persistent memory, execution logs, and messaging-channel integrations in one deployable binary.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>opensource</category>
      <category>webdev</category>
      <category>agents</category>
    </item>
    <item>
      <title>How AIClaw Keeps Skills Small in Context but Ready at Runtime</title>
      <dc:creator>chowyu</dc:creator>
      <pubDate>Mon, 15 Jun 2026 11:54:22 +0000</pubDate>
      <link>https://dev.to/chowyu12/how-aiclaw-keeps-skills-small-in-context-but-ready-at-runtime-4nai</link>
      <guid>https://dev.to/chowyu12/how-aiclaw-keeps-skills-small-in-context-but-ready-at-runtime-4nai</guid>
      <description>&lt;p&gt;AIClaw has a lot of moving parts: tools, MCP servers, memory, planning, channels, and reusable Skills. One practical problem shows up quickly when you install many Skills: if every Skill is injected into every prompt in full, context usage grows for no real benefit.&lt;/p&gt;

&lt;p&gt;This article is about an existing AIClaw feature, not a new release. The current codebase already uses a two-stage Skill design that keeps prompts smaller while still letting an agent pull in full instructions when they are actually needed.&lt;/p&gt;

&lt;h2&gt;
  
  
  The problem
&lt;/h2&gt;

&lt;p&gt;In many agent systems, reusable instructions become expensive over time.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You want a library of focused Skills.&lt;/li&gt;
&lt;li&gt;You do not want every conversation to pay the token cost for all of them.&lt;/li&gt;
&lt;li&gt;You still need the agent to discover what is available and decide when to load more detail.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;AIClaw solves that by separating Skill discovery from full Skill loading.&lt;/p&gt;

&lt;h2&gt;
  
  
  Stage 1: inject the Skill index
&lt;/h2&gt;

&lt;p&gt;The README describes the core idea directly: AIClaw first injects Skill names, descriptions, and paths. That gives the model a compact catalog of what exists without forcing the full &lt;code&gt;SKILL.md&lt;/code&gt; content into every request.&lt;/p&gt;

&lt;p&gt;In practice, this means an agent can see:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the Skill name&lt;/li&gt;
&lt;li&gt;a short description&lt;/li&gt;
&lt;li&gt;where the Skill lives&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That is enough for planning. If the agent decides a Skill is relevant, it can then read the full instructions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Stage 2: read full instructions only when needed
&lt;/h2&gt;

&lt;p&gt;The second stage is demand loading. Instead of paying prompt cost up front, AIClaw lets the model fetch the detailed Skill content only when the current task justifies it.&lt;/p&gt;

&lt;p&gt;This matters for real usage:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;large Skill libraries stay manageable&lt;/li&gt;
&lt;li&gt;generic chats stay lightweight&lt;/li&gt;
&lt;li&gt;specialized tasks can still pull in deep instructions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The result is a better tradeoff between capability discovery and prompt size.&lt;/p&gt;

&lt;h2&gt;
  
  
  Built-in, local, and pending Skills
&lt;/h2&gt;

&lt;p&gt;AIClaw does not treat all Skills the same. The current app exposes three practical states.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Built-in Skills
&lt;/h3&gt;

&lt;p&gt;Built-in Skills ship with the application. On startup, AIClaw syncs embedded builtin &lt;code&gt;SKILL.md&lt;/code&gt; files to the workspace Skills directory, so the runtime has a consistent on-disk view.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Local Skills
&lt;/h3&gt;

&lt;p&gt;Local Skills live under the workspace &lt;code&gt;skills/&lt;/code&gt; directory. The admin UI lists them separately, including metadata such as directory name, version, author, and whether the Skill has an executable entry file.&lt;/p&gt;

&lt;p&gt;That makes Skills more than prompt snippets. They can also behave like reusable tool bundles.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Pending Skill candidates
&lt;/h3&gt;

&lt;p&gt;This is the part I like most in the current implementation.&lt;/p&gt;

&lt;p&gt;The Skills page explains that successful multi-tool Agent runs using three or more distinct tools can archive a candidate into &lt;code&gt;skills-pending/&lt;/code&gt;. From there, a user can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;preview the candidate&lt;/li&gt;
&lt;li&gt;promote it into an active Skill&lt;/li&gt;
&lt;li&gt;discard it&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This turns useful ad hoc agent behavior into a reviewable workflow instead of silently mutating the prompt library.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why the promotion step matters
&lt;/h2&gt;

&lt;p&gt;Auto-generated Skills are powerful, but automatic activation would be noisy and risky. AIClaw keeps a human checkpoint in the middle.&lt;/p&gt;

&lt;p&gt;The promotion flow in the current handlers and UI requires:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;a final Skill name&lt;/li&gt;
&lt;li&gt;a description&lt;/li&gt;
&lt;li&gt;explicit promotion into the active Skills directory&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That gives teams a simple governance model:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;agents can suggest reusable workflows&lt;/li&gt;
&lt;li&gt;humans decide which ones become permanent assets&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  User workflow in practice
&lt;/h2&gt;

&lt;p&gt;Here is the practical loop the current product supports:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Install or create Skills in the workspace.&lt;/li&gt;
&lt;li&gt;Let agents see a compact Skill catalog during prompt construction.&lt;/li&gt;
&lt;li&gt;Allow the agent to read a full Skill only when the task needs it.&lt;/li&gt;
&lt;li&gt;Review pending Skill candidates created from successful multi-tool runs.&lt;/li&gt;
&lt;li&gt;Promote the useful ones into the active Skill library.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This design is small, but it changes how an agent system scales. Instead of treating every reusable instruction as permanent prompt baggage, AIClaw treats Skills like indexed assets with on-demand expansion.&lt;/p&gt;

&lt;h2&gt;
  
  
  A concrete example
&lt;/h2&gt;

&lt;p&gt;Imagine a team has Skills for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;deep research&lt;/li&gt;
&lt;li&gt;web scraping&lt;/li&gt;
&lt;li&gt;data cleanup&lt;/li&gt;
&lt;li&gt;browser automation&lt;/li&gt;
&lt;li&gt;report generation&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;With one-stage loading, every conversation drags all of that context around. With AIClaw's current two-stage approach, the agent only needs the index first. A simple file-editing task does not need the full research workflow. A browser-heavy task can load the browser Skill when it becomes relevant.&lt;/p&gt;

&lt;p&gt;That is a cleaner model for both cost and reasoning.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why this is a useful pattern beyond AIClaw
&lt;/h2&gt;

&lt;p&gt;The broader idea is simple: agent capability catalogs should be cheap to expose and expensive details should be loaded lazily.&lt;/p&gt;

&lt;p&gt;AIClaw applies that idea in a way that is easy to understand from the repo today:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;compact discovery&lt;/li&gt;
&lt;li&gt;explicit demand loading&lt;/li&gt;
&lt;li&gt;reviewable Skill promotion&lt;/li&gt;
&lt;li&gt;support for both instruction-only and executable Skills&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For self-hosted agent platforms, that is a pragmatic design choice. It keeps the system extensible without making every prompt bloated by default.&lt;/p&gt;

&lt;p&gt;If you are exploring AIClaw, the Skills page and the &lt;code&gt;skills/&lt;/code&gt; plus &lt;code&gt;skills-pending/&lt;/code&gt; workflow are worth a close look. They show how the project treats reusable agent behavior as something structured, inspectable, and incrementally promotable instead of just more text in the system prompt.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>opensource</category>
      <category>agents</category>
      <category>webdev</category>
    </item>
    <item>
      <title>AIClaw’s Execution Logs Just Got Easier To Read Across Languages</title>
      <dc:creator>chowyu</dc:creator>
      <pubDate>Sun, 14 Jun 2026 08:34:11 +0000</pubDate>
      <link>https://dev.to/chowyu12/aiclaws-execution-logs-just-got-easier-to-read-across-languages-ep6</link>
      <guid>https://dev.to/chowyu12/aiclaws-execution-logs-just-got-easier-to-read-across-languages-ep6</guid>
      <description>&lt;p&gt;AIClaw already had one of the more useful operational surfaces in a self-hosted agent runtime: execution steps are not hidden behind a raw trace file or an opaque debug mode. They are part of the product.&lt;/p&gt;

&lt;p&gt;The latest repository change, &lt;code&gt;fix: localize execution step labels&lt;/code&gt;, improves that surface in a practical way. The chat view and the execution log view now render more of the plan and step metadata through the shared i18n layer instead of hard-coded mixed-language labels.&lt;/p&gt;

&lt;p&gt;Project: &lt;a href="https://github.com/chowyu12/aiclaw" rel="noopener noreferrer"&gt;https://github.com/chowyu12/aiclaw&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Why this matters
&lt;/h2&gt;

&lt;p&gt;A lot of agent products can show you a final answer. Fewer are good at showing what happened between the prompt and the answer:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;which plan item was running;&lt;/li&gt;
&lt;li&gt;which tools were called;&lt;/li&gt;
&lt;li&gt;what input a tool received;&lt;/li&gt;
&lt;li&gt;what output came back;&lt;/li&gt;
&lt;li&gt;how long each step took;&lt;/li&gt;
&lt;li&gt;where channel-specific metadata came from.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;AIClaw has already been shipping that execution detail in both chat and the dedicated logs page. The new localization pass makes the same information more readable for operators switching between Chinese and English UI modes.&lt;/p&gt;

&lt;p&gt;That is not cosmetic in the trivial sense. If a product wants execution logs to be part of normal operations, the labels around those logs have to be consistent.&lt;/p&gt;

&lt;h2&gt;
  
  
  What changed in the current repo
&lt;/h2&gt;

&lt;p&gt;Today’s commit touches three frontend files:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;web/src/stores/i18n.ts&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;web/src/views/chat/Index.vue&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;web/src/views/log/Index.vue&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The concrete change is straightforward:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;move execution-step labels, plan labels, timing labels, file labels, and log-table labels into shared translation keys;&lt;/li&gt;
&lt;li&gt;remove hard-coded strings from the Chat page and Logs page;&lt;/li&gt;
&lt;li&gt;keep the execution-step structure the same while making the UI language-aware.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Examples of newly localized UI copy include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;execution step counts;&lt;/li&gt;
&lt;li&gt;total duration;&lt;/li&gt;
&lt;li&gt;child step counts;&lt;/li&gt;
&lt;li&gt;started / ended / duration timestamps;&lt;/li&gt;
&lt;li&gt;input / output / error section labels;&lt;/li&gt;
&lt;li&gt;channel labels;&lt;/li&gt;
&lt;li&gt;untitled conversation fallback text;&lt;/li&gt;
&lt;li&gt;execution log table headers and empty-state text.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So the feature story here is not “AIClaw added logs today.” The real story is that AIClaw’s existing execution-log workflow became easier to operate in multilingual environments.&lt;/p&gt;

&lt;h2&gt;
  
  
  The bigger design behind it
&lt;/h2&gt;

&lt;p&gt;This repository is opinionated about observability.&lt;/p&gt;

&lt;p&gt;From the current README:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;AIClaw persists conversations, execution steps, generated files, and plan state.&lt;/li&gt;
&lt;li&gt;The web console includes chat and execution logs.&lt;/li&gt;
&lt;li&gt;Tool output is visible through execution steps instead of disappearing into an internal harness.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That design shows up directly in the UI:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the final assistant message can carry a plan snapshot;&lt;/li&gt;
&lt;li&gt;execution steps can be expanded under a reply;&lt;/li&gt;
&lt;li&gt;tool-only intermediate rounds are hidden from the normal timeline to reduce noise;&lt;/li&gt;
&lt;li&gt;the detailed step trail still remains accessible under the final reply and in the dedicated logs view.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is a good operational choice.&lt;/p&gt;

&lt;p&gt;If every internal tool round is dumped directly into the visible conversation stream, the chat becomes hard to read. If those rounds are hidden completely, debugging becomes painful. AIClaw splits those concerns:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the conversation stays readable;&lt;/li&gt;
&lt;li&gt;the execution trail stays inspectable.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What you can actually inspect in AIClaw
&lt;/h2&gt;

&lt;p&gt;In the current product, execution steps can expose details such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;step type, such as LLM, Tool, Agent, or Skill;&lt;/li&gt;
&lt;li&gt;tool name, including special handling for &lt;code&gt;web_search&lt;/code&gt;;&lt;/li&gt;
&lt;li&gt;step status;&lt;/li&gt;
&lt;li&gt;duration;&lt;/li&gt;
&lt;li&gt;input;&lt;/li&gt;
&lt;li&gt;output;&lt;/li&gt;
&lt;li&gt;error text;&lt;/li&gt;
&lt;li&gt;provider and model metadata;&lt;/li&gt;
&lt;li&gt;channel metadata;&lt;/li&gt;
&lt;li&gt;nested sub-agent depth and child steps.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That means the logs are useful for more than debugging crashes. They help answer normal operating questions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Why did this answer take 18 seconds?&lt;/li&gt;
&lt;li&gt;Did the agent use external web search or a normal tool?&lt;/li&gt;
&lt;li&gt;Which sub-agent branch produced the result?&lt;/li&gt;
&lt;li&gt;Was the failure in the LLM call, the tool call, or the surrounding workflow?&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why I picked this topic for today
&lt;/h2&gt;

&lt;p&gt;There is a concrete new commit behind it, but it also points to a broader product surface that deserves a deeper article: AIClaw treats execution logs as a first-class UX, not as an afterthought.&lt;/p&gt;

&lt;p&gt;Recent AIClaw writeups already covered configurable web search, the built-in scheduler, generated file attachments, and Runtime Plan State. Today’s change is a good reason to focus on another core surface in that rotation: tool execution logs and operator-facing observability.&lt;/p&gt;

&lt;h2&gt;
  
  
  A practical example
&lt;/h2&gt;

&lt;p&gt;Imagine an agent that:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;receives a prompt from web chat or a messaging channel;&lt;/li&gt;
&lt;li&gt;creates a small runtime plan;&lt;/li&gt;
&lt;li&gt;calls &lt;code&gt;web_search&lt;/code&gt;;&lt;/li&gt;
&lt;li&gt;delegates a verification task to a &lt;code&gt;sub_agent&lt;/code&gt;;&lt;/li&gt;
&lt;li&gt;returns a final answer with attached artifacts.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In AIClaw, the operator can inspect that run without reading backend code:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the plan panel shows which item ran and which item failed or completed;&lt;/li&gt;
&lt;li&gt;the execution steps show tool inputs and outputs;&lt;/li&gt;
&lt;li&gt;the logs page lets you inspect the same conversation later;&lt;/li&gt;
&lt;li&gt;language-aware labels reduce friction for multilingual teams.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That is the kind of product detail that determines whether an agent system is usable in real operations.&lt;/p&gt;

&lt;h2&gt;
  
  
  The takeaway
&lt;/h2&gt;

&lt;p&gt;The newest AIClaw commit is small in scope, but it improves an important part of the platform: the execution-log interface that operators actually use when they need to understand agent behavior.&lt;/p&gt;

&lt;p&gt;If you care about self-hosted agents, the interesting thing is not just that AIClaw can run tools. It is that AIClaw keeps those tool runs visible, structured, and now more consistently localized across the main inspection surfaces.&lt;/p&gt;

&lt;p&gt;Install or update:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-fsSL&lt;/span&gt; https://raw.githubusercontent.com/chowyu12/aiclaw/master/install.sh | bash
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;GitHub: &lt;a href="https://github.com/chowyu12/aiclaw" rel="noopener noreferrer"&gt;https://github.com/chowyu12/aiclaw&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>opensource</category>
      <category>webdev</category>
      <category>agents</category>
    </item>
    <item>
      <title>How AIClaw Keeps Agent Plans Out of Chat History with Runtime Plan State</title>
      <dc:creator>chowyu</dc:creator>
      <pubDate>Sat, 13 Jun 2026 16:35:21 +0000</pubDate>
      <link>https://dev.to/chowyu12/how-aiclaw-keeps-agent-plans-out-of-chat-history-with-runtime-plan-state-ib5</link>
      <guid>https://dev.to/chowyu12/how-aiclaw-keeps-agent-plans-out-of-chat-history-with-runtime-plan-state-ib5</guid>
      <description>&lt;p&gt;Most agent products eventually hit the same UX problem: complex tasks need planning, but users do not want the final answer buried under noisy TODO updates.&lt;/p&gt;

&lt;p&gt;AIClaw handles that with an existing core feature called &lt;strong&gt;Runtime Plan State&lt;/strong&gt;. Instead of storing planning as ordinary assistant text, AIClaw treats the plan as runtime state owned by the executor. The model can propose or revise a plan, but the harness validates it, persists it, streams it live, and links the final snapshot to the assistant message after execution finishes.&lt;/p&gt;

&lt;p&gt;This post is not announcing a brand-new feature. It is a deeper look at how AIClaw already implements planning in a way that stays useful during execution without polluting the conversation itself.&lt;/p&gt;

&lt;h2&gt;
  
  
  The problem with chat-visible plans
&lt;/h2&gt;

&lt;p&gt;If an agent writes plans directly into chat, several issues show up quickly:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;progress updates become part of the permanent conversational transcript&lt;/li&gt;
&lt;li&gt;repeated plan rewrites waste tokens and distract from the real answer&lt;/li&gt;
&lt;li&gt;tool errors and retries are hard to map back to the current step&lt;/li&gt;
&lt;li&gt;users can see planning noise, but still cannot reliably inspect execution state&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;AIClaw's approach is to separate these concerns:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the user sees the final answer as an answer&lt;/li&gt;
&lt;li&gt;the executor keeps the plan as structured runtime state&lt;/li&gt;
&lt;li&gt;the log timeline shows both plan progress and tool activity&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The repository README describes this directly: AIClaw uses Plan State instead of chat-visible TODO blocks, and streaming chat plus execution logs show the plan separately from the assistant answer.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Runtime Plan State means in AIClaw
&lt;/h2&gt;

&lt;p&gt;At a high level, AIClaw's execution loop does this:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Load the agent, tools, memory, files, and conversation history.&lt;/li&gt;
&lt;li&gt;Inject compact runtime context, including the current plan state.&lt;/li&gt;
&lt;li&gt;Call the model with tools.&lt;/li&gt;
&lt;li&gt;Execute tool calls and track progress.&lt;/li&gt;
&lt;li&gt;Let the harness advance the plan after success or failure.&lt;/li&gt;
&lt;li&gt;Save the final assistant response and the plan snapshot.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The plan has a small lifecycle instead of being treated like free-form prose:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pending -&amp;gt; running -&amp;gt; completed
                  -&amp;gt; failed
                  -&amp;gt; blocked
pending -&amp;gt; skipped
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That lifecycle matters because the harness can enforce behavior the model should not be trusted to enforce by itself.&lt;/p&gt;

&lt;h2&gt;
  
  
  The design choice: model proposes, harness owns
&lt;/h2&gt;

&lt;p&gt;In &lt;a href="///Users/yu/go/src/github.com/chowyu12/aiclaw/internal/agent/plan.go"&gt;&lt;code&gt;internal/agent/plan.go&lt;/code&gt;&lt;/a&gt;, the internal &lt;code&gt;plan&lt;/code&gt; control tool supports actions such as &lt;code&gt;set&lt;/code&gt;, &lt;code&gt;update&lt;/code&gt;, &lt;code&gt;revise&lt;/code&gt;, and &lt;code&gt;read&lt;/code&gt;. But the important part is not the tool surface. The important part is ownership:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the model proposes plan changes&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;PlanManager&lt;/code&gt; normalizes and validates state&lt;/li&gt;
&lt;li&gt;the store persists the active run and items&lt;/li&gt;
&lt;li&gt;the executor refreshes the compact plan block before each LLM round&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That split keeps the model flexible without giving it full control over task state.&lt;/p&gt;

&lt;p&gt;For example, AIClaw enforces that only one plan item can be &lt;code&gt;running&lt;/code&gt; at a time. The tests in &lt;a href="///Users/yu/go/src/github.com/chowyu12/aiclaw/internal/agent/plan_test.go"&gt;&lt;code&gt;internal/agent/plan_test.go&lt;/code&gt;&lt;/a&gt; explicitly verify that if multiple items are proposed as &lt;code&gt;running&lt;/code&gt;, the plan is normalized back to a single running item.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why the prompt stays compact
&lt;/h2&gt;

&lt;p&gt;One subtle but important implementation detail is that AIClaw does &lt;strong&gt;not&lt;/strong&gt; inject the full plan history into every model call.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;PromptBlock&lt;/code&gt; path in &lt;a href="///Users/yu/go/src/github.com/chowyu12/aiclaw/internal/agent/plan.go"&gt;&lt;code&gt;internal/agent/plan.go&lt;/code&gt;&lt;/a&gt; builds a compact &lt;code&gt;&amp;lt;plan_state&amp;gt;&lt;/code&gt; block with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the goal&lt;/li&gt;
&lt;li&gt;the current running step&lt;/li&gt;
&lt;li&gt;a short pending-step summary&lt;/li&gt;
&lt;li&gt;the latest revision reason&lt;/li&gt;
&lt;li&gt;numeric progress&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The design notes in &lt;a href="///Users/yu/go/src/github.com/chowyu12/aiclaw/docs/design/agent-improvements.md"&gt;&lt;code&gt;docs/design/agent-improvements.md&lt;/code&gt;&lt;/a&gt; call this out clearly: only the goal, current running item, remaining pending summary, and recent revision reason are injected each round so the full history does not consume context budget.&lt;/p&gt;

&lt;p&gt;This is a practical design choice. Planning helps the model stay oriented, but dumping the whole plan transcript back into the prompt every round would work against that goal.&lt;/p&gt;

&lt;h2&gt;
  
  
  How execution advances the plan
&lt;/h2&gt;

&lt;p&gt;The main run loop in &lt;a href="///Users/yu/go/src/github.com/chowyu12/aiclaw/internal/agent/run.go"&gt;&lt;code&gt;internal/agent/run.go&lt;/code&gt;&lt;/a&gt; refreshes plan state before each model call. When tool or LLM work fails, the harness can mark the current step as failed. When a step succeeds, the harness can complete it and advance to the next pending one.&lt;/p&gt;

&lt;p&gt;That behavior is also covered by tests:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;a failed running step advances the next pending step into &lt;code&gt;running&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;linking the final assistant message marks the last running step as completed&lt;/li&gt;
&lt;li&gt;failed plans stay failed when the final message is attached&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is the difference between "the model wrote a checklist" and "the system is actually operating a task state machine."&lt;/p&gt;

&lt;h2&gt;
  
  
  What the user sees
&lt;/h2&gt;

&lt;p&gt;From the product side, Runtime Plan State gives AIClaw a cleaner split between response and observability:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the final answer is not cluttered by plan chatter&lt;/li&gt;
&lt;li&gt;streaming progress can still expose the live plan&lt;/li&gt;
&lt;li&gt;execution logs keep the plan snapshot, assistant response, and tool timeline separate&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That matters for real tool-using agents. If an agent reads files, runs commands, searches the web, or delegates to sub-agents, users need to inspect progress and failures without turning the final answer into a debug trace.&lt;/p&gt;

&lt;h2&gt;
  
  
  A practical example
&lt;/h2&gt;

&lt;p&gt;Imagine an AIClaw agent is asked to:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;inspect a codebase&lt;/li&gt;
&lt;li&gt;find the cause of a failing behavior&lt;/li&gt;
&lt;li&gt;patch the code&lt;/li&gt;
&lt;li&gt;run tests&lt;/li&gt;
&lt;li&gt;summarize the result&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;With Runtime Plan State, the plan can exist as structured execution state while the tool timeline records the underlying work. If the test step fails, AIClaw can mark that step as failed and continue the state transition logic cleanly. If the work completes, the final answer can stay focused on outcome, not internal bookkeeping.&lt;/p&gt;

&lt;p&gt;That is a better fit for production-style agent work than chat-visible TODO spam.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why I think this is the right abstraction
&lt;/h2&gt;

&lt;p&gt;AIClaw's design makes a strong distinction:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;planning is operational state&lt;/li&gt;
&lt;li&gt;answers are user-facing output&lt;/li&gt;
&lt;li&gt;logs are for inspection&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Those should not all be the same thing.&lt;/p&gt;

&lt;p&gt;A lot of agent systems blur the line between them. AIClaw's Runtime Plan State is interesting precisely because it does not.&lt;/p&gt;

&lt;p&gt;If you are building self-hosted agents and want both cleaner chat UX and better execution observability, this is one of the AIClaw features worth studying in the codebase.&lt;/p&gt;

&lt;p&gt;AIClaw is open source here: &lt;a href="https://github.com/chowyu12/aiclaw" rel="noopener noreferrer"&gt;github.com/chowyu12/aiclaw&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>opensource</category>
      <category>webdev</category>
      <category>agents</category>
    </item>
    <item>
      <title>AIClaw's Generated File Attachments Keep Tool Output In The Chat Loop</title>
      <dc:creator>chowyu</dc:creator>
      <pubDate>Thu, 11 Jun 2026 16:35:26 +0000</pubDate>
      <link>https://dev.to/chowyu12/aiclaws-generated-file-attachments-keep-tool-output-in-the-chat-loop-4n7h</link>
      <guid>https://dev.to/chowyu12/aiclaws-generated-file-attachments-keep-tool-output-in-the-chat-loop-4n7h</guid>
      <description>&lt;p&gt;AIClaw is a self-hosted agent runtime, so "the answer" is often not the most useful output. In real workflows you usually want the file the agent created: a screenshot, a CSV, a Markdown report, a PDF, or some artifact produced by a tool run.&lt;/p&gt;

&lt;p&gt;AIClaw already persists conversations, execution steps, and files in the same runtime. What makes that useful is that generated files are not treated as an afterthought. They are attached to the conversation, returned from chat APIs, and rendered directly in the web chat UI.&lt;/p&gt;

&lt;p&gt;Project: &lt;a href="https://github.com/chowyu12/aiclaw" rel="noopener noreferrer"&gt;https://github.com/chowyu12/aiclaw&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The Problem
&lt;/h2&gt;

&lt;p&gt;Many agent demos stop at plain text:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;a tool writes a file somewhere under &lt;code&gt;/tmp&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;the model mentions that the file exists&lt;/li&gt;
&lt;li&gt;the user has to go find it manually&lt;/li&gt;
&lt;li&gt;the next turn may not reliably carry that artifact forward&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That breaks down fast once agents start using browser automation, code execution, shell commands, or document-style outputs.&lt;/p&gt;

&lt;p&gt;AIClaw's current design closes that gap in three places:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;request-time file loading for uploaded files and URL-based files&lt;/li&gt;
&lt;li&gt;tool-output persistence for files created during execution&lt;/li&gt;
&lt;li&gt;chat/UI attachment rendering for both user-provided and agent-generated artifacts&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How Files Enter The Runtime
&lt;/h2&gt;

&lt;p&gt;AIClaw's chat request model supports file references through &lt;code&gt;files&lt;/code&gt; on &lt;code&gt;ChatRequest&lt;/code&gt;, with two transfer modes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;local_file&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;remote_url&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;On the server side, &lt;code&gt;internal/agent/file.go&lt;/code&gt; loads those inputs into the execution context. Local uploads are resolved from persisted file records, and remote URLs can be fetched into temporary storage. Text and document types also get text extraction when possible, so the model can work with the content instead of only a file pointer.&lt;/p&gt;

&lt;p&gt;There is one design detail here that matters a lot in practice: AIClaw also loads prior conversation files with &lt;code&gt;ListFilesByConversation(...)&lt;/code&gt;, so files stay in the conversation context instead of disappearing after one turn.&lt;/p&gt;

&lt;p&gt;That makes attachments part of the working session, not just part of one HTTP request.&lt;/p&gt;

&lt;h2&gt;
  
  
  How Tool Output Becomes A Conversation Attachment
&lt;/h2&gt;

&lt;p&gt;The interesting part is what happens after a tool runs.&lt;/p&gt;

&lt;p&gt;In &lt;code&gt;internal/agent/tool_call.go&lt;/code&gt;, AIClaw wraps each tool call with file-aware persistence logic:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;it snapshots the sandbox directory before the tool runs&lt;/li&gt;
&lt;li&gt;it executes the tool&lt;/li&gt;
&lt;li&gt;it checks whether the tool returned a structured file result&lt;/li&gt;
&lt;li&gt;if not, it scans the sandbox for newly created files&lt;/li&gt;
&lt;li&gt;it persists those files into the uploads area and creates file records in storage&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That gives AIClaw two ways to capture artifacts:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Explicit file results&lt;/li&gt;
&lt;li&gt;New files detected from the sandbox after execution&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The sandbox scan intentionally skips script carrier files like &lt;code&gt;.py&lt;/code&gt;, &lt;code&gt;.js&lt;/code&gt;, &lt;code&gt;.sh&lt;/code&gt;, &lt;code&gt;.rb&lt;/code&gt;, and &lt;code&gt;.ts&lt;/code&gt;, so it focuses on outputs rather than execution scaffolding.&lt;/p&gt;

&lt;p&gt;This is a pragmatic design choice. It means tool authors do not always need a perfect custom return path for every artifact-producing workflow. If a tool or interpreter creates a real output file, AIClaw still has a chance to preserve it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why This Matters For Actual Agent Work
&lt;/h2&gt;

&lt;p&gt;This file flow is especially useful for tools that naturally produce artifacts:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;browser&lt;/code&gt; can produce screenshots&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;code_interpreter&lt;/code&gt; can generate plots, tables, and exported files&lt;/li&gt;
&lt;li&gt;shell-oriented tools can write reports or transformed datasets&lt;/li&gt;
&lt;li&gt;sub-agents can bubble their files back to the parent run&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;sub_agent&lt;/code&gt; output is also handled explicitly in the same tool-call path, so the parent conversation can inherit generated files from delegated work instead of losing them inside nested execution.&lt;/p&gt;

&lt;p&gt;That is the difference between "the agent said it did something" and "the result is now attached to the conversation and available to open."&lt;/p&gt;

&lt;h2&gt;
  
  
  API And Streaming Behavior
&lt;/h2&gt;

&lt;p&gt;The chat API returns files as first-class response data.&lt;/p&gt;

&lt;p&gt;In &lt;code&gt;internal/handler/chat.go&lt;/code&gt;, the non-streaming response includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;message&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;steps&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;files&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;plan&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The streaming shape in &lt;code&gt;model.StreamChunk&lt;/code&gt; also includes &lt;code&gt;files&lt;/code&gt;, so generated artifacts can be delivered as part of the same execution session rather than requiring a separate polling flow.&lt;/p&gt;

&lt;p&gt;This fits the rest of AIClaw's runtime model well:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;execution steps show what happened&lt;/li&gt;
&lt;li&gt;plan state shows task progress&lt;/li&gt;
&lt;li&gt;attachments carry the concrete output&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What The Chat UI Does With It
&lt;/h2&gt;

&lt;p&gt;The Vue chat page under &lt;code&gt;web/src/views/chat/Index.vue&lt;/code&gt; renders attachments directly inside the message bubble.&lt;/p&gt;

&lt;p&gt;Current behavior is straightforward and useful:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;images render as preview cards with thumbnails&lt;/li&gt;
&lt;li&gt;non-image files render as clickable file cards&lt;/li&gt;
&lt;li&gt;file type and size are shown in the UI&lt;/li&gt;
&lt;li&gt;user-side pending uploads and URL attachments are visible before send&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That matters because it keeps the artifact in the same visual flow as the model response and the execution timeline. You do not have to jump into another admin page just to confirm that a generated file exists.&lt;/p&gt;

&lt;h2&gt;
  
  
  A Practical Workflow
&lt;/h2&gt;

&lt;p&gt;Here is a realistic AIClaw flow using this design:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Upload a CSV to the conversation.&lt;/li&gt;
&lt;li&gt;Ask the agent to analyze it and generate a summary report plus a chart.&lt;/li&gt;
&lt;li&gt;Let a code-oriented tool write the chart image and report file.&lt;/li&gt;
&lt;li&gt;Receive the assistant answer, execution steps, and the generated attachments in the same conversation.&lt;/li&gt;
&lt;li&gt;Open the files directly from the chat UI or reuse them in the next turn.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The same pattern applies to browser screenshots, exported markdown notes, or files produced by a delegated sub-agent.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why I Like This Design
&lt;/h2&gt;

&lt;p&gt;What stands out in AIClaw's implementation is that attachments are part of the runtime contract, not a bolt-on download feature.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The executor loads files into context.&lt;/li&gt;
&lt;li&gt;The tool layer persists produced artifacts.&lt;/li&gt;
&lt;li&gt;The store keeps them associated with the conversation.&lt;/li&gt;
&lt;li&gt;The API returns them.&lt;/li&gt;
&lt;li&gt;The chat UI renders them.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That end-to-end path is what makes an agent platform usable for work that produces assets instead of only text.&lt;/p&gt;

&lt;p&gt;If you're building local-first or self-hosted agents, this is one of the surfaces worth getting right early. Text answers are cheap. Reliable artifact handling is what makes the system operational.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>opensource</category>
      <category>agents</category>
      <category>webdev</category>
    </item>
    <item>
      <title>AIClaw’s Built-In Scheduler: Run Agent Prompts and Shell Commands on Cron</title>
      <dc:creator>chowyu</dc:creator>
      <pubDate>Wed, 10 Jun 2026 16:36:00 +0000</pubDate>
      <link>https://dev.to/chowyu12/aiclaws-built-in-scheduler-run-agent-prompts-and-shell-commands-on-cron-136g</link>
      <guid>https://dev.to/chowyu12/aiclaws-built-in-scheduler-run-agent-prompts-and-shell-commands-on-cron-136g</guid>
      <description>&lt;p&gt;AI agents are useful when they can do work on demand. They become much more practical when they can also do that work on a schedule.&lt;/p&gt;

&lt;p&gt;AIClaw includes a built-in &lt;code&gt;cron&lt;/code&gt; tool and Scheduler page for exactly that. Instead of depending on system &lt;code&gt;crontab&lt;/code&gt; glue or an external workflow service, AIClaw runs scheduled jobs inside the same runtime that already knows about your agents, tools, workspace, and execution logs.&lt;/p&gt;

&lt;p&gt;Project: &lt;a href="https://github.com/chowyu12/aiclaw" rel="noopener noreferrer"&gt;https://github.com/chowyu12/aiclaw&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The problem with bolting cron onto agents
&lt;/h2&gt;

&lt;p&gt;A lot of agent setups can answer a prompt right now, but recurring work is usually handled outside the agent runtime:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;a system &lt;code&gt;crontab&lt;/code&gt; entry;&lt;/li&gt;
&lt;li&gt;a CI workflow;&lt;/li&gt;
&lt;li&gt;a separate automation server;&lt;/li&gt;
&lt;li&gt;or a custom script that calls the agent through another interface.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That works, but it breaks the operating model. The schedule lives in one place, the agent runtime lives in another, and the execution trail is often incomplete.&lt;/p&gt;

&lt;p&gt;AIClaw takes a different approach. The scheduler is part of the product runtime, so scheduled work can be created, persisted, executed, and inspected without leaving the platform.&lt;/p&gt;

&lt;h2&gt;
  
  
  What AIClaw actually ships
&lt;/h2&gt;

&lt;p&gt;From the current repository:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;AIClaw exposes a built-in &lt;code&gt;cron&lt;/code&gt; tool for agents.&lt;/li&gt;
&lt;li&gt;Jobs can be &lt;code&gt;prompt&lt;/code&gt; jobs or &lt;code&gt;command&lt;/code&gt; jobs.&lt;/li&gt;
&lt;li&gt;The scheduler runs in-process using &lt;code&gt;robfig/cron&lt;/code&gt; with seconds enabled.&lt;/li&gt;
&lt;li&gt;Jobs are persisted under &lt;code&gt;scheduler/jobs.json&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Per-job execution logs are appended as JSONL files under &lt;code&gt;scheduler/logs/{id}.jsonl&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Jobs support enable/disable control, run counts, and optional &lt;code&gt;max_runs&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;The web console includes a Scheduler page where you can inspect jobs and view recent logs.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is not “LLM asks cron to call a webhook later.” It is part of the same local runtime.&lt;/p&gt;

&lt;h2&gt;
  
  
  Two job types: agent prompt or shell command
&lt;/h2&gt;

&lt;p&gt;The built-in tool definition exposes two execution modes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;prompt&lt;/code&gt;: send a scheduled prompt back into an AIClaw agent;&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;command&lt;/code&gt;: execute a shell command.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That split matters in practice.&lt;/p&gt;

&lt;p&gt;Use &lt;code&gt;prompt&lt;/code&gt; when the recurring work should go through the full agent loop: prompt, tools, plan state, memory, files, and final response.&lt;/p&gt;

&lt;p&gt;Use &lt;code&gt;command&lt;/code&gt; when you already know the exact shell operation you want to run and do not need model reasoning for that step.&lt;/p&gt;

&lt;h2&gt;
  
  
  Cron syntax that is useful in real operations
&lt;/h2&gt;

&lt;p&gt;AIClaw’s scheduler accepts:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;6-field cron expressions with seconds;&lt;/li&gt;
&lt;li&gt;descriptors such as &lt;code&gt;@daily&lt;/code&gt; and &lt;code&gt;@hourly&lt;/code&gt;;&lt;/li&gt;
&lt;li&gt;interval expressions such as &lt;code&gt;@every 30m&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Examples from the tool definition:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;0 0 9 * * *      -&amp;gt; daily at 9:00 AM
0 */5 * * * *    -&amp;gt; every 5 minutes
@every 30m       -&amp;gt; every 30 minutes
@daily           -&amp;gt; once a day at midnight
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That makes it usable for both product-style reminders and more operational polling loops.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why the in-process design matters
&lt;/h2&gt;

&lt;p&gt;The key design choice is that scheduled jobs execute inside AIClaw itself.&lt;/p&gt;

&lt;p&gt;For &lt;code&gt;prompt&lt;/code&gt; jobs, the scheduler can call the agent executor directly. For &lt;code&gt;command&lt;/code&gt; jobs, it can run shell work directly. Because both paths stay inside the product runtime, AIClaw can keep a consistent operational surface:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;one place to define the work;&lt;/li&gt;
&lt;li&gt;one place to inspect the job;&lt;/li&gt;
&lt;li&gt;one place to review success or failure;&lt;/li&gt;
&lt;li&gt;one place to see output and error text.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The design doc in this repo explicitly calls out why this replaced a more traditional crontab-based approach: system cron is Unix-specific and cannot directly drive the agent execution engine.&lt;/p&gt;

&lt;h2&gt;
  
  
  Persistence and restart behavior
&lt;/h2&gt;

&lt;p&gt;This is one of the most practical parts of the implementation.&lt;/p&gt;

&lt;p&gt;When the scheduler starts, it loads persisted jobs from disk and re-schedules enabled entries. That means scheduled work survives process restarts instead of disappearing with the current session.&lt;/p&gt;

&lt;p&gt;The job record tracks fields such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;expression&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;type&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;agent_uuid&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;prompt&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;command&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;enabled&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;max_runs&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;run_count&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;last_run_at&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;next_run_at&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For recurring production use, this is much more useful than “fire and forget.”&lt;/p&gt;

&lt;h2&gt;
  
  
  Inspectable run logs instead of invisible background work
&lt;/h2&gt;

&lt;p&gt;Each execution produces a structured run record with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;run time;&lt;/li&gt;
&lt;li&gt;duration;&lt;/li&gt;
&lt;li&gt;status;&lt;/li&gt;
&lt;li&gt;output;&lt;/li&gt;
&lt;li&gt;error.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;AIClaw stores those records as JSONL and exposes them through the Scheduler UI and scheduler API routes. The web console can load recent logs for a job, reverse them for readability, and show output or failure text inline.&lt;/p&gt;

&lt;p&gt;That gives you a real audit trail for recurring work. If a daily prompt stopped doing what you expected, you can inspect the logs instead of guessing whether the scheduler even fired.&lt;/p&gt;

&lt;p&gt;There is also a small but important operational safeguard: per-job log files rotate after a size threshold instead of growing forever.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;code&gt;max_runs&lt;/code&gt; is a good fit for temporary automations
&lt;/h2&gt;

&lt;p&gt;Not every schedule should be permanent.&lt;/p&gt;

&lt;p&gt;AIClaw jobs can optionally define &lt;code&gt;max_runs&lt;/code&gt;. Once the run count reaches that limit, the job disables itself automatically.&lt;/p&gt;

&lt;p&gt;This is a strong fit for practical workflows like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;“run this migration check 10 times while we watch rollout health”;&lt;/li&gt;
&lt;li&gt;“summarize this project standup every workday for two weeks”;&lt;/li&gt;
&lt;li&gt;“poll a dependency update status until the cutover is done.”&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You do not need a second cleanup task to stop the first one.&lt;/p&gt;

&lt;h2&gt;
  
  
  How this fits the rest of AIClaw
&lt;/h2&gt;

&lt;p&gt;The scheduler makes more sense when you look at the rest of the product:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;AIClaw already has a tool runtime.&lt;/li&gt;
&lt;li&gt;It already has agents with configurable prompts and models.&lt;/li&gt;
&lt;li&gt;It already persists conversations, execution steps, generated files, memory, and plan state.&lt;/li&gt;
&lt;li&gt;It already has a web console for inspection.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So a built-in scheduler is not an unrelated extra. It extends the same operating model into recurring work.&lt;/p&gt;

&lt;h2&gt;
  
  
  Practical examples
&lt;/h2&gt;

&lt;p&gt;Here are a few concrete patterns this enables:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Daily research brief: schedule a &lt;code&gt;prompt&lt;/code&gt; job that asks an agent to gather updates and produce a short report.&lt;/li&gt;
&lt;li&gt;Workspace hygiene: schedule a &lt;code&gt;command&lt;/code&gt; job to collect disk usage, rotate artifacts, or run a repo maintenance command.&lt;/li&gt;
&lt;li&gt;Release watch: schedule a &lt;code&gt;prompt&lt;/code&gt; job that checks a dependency or upstream project and writes back a structured summary.&lt;/li&gt;
&lt;li&gt;Inbox triage or channel follow-up: schedule an agent workflow at fixed times instead of manually triggering it.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The important part is not just that these jobs run. It is that they run inside the same local-first system where the rest of the agent work already happens.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why I think this feature is worth highlighting
&lt;/h2&gt;

&lt;p&gt;Many AI agent demos stop at interactive chat. AIClaw treats agent execution more like an operating system concern: prompts, tools, plans, memory, files, logs, and now scheduled recurrence all belong to the same runtime.&lt;/p&gt;

&lt;p&gt;That makes the scheduler a meaningful feature even without a brand-new release attached to it. It shows how AIClaw is designed for repeatable work, not just one-off conversations.&lt;/p&gt;

&lt;p&gt;If you are building local-first agents and want recurring jobs without handing control to an external automation platform, this part of AIClaw is worth a look.&lt;/p&gt;

&lt;p&gt;Install or update:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-fsSL&lt;/span&gt; https://raw.githubusercontent.com/chowyu12/aiclaw/master/install.sh | bash
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;GitHub: &lt;a href="https://github.com/chowyu12/aiclaw" rel="noopener noreferrer"&gt;https://github.com/chowyu12/aiclaw&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>opensource</category>
      <category>webdev</category>
      <category>agents</category>
    </item>
  </channel>
</rss>
