<?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: Naresh</title>
    <description>The latest articles on DEV Community by Naresh (@nareshh74).</description>
    <link>https://dev.to/nareshh74</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%2F1100136%2F70d15da1-03f1-41ad-abd4-b9ab3fd3171a.jpeg</url>
      <title>DEV Community: Naresh</title>
      <link>https://dev.to/nareshh74</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/nareshh74"/>
    <language>en</language>
    <item>
      <title>How I cut AI agent skill context bloat under 4,000 tokens across my stack</title>
      <dc:creator>Naresh</dc:creator>
      <pubDate>Sat, 28 Nov 2026 03:14:11 +0000</pubDate>
      <link>https://dev.to/nareshh74/how-i-cut-ai-agent-skill-context-bloat-under-4000-tokens-across-my-stack-1f9d</link>
      <guid>https://dev.to/nareshh74/how-i-cut-ai-agent-skill-context-bloat-under-4000-tokens-across-my-stack-1f9d</guid>
      <description>&lt;p&gt;If you keep adding skills and &lt;code&gt;AGENTS.md&lt;/code&gt; rules to your AI coding setup, you eventually hit a quiet tax: your assistant burns thousands of tokens before you even type your first prompt. In my own setup, auto-loading a 97-skill growth pack ate roughly 3,950 startup tokens on one assistant, and an 89-skill trading pack ate roughly 3,680 tokens on another.&lt;/p&gt;

&lt;p&gt;Fixing that context bloat started with treating startup instructions like a menu instead of a full recipe book. Once that lightweight skill pattern worked across my 14 custom assistants, I rolled the same 20-skill library out to five external coding CLIs on my Windows ARM64 laptop, which triggered cross-tool hook leaks, a backup overwrite, and three Windows-specific snags that hit the exact same stack.&lt;/p&gt;

&lt;h2&gt;
  
  
  TL;DR
&lt;/h2&gt;

&lt;p&gt;On Windows ARM64 (Nov 2026), treating startup skills like a menu (short descriptions + &amp;lt;=8 pinned core skills) kept 14 custom Raven agents at 1,269 to 3,731 active skill tokens (638 to 666 for 6 shared skills). Scaling our 20-skill catalog across 5 external coding CLIs with separate hook files hit zero hook leakage across 23 configs.&lt;/p&gt;

&lt;h2&gt;
  
  
  AGENTS.md vs. on-demand skills: the menu and recipe book pattern
&lt;/h2&gt;

&lt;p&gt;Keep always-on instruction files (&lt;code&gt;AGENTS.md&lt;/code&gt;, &lt;code&gt;CLAUDE.md&lt;/code&gt;, &lt;code&gt;copilot-instructions.md&lt;/code&gt;) thin with global rules and one startup pointer, and store deep workflows in on-demand skill folders. That split resolves the trade-off highlighted by Vercel's agent evals: putting every rule upfront guarantees visibility in short demos but bloats context at scale, while unindexed skill folders save tokens but get skipped unless a startup pointer tells the model when to check them.&lt;/p&gt;

&lt;p&gt;The simplest mental model is the difference between a &lt;strong&gt;menu&lt;/strong&gt; and a &lt;strong&gt;recipe book&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;At startup, you hand the assistant a short menu: a thin startup pointer and a list of skill names with one-line descriptions. The full step-by-step recipes stay closed on the shelf until a task matches one of them.&lt;/p&gt;

&lt;p&gt;You do not need custom tooling to use this pattern today. In Claude Code (Anthropic's terminal coding agent), OpenAI Codex (OpenAI's CLI coding agent), or GitHub Copilot CLI, keep your global instruction file concise, cap always-active skills at roughly 7 or 8 core workflows per domain, and leave deep reference guides inside your skills folder to load on demand.&lt;/p&gt;

&lt;h2&gt;
  
  
  Measuring skill context savings across 14 custom Raven agents
&lt;/h2&gt;

&lt;p&gt;Switching oversized skills (over roughly 1,500 tokens) to description-only startup loading and pinning at most 8 core skills per bulk pack kept all 14 of my custom Raven specialist agents between 1,269 and 3,731 active skill tokens. Across all 14 specialists, the 6 shared behavioral skills (covering tone, verification, and careful patching) cost only 638 to 666 tokens per agent.&lt;/p&gt;

