<?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: VANSH ARORA</title>
    <description>The latest articles on DEV Community by VANSH ARORA (@vansharora21).</description>
    <link>https://dev.to/vansharora21</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%2F3977293%2Fc5c372d4-6394-447c-b24e-985f05573fc4.png</url>
      <title>DEV Community: VANSH ARORA</title>
      <link>https://dev.to/vansharora21</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/vansharora21"/>
    <language>en</language>
    <item>
      <title>Announcing TokenCap: The Local-First Context Layer for AI Coding Agents</title>
      <dc:creator>VANSH ARORA</dc:creator>
      <pubDate>Thu, 22 Oct 2026 18:07:15 +0000</pubDate>
      <link>https://dev.to/vansharora21/announcing-tokencap-the-local-first-context-layer-for-ai-coding-agents-3a53</link>
      <guid>https://dev.to/vansharora21/announcing-tokencap-the-local-first-context-layer-for-ai-coding-agents-3a53</guid>
      <description>&lt;p&gt;Today, we are officially launching TokenCap: a zero-network-egress repository intelligence platform designed for developers building and pairing with AI coding agents.&lt;/p&gt;

&lt;h3&gt;
  
  
  What is TokenCap?
&lt;/h3&gt;

&lt;p&gt;TokenCap bridges the gap between raw source code and LLM context windows. Instead of blindly dumping full files or relying on fuzzy text search, TokenCap parses your codebase into an AST symbol graph, clusters modules, and budgets context deterministically.&lt;/p&gt;

&lt;h3&gt;
  
  
  Core Verified Benchmarks and Capabilities
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;12.2x Token Reduction: Compresses typical 150k-token repository payloads down to 12.5k tokens without dropping critical call signatures.&lt;/li&gt;
&lt;li&gt;Even-Span Sampling: Proportional sampling across file heads, bodies, and exports that eliminates line-300 cutoffs.&lt;/li&gt;
&lt;li&gt;Spatial Impact Analysis: &lt;code&gt;tokencap ask impact &amp;lt;file&amp;gt;:&amp;lt;symbol&amp;gt;&lt;/code&gt; calculates caller blast radius and risk before an agent modifies code.&lt;/li&gt;
&lt;li&gt;The Four Sovereignty Laws: Zero runtime network egress, zero API keys, no compilation build steps, and under 4 dependencies.&lt;/li&gt;
&lt;li&gt;Multi-Surface Availability:

&lt;ul&gt;
&lt;li&gt;CLI: &lt;code&gt;npx tokencap make&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;VS Code Extension: Auto-capture and spatial menus&lt;/li&gt;
&lt;li&gt;Local Bridge &amp;amp; Companion: Direct loopback injection into ChatGPT, Claude, and Gemini&lt;/li&gt;
&lt;li&gt;Agent Skill: Native discovery for OpenCode, Claude Code, Cursor, and Antigravity&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Quick Start
&lt;/h3&gt;

&lt;p&gt;Install globally or run directly with npx:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Generate your repository intelligence snapshot&lt;/span&gt;
npx tokencap make

&lt;span class="c"&gt;# Start the local loopback bridge for browser companions&lt;/span&gt;
npx tokencap serve &lt;span class="nt"&gt;--daemon&lt;/span&gt;

&lt;span class="c"&gt;# Query the blast radius of a function&lt;/span&gt;
npx tokencap ask impact src/auth.js:verifyToken
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Explore the documentation, read the architecture specs, and install the extensions at tokencap.vansharora.app&lt;/p&gt;

</description>
      <category>ai</category>
      <category>devtools</category>
      <category>vscode</category>
      <category>productivity</category>
    </item>
    <item>
      <title>How We Packaged TokenCap as a Self-Discoverable Agent Skill</title>
      <dc:creator>VANSH ARORA</dc:creator>
      <pubDate>Thu, 22 Oct 2026 12:13:04 +0000</pubDate>
      <link>https://dev.to/vansharora21/how-we-packaged-tokencap-as-a-self-discoverable-agent-skill-5329</link>
      <guid>https://dev.to/vansharora21/how-we-packaged-tokencap-as-a-self-discoverable-agent-skill-5329</guid>
      <description>&lt;p&gt;When onboarding a new software engineer, you provide onboarding documentation. When onboarding an AI agent, developers often rely on ad-hoc prompts or complex custom scripts that break across different platforms.&lt;/p&gt;

&lt;p&gt;With the TokenCap Agent Skill system in &lt;code&gt;skills/tokencap/&lt;/code&gt;, any agent supporting open skill standards can discover, query, and respect repository intelligence without prior manual setup.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Skill Specification
&lt;/h3&gt;

&lt;p&gt;The skill is built around three standard files:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;SKILL.md&lt;/code&gt;: Root declaration with YAML frontmatter, trigger conditions, and high-level workflows.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;reference/commands.md&lt;/code&gt;: Exact CLI and MCP commands for snapshot generation, impact analysis, and refactoring.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;reference/workflows.md&lt;/code&gt;: Step-by-step playbooks for PR review, onboarding to unfamiliar codebases, and blast-radius audits.&lt;/li&gt;
&lt;/ol&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>ai</category>
      <category>devtools</category>
      <category>vscode</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Why AI Context Packs Must Adapt Dynamically to Target Model Economics</title>
      <dc:creator>VANSH ARORA</dc:creator>
      <pubDate>Thu, 22 Oct 2026 08:46:40 +0000</pubDate>
      <link>https://dev.to/vansharora21/why-ai-context-packs-must-adapt-dynamically-to-target-model-economics-369</link>
      <guid>https://dev.to/vansharora21/why-ai-context-packs-must-adapt-dynamically-to-target-model-economics-369</guid>
      <description>&lt;p&gt;Different LLMs have wildly different context windows and cost economics. Providing a generic 20k-token context pack is wasteful for smaller models and insufficient for massive 200k+ models.&lt;/p&gt;

&lt;p&gt;In TokenCap, we implemented model-aware budgeting in &lt;code&gt;src/bridge/generate.js&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  How Token Allocations Adjust
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;gpt-4o&lt;/code&gt; (Target: ~16k to 32k tokens): Balanced span sampling, key symbol definitions, priority diffs, and compressed helper functions.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;claude-3-5-sonnet&lt;/code&gt; (Target: ~32k to 64k tokens): Extended call-chain depths, full component prop interfaces, and complete ADR documentation.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;gemini-1.5-pro&lt;/code&gt; (Target: ~100k+ tokens): Deep repository breadth, full implementation bodies across related clusters, and complete test suites.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;llama-3-8b&lt;/code&gt; / Local Models (Target: ~4k to 8k tokens): Aggressive even-span folding, signatures only, zero diffs, highest Louvain cluster focus.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Selecting Profiles via CLI or Bridge
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Generate context tailored specifically for Claude 3.5 Sonnet&lt;/span&gt;
tokencap make &lt;span class="nt"&gt;--profile&lt;/span&gt; claude-3-5-sonnet
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;CLI Output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Loaded model profile: claude-3-5-sonnet
Token budget ceiling: 64,000 tokens
Allocated:
  - Architecture and graph overview: 2,400 tokens
  - Core targeted symbols: 18,200 tokens
  - Transitive caller bodies: 14,800 tokens
  - Active ADRs and memory: 1,600 tokens
Total Generated: 37,000 tokens (58% of ceiling, 0% overflow risk)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The bridge passes these model hints automatically when queries arrive from our Chrome companion or MCP server.&lt;/p&gt;

&lt;p&gt;Read the model profiling guide at tokencap.vansharora.app&lt;/p&gt;

</description>
      <category>ai</category>
      <category>devtools</category>
      <category>vscode</category>
      <category>productivity</category>
    </item>
    <item>
      <title>How We Refactored a 2,400-Line CLI Monolith into 7 Core Verbs Without Breaking Changes</title>
      <dc:creator>VANSH ARORA</dc:creator>
      <pubDate>Wed, 21 Oct 2026 18:11:36 +0000</pubDate>
      <link>https://dev.to/vansharora21/how-we-refactored-a-2400-line-cli-monolith-into-7-core-verbs-without-breaking-changes-1mgf</link>
      <guid>https://dev.to/vansharora21/how-we-refactored-a-2400-line-cli-monolith-into-7-core-verbs-without-breaking-changes-1mgf</guid>
      <description>&lt;p&gt;As TokenCap expanded from a simple repository snapshot generator to a full intelligence engine with graphs, memory loops, and security scanners, our CLI sprawled out of control. We had 21 distinct commands in a single 2,455-line &lt;code&gt;bin/tokencap.js&lt;/code&gt; file.&lt;/p&gt;