&lt;p&gt;For context, alongside my five public coding CLIs, I run Raven (EverMind AI's open-source local multi-agent orchestrator) with 14 specialized assistants for writing, research, testing, design, and code review. To keep the measurement scope honest: the token table below measures those &lt;strong&gt;14 custom Raven specialists&lt;/strong&gt;, where I control the local Python skill loader (&lt;code&gt;inject: description&lt;/code&gt; and a 20-skill startup cap are Raven registry features, not native flags in Claude Code or Codex). Per-CLI startup token totals for the five external coding tools were not tabulated in that same run.&lt;/p&gt;

&lt;p&gt;Before trimming, auto-loading every skill in a bulk pack pushed startup skill context close to 4,000 tokens before counting system prompts or code context. Pinning 7 to 8 core skills per pack and marking the rest on demand cut the two heaviest packs by 43% to 50%:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Custom Raven specialist&lt;/th&gt;
&lt;th&gt;Before trimming (approx.)&lt;/th&gt;
&lt;th&gt;After trimming (active skill tokens)&lt;/th&gt;
&lt;th&gt;Full system prompt tokens&lt;/th&gt;
&lt;th&gt;What changed&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Presentation (&lt;code&gt;raven-ppt&lt;/code&gt;, lowest)&lt;/td&gt;
&lt;td&gt;n/a&lt;/td&gt;
&lt;td&gt;1,269&lt;/td&gt;
&lt;td&gt;2,978&lt;/td&gt;
&lt;td&gt;Description-only slide skill + 6 shared skills&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Trading (&lt;code&gt;raven-trader&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;~3,680 (89 skills)&lt;/td&gt;
&lt;td&gt;1,857&lt;/td&gt;
&lt;td&gt;4,584&lt;/td&gt;
&lt;td&gt;8 core skills pinned, 81 moved on demand&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Growth &amp;amp; SEO (&lt;code&gt;raven-growth&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;~3,950 (97 skills)&lt;/td&gt;
&lt;td&gt;2,237&lt;/td&gt;
&lt;td&gt;5,068&lt;/td&gt;
&lt;td&gt;8 core skills pinned, 89 moved on demand&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Design (&lt;code&gt;raven-design&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;Full pack auto-loaded&lt;/td&gt;
&lt;td&gt;2,266&lt;/td&gt;
&lt;td&gt;4,415&lt;/td&gt;
&lt;td&gt;7 core skills pinned, design engine on demand&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Workspace (&lt;code&gt;raven-assistant&lt;/code&gt;, highest)&lt;/td&gt;
&lt;td&gt;n/a&lt;/td&gt;
&lt;td&gt;3,731&lt;/td&gt;
&lt;td&gt;6,359&lt;/td&gt;
&lt;td&gt;16 workspace skills + 6 shared skills&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;em&gt;Measured across all 14 custom Raven specialist agents on Windows ARM64 using &lt;code&gt;cl100k_base&lt;/code&gt; (Nov 23, 2026). All 14 specialists stayed under the 4,000-token active skills ceiling.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What broke when I rolled those skills out to 5 coding CLIs
&lt;/h2&gt;

&lt;p&gt;Once the menu-and-recipe pattern cut startup bloat across my 14 Raven assistants, I wanted the same lightweight 20-skill catalog available across the five external coding CLIs I use daily: Claude Code, OpenAI Codex, GitHub Copilot CLI, Hermes Agent (Nous Research's open-source coding agent), and DeepSeek DSH (DeepSeek's open-source terminal harness). Rolling shared skills and hooks out to five tools on one Windows laptop immediately exposed a second problem: shared configs quietly leak across harnesses.&lt;/p&gt;

&lt;p&gt;My first shortcut was pointing DeepSeek DSH (which supports Claude-style hooks) at &lt;code&gt;~/.claude/settings.json&lt;/code&gt; so I would not have to maintain two hook files. Immediately, every DSH tool call silently fired seven Claude-only optimization scripts from &lt;code&gt;token-optimizer-mcp&lt;/code&gt; (an MCP server for token savings) and logged DSH's work under &lt;code&gt;harness: "claude"&lt;/code&gt;. Around the same time, an overly broad Claude &lt;code&gt;PreToolUse&lt;/code&gt; rule started intercepting ordinary Windows terminal commands whenever paths mixed Windows and Unix formats.&lt;/p&gt;

&lt;p&gt;The fix was giving every tool its own instruction file, its own skill folder, and a dedicated hook file that never points at another tool's settings. Each harness now loads one dedicated startup pointer for its native skill suite across both CLI and Agent Client Protocol (ACP) sessions, keeps its own copy of the 20 shared workflow and coding skills, and runs only its own hooks.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fimnjdh2ixpavwdocuq7q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fimnjdh2ixpavwdocuq7q.png" alt="Architecture diagram showing 5 isolated coding agent harnesses (Claude Code, OpenAI Codex, GitHub Copilot, Hermes Agent, DeepSeek DSH) with dedicated hook files and a shared 20-skill catalog alongside 14 custom Raven specialist agents budgeted between 1,269 and 3,731 active skill tokens" width="800" height="420"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Harness&lt;/th&gt;
&lt;th&gt;Instruction file&lt;/th&gt;
&lt;th&gt;Startup skill pointer&lt;/th&gt;
&lt;th&gt;Hook isolation&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;GitHub Copilot CLI (&lt;code&gt;copilot&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;&lt;code&gt;~/.copilot/copilot-instructions.md&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Dedicated startup pointer for Superpowers (15 suite skills)&lt;/td&gt;
&lt;td&gt;Dedicated &lt;code&gt;~/.copilot/hooks/superpowers.json&lt;/code&gt; (&lt;code&gt;sessionStart&lt;/code&gt; injects 3,405 chars in CLI and ACP)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;OpenAI Codex (&lt;code&gt;codex&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;&lt;code&gt;~/.codex/AGENTS.md&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Dedicated startup pointer for Addy Osmani's &lt;code&gt;agent-skills&lt;/code&gt; (30 suite skills + 10 extras)&lt;/td&gt;
&lt;td&gt;Native &lt;code&gt;~/.codex/skills/&lt;/code&gt; in CLI and ACP; custom routing block kept outside driver markers&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Claude Code (&lt;code&gt;claude&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;~/.claude/CLAUDE.md&lt;/code&gt; + &lt;code&gt;~/.claude/rules/&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Dedicated startup pointer for Everything Claude Code / ECC (328 suite skills; 467 seen headless)&lt;/td&gt;
&lt;td&gt;Dedicated &lt;code&gt;~/.claude/settings.json&lt;/code&gt; with &lt;code&gt;PreToolUse&lt;/code&gt; narrowed to target MCP tools&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Hermes Agent (&lt;code&gt;hermes&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;~/.hermes/SOUL.md&lt;/code&gt; + &lt;code&gt;~/.hermes/config.yaml&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Dedicated startup pointer for Matt Pocock's &lt;code&gt;skills&lt;/code&gt; (39 suite skills + 46 bundled)&lt;/td&gt;
&lt;td&gt;Isolated config and native skill loading via &lt;code&gt;skill_view&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;DeepSeek DSH (&lt;code&gt;dsh&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;&lt;code&gt;~/.dsh/AGENTS.md&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Dedicated startup pointer for Garry Tan's &lt;code&gt;gstack&lt;/code&gt; (63 suite skills)&lt;/td&gt;
&lt;td&gt;Dedicated &lt;code&gt;~/.dsh/everos-hooks.json&lt;/code&gt; via DSH profile config (&lt;code&gt;maxBytes: 65536&lt;/code&gt; on non-web profiles)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;em&gt;Verified on Windows ARM64 (Nov 23 to 24, 2026). After separating the configs, all 11 startup checks passed with zero cross-harness leakage across 23 config and instruction files.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;To sync startup pointers across all five tools without wiping custom local notes (like Codex's model-routing block in &lt;code&gt;~/.codex/AGENTS.md&lt;/code&gt;), I wrapped only the short pointer inside &lt;code&gt;AUTOLOAD-DRIVER-BLOCK&lt;/code&gt; HTML comment markers. Sync scripts update only the lines inside the fence and leave everything else untouched.&lt;/p&gt;

&lt;h3&gt;
  
  
  When rolling out shared configs wiped my backups
&lt;/h3&gt;

&lt;p&gt;Isolating folders still did not protect me when a coding subagent wandered outside its brief during that same multi-tool config rollout. I added one casual line to a prompt: &lt;em&gt;"Also inspect my other coding tool configs and fix any broken path or config entry if present."&lt;/em&gt; The assistant misread a valid model name in &lt;code&gt;~/.codex/config.toml&lt;/code&gt;, rewrote four files to a different model, including all three of my &lt;code&gt;.bak&lt;/code&gt; rollback snapshots, and hit its turn limit without running a test. My next automated doc sync copied the broken config straight into my notes.&lt;/p&gt;

&lt;p&gt;That incident left me with three mechanical guardrails:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Ban open-ended dotfile audits in prompts.&lt;/strong&gt; Name the exact files an agent is allowed to edit.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Lock backup files read-only immediately.&lt;/strong&gt; On Windows, running &lt;code&gt;attrib +R *.bak&lt;/code&gt; prevents a runaway edit from touching rollback copies.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Require a one-turn live smoke test.&lt;/strong&gt; Never mark a harness model or config change done until a real command (such as &lt;code&gt;codex exec&lt;/code&gt;) succeeds.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I added a similar hard stop for infrastructure tasks after an orchestrator jumped straight into deploying local observability containers right after a planning Q&amp;amp;A without waiting for final design approval. Any deployment workflow now pauses for an explicit yes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Three Windows ARM64 snags that hit the exact same stack
&lt;/h2&gt;

&lt;p&gt;Even after keeping each tool's skill folders and hook files isolated, running that token-saving stack on Windows ARM64 exposed three platform-specific failures that directly hit our token-optimizer server, our isolated hook scripts, and our shared skill-sync pipeline.&lt;/p&gt;

&lt;p&gt;First, Claude Code's &lt;code&gt;token-optimizer-mcp&lt;/code&gt; server kept hitting a 30-second startup timeout. Duplicate plugins were not the cause: an empty local cache triggered an on-the-fly install of version &lt;code&gt;7.11.0&lt;/code&gt;, and &lt;code&gt;better-sqlite3&lt;/code&gt; tried to compile against a missing Visual Studio &lt;code&gt;v145&lt;/code&gt; toolset. Preinstalling &lt;code&gt;7.11.0&lt;/code&gt; once with Visual Studio 2022 (&lt;code&gt;v143&lt;/code&gt; ARM64 tools) dropped the next Claude MCP health check from a 30-second timeout to &lt;strong&gt;3.05s&lt;/strong&gt; without editing any Claude settings.&lt;/p&gt;

&lt;p&gt;Second, Claude Code's default 5-second hook timeout was too short for our isolated hooks on Windows. Across 15 live runs, startup hooks averaged about 4.6 seconds (4,586 ms median) and prompt hooks averaged about 6.1 seconds (6,095 ms median), so the 5-second cutoff killed prompt hooks mid-flight. Raising &lt;code&gt;~/.claude/settings.json&lt;/code&gt; timeouts to 16 seconds on startup, 18 seconds on prompts, and 8 seconds on stop eliminated the timeouts.&lt;/p&gt;

&lt;p&gt;Third, Windows file quirks broke the shared skill-sync pipeline whenever a skill file arrived with hidden leading byte markers, missing headers, or nested metadata, or left behind stale folders after a skill was removed. Adding normalization and stale-folder pruning cleared those bugs, with our targeted two-file regression suite returning 225 passed and 2 skipped in 11.93 seconds.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I have not fully stress-tested yet
&lt;/h2&gt;

&lt;p&gt;Four verification gaps remain open as of late November 2026:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The skill-sync fix passed its targeted two-file test suite (225 passed, 2 skipped), not the entire repository test suite or a full cold restart of every launcher.&lt;/li&gt;
&lt;li&gt;MCP health checks exercised only read-only status calls, not write operations.&lt;/li&gt;
&lt;li&gt;DeepSeek DSH's durable memory storage and interactive terminal mode still need deeper testing, and GitHub Copilot's admin policy quietly swapped one requested Claude model for a different model during testing.&lt;/li&gt;
&lt;li&gt;A cold-cache rebuild of &lt;code&gt;token-optimizer-mcp&lt;/code&gt; on this laptop will still require explicit Visual Studio 2022 selection until the default Windows build toolchain is repaired.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Five rules you can borrow today
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Hand the AI a menu, keep the recipe book on the shelf.&lt;/strong&gt; Keep &lt;code&gt;AGENTS.md&lt;/code&gt; and &lt;code&gt;CLAUDE.md&lt;/code&gt; thin with global rules and one startup pointer, and move heavy skill guides to on-demand folders.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cap always-on skills at 7 or 8 per domain.&lt;/strong&gt; Pin only the core workflows you hit every session, and leave bulk packs on demand so startup context stays under 4,000 tokens.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Give every coding harness its own hook file and fenced startup block.&lt;/strong&gt; Never share &lt;code&gt;~/.claude/settings.json&lt;/code&gt; across tools, narrow &lt;code&gt;PreToolUse&lt;/code&gt; rules so they ignore ordinary Windows shell paths, and wrap synced pointers in &lt;code&gt;AUTOLOAD-DRIVER-BLOCK&lt;/code&gt; markers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Lock backups read-only and narrow agent prompts.&lt;/strong&gt; Run &lt;code&gt;attrib +R *.bak&lt;/code&gt; on Windows, ban open-ended "also fix my other configs" clauses, and require a live one-turn smoke test after any config change.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Measure real Windows startup timings.&lt;/strong&gt; Pre-warm native Node MCP caches with Visual Studio 2022 (&lt;code&gt;v143&lt;/code&gt;) when builds stall, and size hook timeouts from measured medians rather than 5-second defaults.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Raven&lt;/strong&gt; (EverMind AI multi-agent orchestrator): &lt;a href="https://github.com/EverMind-AI/Raven" rel="noopener noreferrer"&gt;github.com/EverMind-AI/Raven&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Claude Code&lt;/strong&gt; (Anthropic terminal coding agent): &lt;a href="https://github.com/anthropics/claude-code" rel="noopener noreferrer"&gt;github.com/anthropics/claude-code&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;OpenAI Codex&lt;/strong&gt; (OpenAI terminal coding agent): &lt;a href="https://github.com/openai/codex" rel="noopener noreferrer"&gt;github.com/openai/codex&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GitHub Copilot CLI&lt;/strong&gt;: &lt;a href="https://github.com/github/copilot-cli" rel="noopener noreferrer"&gt;github.com/github/copilot-cli&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Hermes Agent&lt;/strong&gt; (Nous Research coding agent): &lt;a href="https://github.com/NousResearch/hermes-agent" rel="noopener noreferrer"&gt;github.com/NousResearch/hermes-agent&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;DeepSeek DSH&lt;/strong&gt; (&lt;code&gt;deepseek-harness&lt;/code&gt;): &lt;a href="https://github.com/deepseek-ai/deepseek-harness" rel="noopener noreferrer"&gt;github.com/deepseek-ai/deepseek-harness&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Agent Client Protocol (ACP)&lt;/strong&gt;: &lt;a href="https://github.com/agentclientprotocol/agent-client-protocol" rel="noopener noreferrer"&gt;github.com/agentclientprotocol/agent-client-protocol&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Everything Claude Code (ECC)&lt;/strong&gt; skill suite: &lt;a href="https://github.com/affaan-m/ECC" rel="noopener noreferrer"&gt;github.com/affaan-m/ECC&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Superpowers&lt;/strong&gt; skill suite: &lt;a href="https://github.com/obra/superpowers" rel="noopener noreferrer"&gt;github.com/obra/superpowers&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;agent-skills&lt;/strong&gt; (Addy Osmani): &lt;a href="https://github.com/addyosmani/agent-skills" rel="noopener noreferrer"&gt;github.com/addyosmani/agent-skills&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Matt Pocock's skills&lt;/strong&gt;: &lt;a href="https://github.com/mattpocock/skills" rel="noopener noreferrer"&gt;github.com/mattpocock/skills&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;gstack&lt;/strong&gt; (Garry Tan): &lt;a href="https://github.com/garrytan/gstack" rel="noopener noreferrer"&gt;github.com/garrytan/gstack&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;token-optimizer-mcp&lt;/strong&gt;: &lt;a href="https://github.com/ooples/token-optimizer-mcp" rel="noopener noreferrer"&gt;github.com/ooples/token-optimizer-mcp&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://nareshh74.hashnode.dev/unifying-5-coding-agent-harnesses" rel="noopener noreferrer"&gt;nareshh74.hashnode.dev&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>agents</category>
      <category>ai</category>
      <category>llm</category>
      <category>productivity</category>
    </item>
    <item>
      <title>What 84,800 local spans taught me about my coding agents and my local AI services</title>
      <dc:creator>Naresh</dc:creator>
      <pubDate>Mon, 09 Nov 2026 10:45:50 +0000</pubDate>
      <link>https://dev.to/nareshh74/what-84800-local-spans-taught-me-about-my-coding-agents-and-my-local-ai-services-2ln2</link>
      <guid>https://dev.to/nareshh74/what-84800-local-spans-taught-me-about-my-coding-agents-and-my-local-ai-services-2ln2</guid>
      <description>&lt;p&gt;When I run one coding agent in one terminal, I can scroll up to find out what failed. My setup stopped working that way a few months ago.&lt;/p&gt;

&lt;p&gt;On my workstation I run two kinds of software at the same time. The first kind is coding agents: Claude Code with subagents, OpenAI Codex CLI, GitHub Copilot CLI, Aider, and Cline. The second kind is the local services those agents call: a LiteLLM router for model routing and fallbacks, Ollama for local models, SearXNG for search, Firecrawl for scraping, and a local memory service.&lt;/p&gt;

&lt;p&gt;Failures in that setup rarely print a stack trace. A parent agent stops answering. A nightly job produces nothing. A scrape-and-summarize run dies in the middle. I could not tell whether the fault was in the agent, in the router, or in a service.&lt;/p&gt;

&lt;p&gt;Tools like ccusage and CodeBurn answer how many tokens I spent. agentsview lets me read transcripts. I needed something different: one place to see which child session hung, which service was slow, and whether last night's jobs ran.&lt;/p&gt;

&lt;p&gt;So I wrote &lt;a href="https://github.com/nareshh74/agent-tap" rel="noopener noreferrer"&gt;agent-tap&lt;/a&gt;. It reads the logs, databases, and health endpoints that my agents and services already produce, and it stores them in one SQLite file. A dashboard at &lt;code&gt;http://127.0.0.1:6007&lt;/code&gt; shows the result.&lt;/p&gt;

&lt;h3&gt;
  
  
  Key takeaways (TL;DR)
&lt;/h3&gt;

&lt;p&gt;If you want to monitor and debug Claude Code, OpenAI Codex CLI, GitHub Copilot CLI, Aider, Cline, and local AI services in one local SQLite database:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;One local SQLite database for coding agents and local AI services.&lt;/strong&gt; agent-tap reads existing logs, SQLite state, and HTTP health endpoints from Claude Code, OpenAI Codex CLI, GitHub Copilot CLI, Aider, Cline, LiteLLM, Ollama, vLLM, SearXNG, and Firecrawl, then serves a dashboard at &lt;code&gt;http://127.0.0.1:6007&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Parent-to-child subagent tracing.&lt;/strong&gt; It links parent agent sessions to child subagents across processes so you can see which delegated run timed out or stalled on an interactive prompt.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Normalized error classes.&lt;/strong&gt; It groups silent background failures such as &lt;code&gt;mcp_oauth_400_refresh_loop&lt;/code&gt;, &lt;code&gt;gateway_first_byte_timeout_120s&lt;/code&gt;, &lt;code&gt;litellm_midstream_fallback_error&lt;/code&gt;, and &lt;code&gt;acp_prompt_timeout_600s&lt;/code&gt; into queryable buckets.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No proxy, no cloud account, and no prompt text on disk by default.&lt;/strong&gt; It polls files in place with saved offsets, drops prompt and response text before writing spans, and masks API keys and bearer tokens.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  What the first run showed
&lt;/h3&gt;

&lt;p&gt;The local SQLite database indexed 21,032 traces and 84,866 spans across 21,030 sessions. I looked at the error and correlation tables and found five problems that I had not noticed before.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;An MCP token refresh failed about 2,030 times.&lt;/strong&gt; An MCP server returned HTTP 400 on every OAuth refresh (&lt;code&gt;mcp_oauth_400_refresh_loop&lt;/code&gt;), and the harness retried in the background without showing an error. Grouping spans by &lt;code&gt;error.class&lt;/code&gt; made the loop visible in one query.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The local router closed connections after 120 seconds.&lt;/strong&gt; Long prompts took more than 120 seconds to reach the first token, so the router hit its &lt;code&gt;first_byte_timeout&lt;/code&gt; and logged &lt;code&gt;gateway_http_499&lt;/code&gt; drops. I found it by joining harness spans with gateway spans.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;LiteLLM 1.85.0 crashed in the middle of a stream.&lt;/strong&gt; Delegated runs died with truncated tool calls (&lt;code&gt;litellm_midstream_fallback_error&lt;/code&gt;). The parent-to-child link took me from the failed parent to the exact line in the gateway log.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Child agents hung for 600 seconds.&lt;/strong&gt; A child session waited on an interactive prompt with no terminal attached, and the parent looked frozen until the 600 second ACP timeout (&lt;code&gt;acp_prompt_timeout_600s&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Codex background jobs failed with HTTP 401.&lt;/strong&gt; In a terminal, an expired credential fails loudly. In a job without a terminal, the 401 turned into an empty review. A query for Codex spans with status &lt;code&gt;ERROR&lt;/code&gt; listed every affected job.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Agents and services in one model
&lt;/h3&gt;

&lt;p&gt;An agent run fails in the agent, or in a service the agent called. To see both, agent-tap treats every target as a service with a kind.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A &lt;code&gt;harness&lt;/code&gt; is a coding agent such as Claude Code, Codex, Copilot CLI, Aider, or Cline. It appears in Harness Activity with sessions, turns, tool calls, skill calls, and parent-to-child links.&lt;/li&gt;
&lt;li&gt;A &lt;code&gt;gateway&lt;/code&gt; is a model router or proxy such as LiteLLM or an OpenAI-compatible local gateway.&lt;/li&gt;
&lt;li&gt;A &lt;code&gt;service&lt;/code&gt; is anything else, such as Ollama, SearXNG, or Firecrawl. A service can be an HTTP endpoint, a Docker container, a process, or a log file.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Gateways and services appear in Running Services &amp;amp; Gateways with their status, request count, error count, and p50 and p90 latency. All targets share the error classes, the trace drawer, and the schedule view. To add a service of your own, run &lt;code&gt;agent-tap onboard --name my-api --kind service --health-url http://127.0.0.1:9000/health&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  How it works
&lt;/h3&gt;

&lt;p&gt;agent-tap does not wrap your agents or sit in front of them. It reads files and databases that already exist and remembers its position in each one, so every poll reads only new data. The storage is one SQLite file in WAL mode. The tables have the same shape as Arize Phoenix, and you can query them with &lt;code&gt;agent-tap query&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Prompt text is off by default. Before agent-tap writes a span, it drops prompt and response text and tool arguments. It keeps sizes, token counts, tool names, durations, session links, and error classes. If you turn prompt storage on, a redaction pass still masks bearer tokens, &lt;code&gt;sk-&lt;/code&gt; keys, GitHub tokens, and JSON Web Tokens.&lt;/p&gt;

&lt;p&gt;If an adapter misreads your logs, run &lt;code&gt;agent-tap bug-report&lt;/code&gt;. It prints a diagnostic bundle with secrets masked and your home directory replaced by &lt;code&gt;~&lt;/code&gt;, and &lt;code&gt;--open&lt;/code&gt; starts a pre-filled GitHub issue.&lt;/p&gt;

&lt;h3&gt;
  
  
  How agent-tap compares to ccusage, CodeBurn, agentsview, Arize Phoenix, and Langfuse
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Feature&lt;/th&gt;
&lt;th&gt;agent-tap&lt;/th&gt;
&lt;th&gt;ccusage&lt;/th&gt;
&lt;th&gt;CodeBurn&lt;/th&gt;
&lt;th&gt;agentsview&lt;/th&gt;
&lt;th&gt;Arize Phoenix&lt;/th&gt;
&lt;th&gt;Langfuse&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Primary job&lt;/td&gt;
&lt;td&gt;Local runtime debugging, subagent traces, and service health&lt;/td&gt;
&lt;td&gt;Token and cost reports from local logs&lt;/td&gt;
&lt;td&gt;Token cost estimates and optimization advice&lt;/td&gt;
&lt;td&gt;Transcript browsing and session search&lt;/td&gt;
&lt;td&gt;LLM app tracing and evaluation&lt;/td&gt;
&lt;td&gt;LLM app tracing, prompt management, and metrics&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Normalized error classes from agent logs&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;Only if your code emits them&lt;/td&gt;
&lt;td&gt;Only if your code emits them&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Parent-to-child subagent correlation&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;Only with manual trace propagation&lt;/td&gt;
&lt;td&gt;Only with manual trace propagation&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Local AI service and gateway health (LiteLLM, Ollama, vLLM, SearXNG, Firecrawl)&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Scheduled task and cron monitoring&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Storage and setup&lt;/td&gt;
&lt;td&gt;One local SQLite file, no SDK or proxy&lt;/td&gt;
&lt;td&gt;Reads local logs on demand&lt;/td&gt;
&lt;td&gt;Local SQLite&lt;/td&gt;
&lt;td&gt;Local SQLite&lt;/td&gt;
&lt;td&gt;Server or container plus OTLP or SDK&lt;/td&gt;
&lt;td&gt;Cloud or self-hosted server plus SDK&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;agent-tap does not price tokens in dollars, so I run it next to ccusage or CodeBurn. I use Arize Phoenix or Langfuse when I instrument an application I am building, and agent-tap to monitor the coding agents and local services running on my workstation.&lt;/p&gt;

&lt;h3&gt;
  
  
  Try it
&lt;/h3&gt;

&lt;p&gt;agent-tap is MIT licensed and needs Python 3.11 or later. It runs on Linux, macOS, Windows, and WSL2.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pipx install ai-agent-tap
uvx --from ai-agent-tap agent-tap doctor
pipx install git+https://github.com/nareshh74/agent-tap
agent-tap init
agent-tap run --once
agent-tap serve
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run &lt;code&gt;agent-tap doctor&lt;/code&gt; first if you only want to see what it finds. The code and documentation are at &lt;a href="https://github.com/nareshh74/agent-tap" rel="noopener noreferrer"&gt;https://github.com/nareshh74/agent-tap&lt;/a&gt;. If you run several agents or local services, I would like to know which one your logs break first.&lt;/p&gt;

&lt;h3&gt;
  
  
  Frequently asked questions
&lt;/h3&gt;

&lt;h3&gt;
  
  
  How do I find out why a Claude Code or Codex subagent hung?
&lt;/h3&gt;

&lt;p&gt;Run &lt;code&gt;agent-tap run --once&lt;/code&gt; and open &lt;code&gt;http://127.0.0.1:6007&lt;/code&gt;, or run &lt;code&gt;agent-tap query errors --json&lt;/code&gt;. agent-tap links parent sessions to child subagent sessions across Claude Code, OpenAI Codex CLI, and GitHub Copilot CLI, and tags stalled child runs with error classes such as &lt;code&gt;acp_prompt_timeout_600s&lt;/code&gt; or &lt;code&gt;gateway_first_byte_timeout_120s&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  How does agent-tap differ from ccusage and CodeBurn?
&lt;/h3&gt;

&lt;p&gt;ccusage and CodeBurn calculate token usage and dollar cost from local logs. agent-tap focuses on operational debugging: normalized error classes, parent-to-child subagent trees, scheduled job runs, and health checks for local AI services. They read the same agent directories without conflicting, so you can run them side by side.&lt;/p&gt;

&lt;h3&gt;
  
  
  Does agent-tap send prompts or code to the cloud?
&lt;/h3&gt;

&lt;p&gt;No. agent-tap makes no outbound network requests except local health probes to the localhost endpoints you configure. By default, &lt;code&gt;store_prompt_text&lt;/code&gt; is &lt;code&gt;false&lt;/code&gt;, so prompt text, response text, and tool arguments are dropped before any span is written to SQLite.&lt;/p&gt;

&lt;h3&gt;
  
  
  How do I monitor local AI services like LiteLLM, Ollama, SearXNG, and Firecrawl?
&lt;/h3&gt;

&lt;p&gt;Run &lt;code&gt;agent-tap init&lt;/code&gt; to auto-detect common local services on their default ports, or register any HTTP endpoint, Docker container, process, or log file with &lt;code&gt;agent-tap onboard --name litellm --kind gateway --health-url http://127.0.0.1:4000/health/liveliness --docker-container litellm&lt;/code&gt;. agent-tap records status, error counts, and p50 and p90 latency in the Running Services &amp;amp; Gateways table.&lt;/p&gt;

&lt;p&gt;Naresh Kumar&lt;/p&gt;

</description>
      <category>ai</category>
      <category>opensource</category>
      <category>observability</category>
      <category>devtools</category>
    </item>
  </channel>
</rss>