&lt;p&gt;To fix this, we completed a major CLI refactoring around 7 core verbs.&lt;/p&gt;

&lt;h3&gt;
  
  
  The 7 Core Verbs Hierarchy
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;make&lt;/code&gt; (&lt;code&gt;src/cli/make.js&lt;/code&gt;): Snapshot generation, watch mode, custom budgeting profiles.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;ask&lt;/code&gt; (&lt;code&gt;src/cli/ask.js&lt;/code&gt;): Spatial queries (&lt;code&gt;ask impact&lt;/code&gt;, &lt;code&gt;ask dead-code&lt;/code&gt;, &lt;code&gt;ask adr&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;analyze&lt;/code&gt; (&lt;code&gt;src/cli/analyze.js&lt;/code&gt;): Repo audits (&lt;code&gt;analyze health&lt;/code&gt;, &lt;code&gt;analyze debt&lt;/code&gt;, &lt;code&gt;analyze security&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;serve&lt;/code&gt; (&lt;code&gt;src/cli/serve.js&lt;/code&gt;): Background daemons (&lt;code&gt;serve --daemon&lt;/code&gt;, &lt;code&gt;serve --mcp&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;update&lt;/code&gt; (&lt;code&gt;src/cli/update.js&lt;/code&gt;): In-place upgrades.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;help&lt;/code&gt; &amp;amp; &lt;code&gt;version&lt;/code&gt;: System introspection.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  The Silent Alias Strategy
&lt;/h3&gt;

&lt;p&gt;To guarantee that existing scripts and CI workflows did not break:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// bin/tokencap.js excerpt&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;ALIASES&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;graph&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;ask&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;impact&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
  &lt;span class="na"&gt;capsule&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;make&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
  &lt;span class="na"&gt;security&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;analyze&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;security&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
  &lt;span class="na"&gt;health&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;analyze&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;health&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
  &lt;span class="na"&gt;mcp&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;serve&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;--mcp&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;normalizedArgs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;resolveAliases&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;argv&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;slice&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The dispatcher shrank from 2,455 lines down to 234 lines of clean routing logic, with handlers decoupled into modular, testable files in &lt;code&gt;src/cli/&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Inspect the CLI architecture at tokencap.vansharora.app&lt;/p&gt;

</description>
      <category>ai</category>
      <category>devtools</category>
      <category>vscode</category>
      <category>productivity</category>
    </item>
    <item>
      <title>How TokenCap Eliminates Context Query Latency with Background Pre-Warming</title>
      <dc:creator>VANSH ARORA</dc:creator>
      <pubDate>Wed, 21 Oct 2026 12:09:36 +0000</pubDate>
      <link>https://dev.to/vansharora21/how-tokencap-eliminates-context-query-latency-with-background-pre-warming-omg</link>
      <guid>https://dev.to/vansharora21/how-tokencap-eliminates-context-query-latency-with-background-pre-warming-omg</guid>
      <description>&lt;p&gt;When integrating browser companions or IDE extensions with a local intelligence bridge, latency matters. If generating prompt context takes 4 or 5 seconds, developers stop using the integration.&lt;/p&gt;

&lt;p&gt;To deliver sub-second responses, TokenCap implements background cache pre-warming in &lt;code&gt;src/bridge/warmCache.js&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  How Pre-Warming Operates
&lt;/h3&gt;

&lt;p&gt;When you run &lt;code&gt;tokencap serve&lt;/code&gt;, the HTTP server begins listening immediately. While the pairing handshake occurs, an asynchronous worker kicks off:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Graph Pre-Compilation: Traverses all files and loads AST symbol tables into memory.&lt;/li&gt;
&lt;li&gt;Memory and ADR Indexing: Loads active session records and architecture decisions into RAM.&lt;/li&gt;
&lt;li&gt;Git Diff Snapshotting: Caches uncommitted working tree diffs and affected symbols.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// src/bridge/warmCache.js logic&lt;/span&gt;
&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;preWarmBridgeContext&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;repoRoot&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;setImmediate&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// Builds query-independent artifacts concurrently&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;graph&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;getOrBuildGraph&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;repoRoot&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;memory&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;loadActiveMemory&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;repoRoot&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;diff&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;computeWorkingDiff&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;repoRoot&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nx"&gt;bridgeCache&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;repoRoot&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;graph&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;memory&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;diff&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;timestamp&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;now&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Response Time Comparison
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Cold Generation (No Pre-Warm): 1,840ms&lt;/li&gt;
&lt;li&gt;With Pre-Warmed Cache: 180ms (10x faster first-click response)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When the Chrome Companion requests task-scoped context via &lt;code&gt;POST /generate&lt;/code&gt;, TokenCap slices the pre-warmed graph and formats the prompt payload almost instantaneously.&lt;/p&gt;

&lt;p&gt;Documentation available at tokencap.vansharora.app&lt;/p&gt;

</description>
      <category>ai</category>
      <category>devtools</category>
      <category>vscode</category>
      <category>productivity</category>
    </item>
    <item>
      <title>How We Built an Atomic, Sharded Incremental Cache with 57ms Rebuild Times</title>
      <dc:creator>VANSH ARORA</dc:creator>
      <pubDate>Tue, 20 Oct 2026 18:04:41 +0000</pubDate>
      <link>https://dev.to/vansharora21/how-we-built-an-atomic-sharded-incremental-cache-with-57ms-rebuild-times-5fb</link>
      <guid>https://dev.to/vansharora21/how-we-built-an-atomic-sharded-incremental-cache-with-57ms-rebuild-times-5fb</guid>
      <description>&lt;p&gt;When building a local-first repository intelligence engine, speed is everything. A cold build on a 100k-file benchmark can take 45 to 55 seconds. But during active coding, developers expect instantaneous updates when saving a file.&lt;/p&gt;

&lt;p&gt;In TokenCap, we implemented an atomic sharded incremental cache in &lt;code&gt;src/incremental/cacheManager.js&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Cache Architecture and Integrity Guarantees
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Atomic Sharding: Instead of a monolithic cache file, intelligence graphs are sharded into modular JSON blocks keyed by file path hashes.&lt;/li&gt;
&lt;li&gt;Content-Based Checksums: Cache validity is verified via SHA-256 checksums rather than volatile filesystem mtimes.&lt;/li&gt;
&lt;li&gt;Version Guard: Any version mismatch between the running TokenCap binary and stored cache forces an automatic, safe cold rebuild instead of mis-reading stale schemas.&lt;/li&gt;
&lt;li&gt;Scoped Invalidation: When &lt;code&gt;src/auth.js&lt;/code&gt; changes, TokenCap only re-parses &lt;code&gt;auth.js&lt;/code&gt; and updates direct incoming and outgoing graph edges.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Benchmark Numbers
&lt;/h3&gt;

&lt;p&gt;On our benchmark repository of 1,200 files:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Cold Build (Zero Cache): 1.14s&lt;/li&gt;
&lt;li&gt;Warm Full Rebuild: 290ms&lt;/li&gt;
&lt;li&gt;Scoped Incremental Build (1 File Edit): 57ms
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Watch mode with sub-60ms incremental rebuilds&lt;/span&gt;
tokencap make &lt;span class="nt"&gt;--watch&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Watching for changes (rebuild after 300ms idle)...
✓ Change detected in src/auth/jwt.js
✓ Invalidation scope: 1 file, 4 affected callers
✓ Rebuilt incremental snapshot in 57ms (.tokencap/snapshot.md)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Because rebuilds take under 60ms, the VS Code extension auto-captures on save without interrupting typing cadence.&lt;/p&gt;

&lt;p&gt;Explore the caching implementation at tokencap.vansharora.app&lt;/p&gt;

</description>
      <category>ai</category>
      <category>devtools</category>
      <category>vscode</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Moving Beyond Raw Git Diffs: Evidence-Backed Symbol Change Reports</title>
      <dc:creator>VANSH ARORA</dc:creator>
      <pubDate>Tue, 20 Oct 2026 08:44:14 +0000</pubDate>
      <link>https://dev.to/vansharora21/moving-beyond-raw-git-diffs-evidence-backed-symbol-change-reports-15lh</link>
      <guid>https://dev.to/vansharora21/moving-beyond-raw-git-diffs-evidence-backed-symbol-change-reports-15lh</guid>
      <description>&lt;p&gt;Git diffs are the universal standard for code review, but they operate at the line level rather than the semantic level. A one-line signature change in an exported function can have a higher blast radius than a 200-line CSS refactor, yet git treats them both as raw text changes.&lt;/p&gt;

&lt;p&gt;In TokenCap, we built &lt;code&gt;src/diff/buildDiffReport.js&lt;/code&gt; to produce evidence-backed semantic diff reports.&lt;/p&gt;

&lt;h3&gt;
  
  
  What the Semantic Diff Report Computes
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Symbol Changes: Identifies exactly which functions, methods, and classes were added, modified, or deleted.&lt;/li&gt;
&lt;li&gt;Breaking Change Detection: Flags parameter list alterations and removed exports that break existing call sites.&lt;/li&gt;
&lt;li&gt;Test Association: Scans the call graph to list the specific test files covering the modified symbols.&lt;/li&gt;
&lt;li&gt;Risk Rating: Computes risk (LOW, MEDIUM, HIGH, CRITICAL) based on transitive caller volume and module boundary crossings.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  CLI Inspection
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;tokencap diff
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Comparing working tree against origin/main...
Files Changed: 4 files (+42, -18 lines)
Symbol Alterations:
  - MODIFIED: src/auth/jwt.js:verifyToken (Signature changed: +options param)
Breaking Change Risk: HIGH
Downstream Impact:
  - 4 direct call sites affected
  - 18 transitive callers across 3 clusters
Recommended Tests to Run:
  - test/auth.test.js
  - test/session.test.js
Report generated in .tokencap/diff/review-packet.md
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can inject this report directly into your PR description or pass it to an AI agent to verify that all affected call sites were updated.&lt;/p&gt;

&lt;p&gt;Learn more at tokencap.vansharora.app&lt;/p&gt;

</description>
      <category>ai</category>
      <category>devtools</category>
      <category>vscode</category>
      <category>productivity</category>
    </item>
    <item>
      <title>How TokenCap Computes a 0-to-100 Build Health Diagnostic for Codebases</title>
      <dc:creator>VANSH ARORA</dc:creator>
      <pubDate>Thu, 15 Oct 2026 17:51:14 +0000</pubDate>
      <link>https://dev.to/vansharora21/how-tokencap-computes-a-0-to-100-build-health-diagnostic-for-codebases-2154</link>
      <guid>https://dev.to/vansharora21/how-tokencap-computes-a-0-to-100-build-health-diagnostic-for-codebases-2154</guid>
      <description>&lt;p&gt;Evaluating the health of a repository usually requires running multiple disjointed tools: linters, circular dependency checkers, dead code detectors, and test runners.&lt;/p&gt;

&lt;p&gt;In TokenCap, we unified these signals into an objective 0-to-100 repository health diagnostic in &lt;code&gt;src/health/buildHealth.js&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  What Factors Drive the Health Score?
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Call Resolution Ratio (30% weight): Percentage of intra-repo call expressions that successfully resolve to declared symbols.&lt;/li&gt;
&lt;li&gt;Dead Code Ratio (20% weight): Ratio of uncalled internal functions relative to total declared symbols.&lt;/li&gt;
&lt;li&gt;Architecture Boundaries (20% weight): Frequency of circular dependencies and unexpected cross-cluster imports.&lt;/li&gt;
&lt;li&gt;Test Mapping Coverage (15% weight): Ratio of exported functions with direct unit test mappings.&lt;/li&gt;
&lt;li&gt;Security Cleanliness (15% weight): Absence of unescaped static taint sinks and credential leaks.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  CLI Health Diagnostic
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;tokencap analyze health
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Evaluating repository health across 94 files...
------------------------------------------------------
OVERALL BUILD HEALTH SCORE: 88 / 100 [GRADE: A-]
------------------------------------------------------
  ✓ Call Resolution: 91% (891 / 978 call sites resolved)
  ✓ Circular Dependencies: 0 detected
  ! Dead Code: 6 uncalled functions (-4 pts)
  ! Untested Exports: 14 exported functions missing tests (-6 pts)
  ✓ Security Sinks: 0 critical taint paths
------------------------------------------------------
Report saved to .tokencap/health-report.json
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;By running health checks before and after agent sessions, teams can verify that automated code changes improve the overall score rather than degrading it.&lt;/p&gt;

&lt;p&gt;Learn more at tokencap.vansharora.app&lt;/p&gt;

</description>
      <category>ai</category>
      <category>devtools</category>
      <category>vscode</category>
      <category>productivity</category>
    </item>
    <item>
      <title>How TokenCap Turns Scattered TODO Comments into an Actionable Debt Ledger</title>
      <dc:creator>VANSH ARORA</dc:creator>
      <pubDate>Thu, 15 Oct 2026 11:52:09 +0000</pubDate>
      <link>https://dev.to/vansharora21/how-tokencap-turns-scattered-todo-comments-into-an-actionable-debt-ledger-5e93</link>
      <guid>https://dev.to/vansharora21/how-tokencap-turns-scattered-todo-comments-into-an-actionable-debt-ledger-5e93</guid>
      <description>&lt;p&gt;Almost every production codebase is littered with comments like &lt;code&gt;// TODO: handle error retry&lt;/code&gt; or &lt;code&gt;// FIXME: memory leak under load&lt;/code&gt;. Over time, they become invisible noise.&lt;/p&gt;

&lt;p&gt;In TokenCap, we built &lt;code&gt;src/debt/ledger.js&lt;/code&gt; to catalog and prioritize technical debt automatically.&lt;/p&gt;

&lt;h3&gt;
  
  
  How the Debt Ledger Operates
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Tokenizer Scan: Scans source lines for standard debt prefixes (&lt;code&gt;TODO&lt;/code&gt;, &lt;code&gt;FIXME&lt;/code&gt;, &lt;code&gt;HACK&lt;/code&gt;, &lt;code&gt;DEBT&lt;/code&gt;, &lt;code&gt;OPTIMIZE&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;Git Metadata Anchoring: Runs local git blame to capture the original author, commit hash, and creation date.&lt;/li&gt;
&lt;li&gt;Symbol and Cluster Mapping: Associates the debt marker with its enclosing function and architectural cluster.&lt;/li&gt;
&lt;li&gt;Output Generation: Writes an auditable ledger to &lt;code&gt;.tokencap/debt/ledger.json&lt;/code&gt; and &lt;code&gt;.tokencap/debt-map.md&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  CLI Command
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;tokencap analyze debt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;CLI Output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Indexed 38 technical debt markers across 84 files:
  - [CRITICAL] src/auth/session.js:84: FIXME: Refresh token race condition
    Authored: 2026-03-12 by vansharora21 | Cluster: Auth
  - [MEDIUM] src/pack/fold.js:120: TODO: Support nested bracket folding
    Authored: 2026-06-20 by vansharora21 | Cluster: Pack
  - [LOW] src/utils/format.js:14: HACK: Temporary regex for legacy dates
    Authored: 2026-08-01 by vansharora21 | Cluster: Utilities
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Because debt items are scored and tracked, your AI coding agent can be instructed to resolve high-priority debt items alongside planned feature work.&lt;/p&gt;

&lt;p&gt;Read more at tokencap.vansharora.app&lt;/p&gt;

</description>
      <category>ai</category>
      <category>devtools</category>
      <category>vscode</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Preventing AI Architecture Reversals with In-Repo Architecture Decision Records</title>
      <dc:creator>VANSH ARORA</dc:creator>
      <pubDate>Thu, 15 Oct 2026 08:27:56 +0000</pubDate>
      <link>https://dev.to/vansharora21/preventing-ai-architecture-reversals-with-in-repo-architecture-decision-records-221a</link>
      <guid>https://dev.to/vansharora21/preventing-ai-architecture-reversals-with-in-repo-architecture-decision-records-221a</guid>
      <description>&lt;p&gt;A common frustration when working with AI coding tools is architectural amnesia. You carefully decide to avoid an ORM for specific performance reasons. Two days later, a new AI session opens and immediately suggests installing Prisma.&lt;/p&gt;

&lt;p&gt;In TokenCap, we solve this by embedding Architecture Decision Records (ADRs) directly into the agent intelligence layer in &lt;code&gt;src/memory/adrs.js&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  How ADR Intelligence Works
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Structured Storage: ADRs are stored as markdown files in &lt;code&gt;.tokencap/memory/adrs/&lt;/code&gt; with title, date, status, context, decision, and consequences.&lt;/li&gt;
&lt;li&gt;Symbol Association: Decisions can be linked to specific modules or symbol clusters.&lt;/li&gt;
&lt;li&gt;Prompt Context Injection: When an agent edits files associated with an ADR, TokenCap injects the rationale into the top of the context pack:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gu"&gt;### Active Architecture Decision Record: ADR-004&lt;/span&gt;
Title: Use Raw SQL for Ledger Entries (Do Not Use ORM)
Status: Accepted (2026-07-15)
Decision: Ledger balance operations must use raw SQL parameterized queries with strict SERIALIZABLE transaction isolation to prevent race conditions.
Consequence: Do not refactor ledger operations to ORM abstractions.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  CLI and MCP Tooling
&lt;/h3&gt;

&lt;p&gt;You can create and manage ADRs via the CLI or MCP tool:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;tokencap ask adr &lt;span class="nt"&gt;--list&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;CLI Output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Registered Architecture Decision Records (4):
  - ADR-001: CommonJS only for core modules (No build step)
  - ADR-002: Vendored WASM grammars for tree-sitter
  - ADR-003: Staged memory pipeline before repository commit
  - ADR-004: Raw SQL for ledger operations
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With ADRs in place, AI agents respect established team choices instead of endlessly proposing architectural rewrites.&lt;/p&gt;

&lt;p&gt;Read more at tokencap.vansharora.app&lt;/p&gt;

</description>
      <category>ai</category>
      <category>devtools</category>
      <category>vscode</category>
      <category>productivity</category>
    </item>
    <item>
      <title>How TokenCap Traces Taint Flow from Sources to Sinks Using AST Traversal</title>
      <dc:creator>VANSH ARORA</dc:creator>
      <pubDate>Wed, 14 Oct 2026 18:08:05 +0000</pubDate>
      <link>https://dev.to/vansharora21/how-tokencap-traces-taint-flow-from-sources-to-sinks-using-ast-traversal-2nm3</link>
      <guid>https://dev.to/vansharora21/how-tokencap-traces-taint-flow-from-sources-to-sinks-using-ast-traversal-2nm3</guid>
      <description>&lt;p&gt;Generative AI is great at writing features, but notorious for re-introducing classic security vulnerabilities like SQL injection, Command Injection, and Path Traversal.&lt;/p&gt;

&lt;p&gt;In TokenCap, we implemented intra-procedural static taint flow analysis in &lt;code&gt;src/security/taint/&lt;/code&gt; to flag tainted data paths before code changes are committed.&lt;/p&gt;

&lt;h3&gt;
  
  
  Taint Analysis Mechanics
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Sources: HTTP request properties (&lt;code&gt;req.body&lt;/code&gt;, &lt;code&gt;req.query&lt;/code&gt;, &lt;code&gt;req.params&lt;/code&gt;, &lt;code&gt;event.body&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;Propagation: Data flow tracking across variable assignments, template strings, and object destructuring within the function scope.&lt;/li&gt;
&lt;li&gt;Sinks: Unescaped database execution calls (&lt;code&gt;db.raw&lt;/code&gt;, &lt;code&gt;query()&lt;/code&gt;), shell executions (&lt;code&gt;exec&lt;/code&gt;, &lt;code&gt;spawn&lt;/code&gt;), and filesystem operations (&lt;code&gt;fs.readFile&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;Sanitizers: Validating functions that cleanse taint (such as parameterized queries or validator schemas).&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Inspection Example
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;tokencap analyze security
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;CLI Output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Inspecting 62 route handlers for static taint flow...
[WARNING] Potential SQL Injection Sink:
  - Source: req.query.filter (src/api/users.js:34)
  - Taint Path: filter -&amp;gt; rawFilterClause -&amp;gt; queryStr
  - Sink: db.raw(queryStr) (src/api/users.js:48)
  - Recommendation: Use parameterized binding (:filter) or validate through zod schema.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This security finding is embedded into &lt;code&gt;.tokencap/risk-map.md&lt;/code&gt;, alerting any coding agent working on &lt;code&gt;src/api/users.js&lt;/code&gt; to avoid raw string concatenation.&lt;/p&gt;

&lt;p&gt;Read our security architecture at tokencap.vansharora.app&lt;/p&gt;

</description>
      <category>ai</category>
      <category>devtools</category>
      <category>vscode</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Linking SQL DDL and GraphQL Schemas Directly to Code Entities in TokenCap</title>
      <dc:creator>VANSH ARORA</dc:creator>
      <pubDate>Wed, 14 Oct 2026 12:13:02 +0000</pubDate>
      <link>https://dev.to/vansharora21/linking-sql-ddl-and-graphql-schemas-directly-to-code-entities-in-tokencap-3pae</link>
      <guid>https://dev.to/vansharora21/linking-sql-ddl-and-graphql-schemas-directly-to-code-entities-in-tokencap-3pae</guid>
      <description>&lt;p&gt;AI coding assistants frequently write SQL or ORM queries that look plausible but fail at runtime because a column was renamed from &lt;code&gt;created_at&lt;/code&gt; to &lt;code&gt;createdAt&lt;/code&gt; or a field is non-nullable.&lt;/p&gt;

&lt;p&gt;To prevent schema-to-code drift, TokenCap implements schema linking in &lt;code&gt;src/schema/schemaGraph.js&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  How Schema Intelligence Works
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;DDL Parsing: Scans &lt;code&gt;.sql&lt;/code&gt; migrations and Prisma/Drizzle schema files for &lt;code&gt;CREATE TABLE&lt;/code&gt; statements, extracting column names, types, primary keys, and foreign keys.&lt;/li&gt;
&lt;li&gt;GraphQL Schema Parsing: Extracts types, queries, and mutations from &lt;code&gt;.graphql&lt;/code&gt; files.&lt;/li&gt;
&lt;li&gt;Code Entity Linking: Maps extracted schema entities to corresponding backend model classes, Prisma calls, or repository queries.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Generated Graph Intelligence
&lt;/h3&gt;

&lt;p&gt;When TokenCap compiles &lt;code&gt;.tokencap/snapshot.md&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gu"&gt;### Schema Entity: users (Table)&lt;/span&gt;
&lt;span class="p"&gt;-&lt;/span&gt; Defined in: migrations/20260401_init_users.sql
&lt;span class="p"&gt;-&lt;/span&gt; Columns:
&lt;span class="p"&gt;  -&lt;/span&gt; id: UUID (Primary Key, NOT NULL)
&lt;span class="p"&gt;  -&lt;/span&gt; email: VARCHAR(255) (UNIQUE, NOT NULL)
&lt;span class="p"&gt;  -&lt;/span&gt; tier: VARCHAR(50) (DEFAULT 'free')
&lt;span class="p"&gt;  -&lt;/span&gt; metadata: JSONB (NULLABLE)
&lt;span class="p"&gt;-&lt;/span&gt; Referenced By Code:
&lt;span class="p"&gt;  -&lt;/span&gt; src/models/User.js: User schema definition
&lt;span class="p"&gt;  -&lt;/span&gt; src/services/auth.js: findByEmail
&lt;span class="p"&gt;  -&lt;/span&gt; src/services/billing.js: updateSubscriptionTier
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When an agent needs to add a column or modify a query, it knows the exact database constraints without asking you to upload database dumps.&lt;/p&gt;

&lt;p&gt;Learn more at tokencap.vansharora.app&lt;/p&gt;

</description>
      <category>ai</category>
      <category>devtools</category>
      <category>vscode</category>
      <category>productivity</category>
    </item>
  </channel>
</rss>
