<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Coder Legion - Recent posts tagged context</title>
<link>https://coderlegion.com/tag/context</link>
<description>Powered by Question2Answer</description>
<item>
<title>TOKENCAP V 2.7.0</title>
<link>https://coderlegion.com/27760/tokencap-v-2-7-0</link>
<description>&lt;h2 id=&quot;we-spent-months-teaching-ai-to-read-our-codebases-we-forgot-to-teach-it-how-to-remember-&quot;&gt;We Spent Months Teaching AI to Read Our Codebases. We Forgot to Teach It How to Remember.&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Every developer has had this session:&lt;/strong&gt; You spend three hours pair-programming with Claude, Cursor, or Codex. Together, you untangle a gnarly race condition in authentication, discard three plausible dead-ends, decide on an RS256 token strategy, and touch seven files. &lt;/p&gt;
&lt;p&gt;The tests finally pass. You commit the code. You close the chat tab.&lt;/p&gt;
&lt;p&gt;And in that single keystroke, &lt;strong&gt;every drop of architectural reasoning, every discarded alternative, and every piece of developer intent evaporates into thin air.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Tomorrow, when you or your teammate open a new session with the same agent in the same codebase, the model starts with complete amnesia. It doesn’t remember &lt;em&gt;why&lt;/em&gt; you avoided that library. It doesn’t know what you plan to do next. It has to re-read, re-grep, and re-hallucinate its way through your repository from scratch.&lt;/p&gt;
&lt;p&gt;As an industry, we spent the last two years obsessing over how to shove repository context &lt;em&gt;into&lt;/em&gt; the model. We wrote &lt;code&gt;AGENTS.md&lt;/code&gt;, dialed in vector embeddings, tuned token budgets, and built MCP servers. &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;We taught the agent how to read. But we completely neglected the return trip.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Today, we are releasing &lt;strong&gt;TokenCap v2.7.0 — &quot;The Loop&quot;&lt;/strong&gt;. It is built around a single engineering thesis: &lt;em&gt;a finished AI session must become a small, redacted, reviewable handoff back into the repository — without dumping raw transcripts, without surveillance telemetry, and without silent changes to your code.&lt;/em&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;the-three-hour-epiphany-that-dies-on-tab-close&quot;&gt;The Three-Hour Epiphany That Dies on Tab Close&lt;/h3&gt;
&lt;p&gt;When human engineers finish a sprint or an incident, disciplined teams write a handoff note, a PR description, or an Architecture Decision Record (ADR). It takes five minutes, and it preserves sanity for whoever touches the code next.&lt;/p&gt;
&lt;p&gt;With AI coding agents, we went in the exact opposite direction.&lt;/p&gt;
&lt;p&gt;Because LLMs feel ephemeral, we treat the conversation like scrap paper. Telemetry from engineering studies in 2026 shows that developers working with AI assistance are now juggling &lt;strong&gt;67% more task and PR contexts per day&lt;/strong&gt; than they were a year ago. Work restarts are up, and tasks sit abandoned for days because context switching between fragmented AI chats is exhausting.&lt;/p&gt;
&lt;p&gt;The problem isn't the model's intellect. The problem is that &lt;strong&gt;the conversation-to-repository loop is completely broken.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;When an AI session ends, you are forced to pick between two awful extremes:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Raw Transcript Hoarding:&lt;/strong&gt; Stashing 80,000 tokens of chat chatter, polite conversational filler, and aborted code snippets into a giant wiki or database that nobody (and no LLM) will ever afford to re-read.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Total Amnesia:&lt;/strong&gt; Closing the window and accepting that tomorrow's session will cost another $1.50 in tokens just to re-discover what you solved today.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Neither of those belongs in a serious engineering system.&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;&lt;em&gt;&quot;We gave AI agents structured documentation so they could onboard into our repos, but we left them with no mechanism to hand their work back to the team.&quot;&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;hr&gt;
&lt;h3 id=&quot;why-we-refused-to-let-models-silently-edit-your-memory&quot;&gt;Why We Refused to Let Models Silently Edit Your Memory&lt;/h3&gt;
&lt;p&gt;When we started designing the return leg of TokenCap in v2.7.0, the most common suggestion was: &lt;em&gt;&quot;Just have the model automatically update the memory files and git commit on exit.&quot;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;We explicitly refused to build that.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;AI agents hallucinate. They make optimistic claims about tests they didn't run. They invent dependencies that don't exist. If an agent can silently edit your durable repository memory or your Constitution records in the background, you haven't closed the loop — you've created a slow-motion context-poisoning machine.&lt;/p&gt;
&lt;p&gt;In TokenCap v2.7.0, session capture is governed by &lt;strong&gt;Staged Inbound Memory&lt;/strong&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Finished AI Session
       │  (POST /capture or tokencap remember)
       ▼
1. Validation &amp;amp; Hard Clamps  (max 8KB, 60 lines, path normalized)
       ▼
2. Centralized Secret Redaction  (tokens, keys, certificates stripped)
       ▼
3. Graph-Grounded Quality Scoring  (path validity, groundedness, novelty)
       ▼
`.tokencap/memory/inbound/`  ← STAGED (never silent)
       │
       ├─ tokencap remember --list
       ├─ tokencap remember --approve &amp;lt;id&amp;gt; ──► Promotes to .tokencap/memory/sessions/
       └─ tokencap remember --reject &amp;lt;id&amp;gt;  ──► Audited, never enters memory
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Nothing modifies durable project memory until a human developer types &lt;code&gt;tokencap remember --approve&lt;/code&gt;. It is reviewable, provenance-stamped, and 100% deterministic.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;scoring-grounding-not-truth-&quot;&gt;Scoring Grounding, Not &quot;Truth&quot;&lt;/h3&gt;
&lt;p&gt;One of the hardest engineering challenges in v2.7.0 was designing the quality gate. How do you evaluate whether a session summary written by an AI is safe to ingest?&lt;/p&gt;
&lt;p&gt;Most tools attempt to use a secondary LLM to judge the first LLM. That adds cost, latency, non-determinism, and network egress.&lt;/p&gt;
&lt;p&gt;TokenCap does something fundamentally different: &lt;strong&gt;we score grounding against your local AST knowledge graph.&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Path Validity:&lt;/strong&gt; Did the summary reference files that actually exist in the git tree?&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Groundedness:&lt;/strong&gt; When the summary claims it changed &lt;code&gt;validateToken&lt;/code&gt;, does that symbol actually exist in the AST of &lt;code&gt;src/auth.ts&lt;/code&gt;?&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Specificity:&lt;/strong&gt; Does the summary mention concrete functions, files, and architectural decisions, or is it vague filler like &lt;em&gt;&quot;refactored code and fixed issues&quot;&lt;/em&gt;?&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Novelty:&lt;/strong&gt; Does this duplicate a session that was already approved yesterday?&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;We don't claim to evaluate the philosophical &quot;truth&quot; of an agent's reasoning. We evaluate &lt;strong&gt;whether the agent's summary is structurally anchored to the ground truth of your code.&lt;/strong&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;build-health-because-40-of-agent-failures-are-rotten-context&quot;&gt;Build Health: Because 40% of Agent Failures Are Rotten Context&lt;/h3&gt;
&lt;p&gt;If you hand an agent a 2-week-old context snapshot while your git working tree has 14 uncommitted changes and unmapped files, the agent will hallucinate. Then developers blame the model.&lt;/p&gt;
&lt;p&gt;In v2.7.0, we introduced &lt;strong&gt;Repository Build Health (&lt;code&gt;tokencap health&lt;/code&gt;)&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Instead of guessing whether your context layer is trustworthy, TokenCap computes an explainable &lt;strong&gt;0–100 health score&lt;/strong&gt; before every session:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;$ tokencap health

Build health: 94/100 · built 1.2h ago
  100  freshness — built 1h ago
   90  sourceDrift — 1 uncommitted change since build
   95  detection — Node.js, TypeScript, Next.js detected
   90  coverage — 3/3 intelligence layers present

Remediation:
  [low] 1 uncommitted file in src/auth/ -&amp;gt; run `tokencap make`
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;If your build health drops, TokenCap doesn't fail silently. It prints exact, copy-pasteable remediation steps (&lt;code&gt;tokencap rebuild&lt;/code&gt;) and surfaces the health factor directly into MCP tools like &lt;code&gt;tokencap_overview&lt;/code&gt;.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;honest-host-adapters-no-fake-auto-capture-&quot;&gt;Honest Host Adapters (No Fake &quot;Auto-Capture&quot;)&lt;/h3&gt;
&lt;p&gt;Every AI tooling company loves to put logos on their landing page and claim &lt;em&gt;&quot;Works seamlessly with every host!&quot;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;We took the opposite path in v2.7.0.&lt;/p&gt;
&lt;p&gt;Run &lt;code&gt;tokencap remember --hosts&lt;/code&gt; in your terminal today:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;&lt;th align=&quot;left&quot;&gt;Host &lt;/th&gt;&lt;th align=&quot;left&quot;&gt;Capture Level &lt;/th&gt;&lt;th align=&quot;left&quot;&gt;Honest Reality&lt;/th&gt;&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;&lt;td align=&quot;left&quot;&gt;&lt;strong&gt;Claude Code&lt;/strong&gt; &lt;/td&gt;&lt;td align=&quot;left&quot;&gt;Assisted &lt;/td&gt;&lt;td align=&quot;left&quot;&gt;Hooks exist, but session-end lacks a reliable native hook. Falls back to &lt;code&gt;remember&lt;/code&gt;.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align=&quot;left&quot;&gt;&lt;strong&gt;Cursor&lt;/strong&gt; &lt;/td&gt;&lt;td align=&quot;left&quot;&gt;Manual / CLI &lt;/td&gt;&lt;td align=&quot;left&quot;&gt;Background extension cannot observe chat window termination.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align=&quot;left&quot;&gt;&lt;strong&gt;Windsurf&lt;/strong&gt; &lt;/td&gt;&lt;td align=&quot;left&quot;&gt;Manual / CLI &lt;/td&gt;&lt;td align=&quot;left&quot;&gt;Extension sandbox does not provide conversation-end lifecycle hooks.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align=&quot;left&quot;&gt;&lt;strong&gt;Antigravity&lt;/strong&gt; &lt;/td&gt;&lt;td align=&quot;left&quot;&gt;Native MCP &lt;/td&gt;&lt;td align=&quot;left&quot;&gt;Discovers staged inbound memories; manual review preserved.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align=&quot;left&quot;&gt;&lt;strong&gt;Codex&lt;/strong&gt; &lt;/td&gt;&lt;td align=&quot;left&quot;&gt;Assisted &lt;/td&gt;&lt;td align=&quot;left&quot;&gt;Staged review via CLI; never auto-committed.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;We refuse to mark any host as &quot;automatic&quot; unless there is a verified, un-fakable session-end signal. An MCP process shutting down is &lt;strong&gt;not&lt;/strong&gt; a conversation end — it's often just an editor reloading a window. Treating process kills as session saves corrupts repositories. TokenCap tells you the truth about what each host can and cannot do.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;closing-the-loop-without-giving-away-your-sovereignty&quot;&gt;Closing the Loop Without Giving Away Your Sovereignty&lt;/h3&gt;
&lt;p&gt;The easiest way to build session memory would have been to spin up a SaaS cloud, ask you to paste an API key, upload your chat logs to an external database, and charge you $20/month per seat.&lt;/p&gt;
&lt;p&gt;TokenCap v2.7.0 sticks strictly to our Four Laws:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Zero Network Egress:&lt;/strong&gt; 100% of computation — the AST graphs, the secret redactions, the health scores, the staging engine — runs on your CPU. Not a single byte leaves &lt;code&gt;127.0.0.1&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Strictly 4 Dependencies:&lt;/strong&gt; Zero native compilation toolchains. Pure Tree-sitter WebAssembly.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Budget-Capped:&lt;/strong&gt; The latest approved session handoff (&lt;code&gt;tokencap handoff&lt;/code&gt;) is formatted into clean, tight Markdown that fits comfortably in under 800 tokens.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Local Sovereignty:&lt;/strong&gt; Your code, your memories, and your architectural intent stay inside &lt;code&gt;.tokencap/&lt;/code&gt; in your git repository.&lt;/li&gt;
&lt;/ol&gt;
&lt;hr&gt;
&lt;h3 id=&quot;get-started-with-v2-7-0&quot;&gt;Get Started with v2.7.0&lt;/h3&gt;
&lt;p&gt;TokenCap v2.7.0 is available on npm today.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Update globally
npm install -g tokencap

# Check repository build health
tokencap health

# Capture your first session summary
tokencap remember --summary &quot;Reworked auth middleware to JWT&quot; --files src/auth.ts --decision &quot;Used RS256 with 15m expiration&quot;

# Review staged captures
tokencap remember --list
tokencap remember --approve &amp;lt;session-id&amp;gt;

# Export the handoff note for your next AI session
tokencap handoff
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Stop teaching every AI your codebase from scratch. Close the loop.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;&lt;em&gt;TokenCap is an open-source, local-first context layer for AI coding agents.&lt;/em&gt;&lt;br&gt;
&lt;strong&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://tokencap.vansharora.app&quot;&gt;Website&lt;/a&gt;&lt;/strong&gt; · &lt;strong&gt;[GitHub]&lt;br&gt;
(&lt;a rel=&quot;nofollow&quot; href=&quot;https://tokencap.vansharora.app/docs&quot;&gt;https://tokencap.vansharora.app/docs&lt;/a&gt;)&lt;/strong&gt;&lt;/p&gt;
</description>
<category>Articles</category>
<guid isPermaLink="true">https://coderlegion.com/27760/tokencap-v-2-7-0</guid>
<pubDate>Sat, 19 Sep 2026 16:47:28 +0000</pubDate>
</item>
<item>
<title>TokenCap v2.3.0 is live.</title>
<link>https://coderlegion.com/25868/tokencap-v2-3-0-is-live</link>
<description>&lt;p&gt;This release is about something I think AI coding tools are missing: a safe floor.&lt;/p&gt;
&lt;p&gt;For months, I kept seeing the same failure mode.&lt;/p&gt;
&lt;p&gt;You give an AI agent a refactoring task.&lt;/p&gt;
&lt;p&gt;It renames a function.--&amp;gt;Breaks 11 files.--&amp;gt;Ships the change.&lt;/p&gt;
&lt;p&gt;You spend the next 3 hours undoing it.&lt;/p&gt;
&lt;p&gt;The problem isn't always that the AI is &quot;dumb.&quot;&lt;/p&gt;
&lt;p&gt;The problem is that it is allowed to make changes without deterministic safety guarantees.&lt;/p&gt;
&lt;p&gt;So in v2.3.0, we built those guarantees into TokenCap.&lt;/p&gt;
&lt;p&gt;TokenCap doesn't run your test suite.&lt;/p&gt;
&lt;p&gt;Instead, it analyzes the AST call graph and identifies symbols with zero detected test coverage before you modify them.&lt;/p&gt;
&lt;p&gt;No test runner.&lt;br&gt;
No network.&lt;br&gt;
No build pipeline.&lt;/p&gt;
&lt;p&gt;This is the direction I'm taking TokenCap in.&lt;/p&gt;
&lt;p&gt;Not another wrapper around an LLM.&lt;/p&gt;
&lt;p&gt;Not another cloud service.&lt;/p&gt;
&lt;p&gt;Not &quot;AI for your codebase.&quot;&lt;/p&gt;
&lt;p&gt;TokenCap is becoming deterministic infrastructure around AI-assisted development, designed to make AI coding agents safer to run.&lt;/p&gt;
&lt;p&gt;v2.3.0 shipped with 82 tests, all green.&lt;/p&gt;
&lt;p&gt;Install it:&lt;/p&gt;
&lt;p&gt;npm install -g tokencap&lt;/p&gt;
&lt;p&gt;Website: &lt;a rel=&quot;nofollow&quot; href=&quot;https://tokencap.vansharora.app&quot;&gt;https://tokencap.vansharora.app&lt;/a&gt;&lt;br&gt;
GitHub: &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/vansharora21/tokencap&quot;&gt;https://github.com/vansharora21/tokencap&lt;/a&gt;&lt;br&gt;
npm: &lt;a rel=&quot;nofollow&quot; href=&quot;https://www.npmjs.com/package/tokencap&quot;&gt;https://www.npmjs.com/package/tokencap&lt;/a&gt;&lt;br&gt;
VS Code Marketplace: &lt;a rel=&quot;nofollow&quot; href=&quot;https://marketplace.visualstudio.com/items?itemName=VanshArora21.tokencap&quot;&gt;https://marketplace.visualstudio.com/items?itemName=VanshArora21.tokencap&lt;/a&gt;&lt;br&gt;
Open VSX: &lt;a rel=&quot;nofollow&quot; href=&quot;https://open-vsx.org/extension/VanshArora21/tokencap&quot;&gt;https://open-vsx.org/extension/VanshArora21/tokencap&lt;/a&gt;&lt;/p&gt;
&lt;h2 id=&quot;tokencap-opensource-developertools-ai-aicoding-refactoring-typescript-javascript-softwaredevelopment-buildinpublic&quot;&gt;TokenCap #OpenSource #DeveloperTools #AI #AICoding #Refactoring #TypeScript #JavaScript #SoftwareDevelopment #BuildInPublic&lt;/h2&gt;
</description>
<category>Articles</category>
<guid isPermaLink="true">https://coderlegion.com/25868/tokencap-v2-3-0-is-live</guid>
<pubDate>Sun, 30 Aug 2026 17:34:53 +0000</pubDate>
</item>
<item>
<title>TokenCap v2.1.0 is out.</title>
<link>https://coderlegion.com/24796/tokencap-v2-1-0-is-out</link>
<description>&lt;p&gt;This release is focused on one idea:&lt;/p&gt;
&lt;p&gt;Give AI coding agents better context, while reducing the amount of unnecessary context they need.&lt;/p&gt;
&lt;p&gt;When working across Claude Code, Cursor, Windsurf, Copilot, Cline, Antigravity, and other coding agents, a lot of tokens are wasted repeatedly discovering the same repository structure, reading the same files, and rebuilding context.&lt;/p&gt;
&lt;p&gt;TokenCap is built to solve that.&lt;/p&gt;
&lt;p&gt;What’s new in v2.1.0:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Code Simplification&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;tokencap analyze simplify&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Find unreachable code, duplicate logic, unnecessary abstractions, and reinvention patterns across JS/TS with evidence and confidence levels.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Context Compression&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;tokencap compress&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Compress &lt;code&gt;CLAUDE.md&lt;/code&gt;, &lt;code&gt;AGENTS.md&lt;/code&gt;, &lt;code&gt;.cursorrules&lt;/code&gt;, and similar context files while preserving headings, code fences, links, and URLs.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Token Savings&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;tokencap stats&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Track how much context and tokens you actually save across runs.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Debt Ledger&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;tokencap debt&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Track TODOs, FIXMEs, and deferred shortcuts without relying on expensive git blame operations.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;MCP v2&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Expose repository overviews, symbol impact, call graphs, and delta diffs directly to MCP-compatible agents and IDEs.&lt;/p&gt;
&lt;p&gt;Also crossed &lt;strong&gt;2,500+ installs on the VS Code Marketplace&lt;/strong&gt;, which is honestly pretty cool to see for an open source project I started building for my own workflow.&lt;/p&gt;
&lt;p&gt;The idea behind TokenCap is simple:&lt;/p&gt;
&lt;p&gt;Your AI coding agent should not have to rediscover your codebase every time you start a session.&lt;/p&gt;
&lt;p&gt;Website:&lt;br&gt;
&lt;a rel=&quot;nofollow&quot; href=&quot;https://tokencap.vansharora.app&quot;&gt;https://tokencap.vansharora.app&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;VS Code Marketplace:&lt;br&gt;
&lt;a rel=&quot;nofollow&quot; href=&quot;https://marketplace.visualstudio.com/items?itemName=tokencap.tokencap&quot;&gt;https://marketplace.visualstudio.com/items?itemName=tokencap.tokencap&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;GitHub:&lt;br&gt;
&lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/vansharora21/tokencap-plugin&quot;&gt;https://github.com/vansharora21/tokencap-plugin&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Install:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;npx tokencap make
&lt;/code&gt;&lt;/pre&gt;
</description>
<category>Articles</category>
<guid isPermaLink="true">https://coderlegion.com/24796/tokencap-v2-1-0-is-out</guid>
<pubDate>Mon, 17 Aug 2026 17:31:28 +0000</pubDate>
</item>
<item>
<title>TokenCap is officially live on Product Hunt.</title>
<link>https://coderlegion.com/24398/tokencap-is-officially-live-on-product-hunt</link>
<description>&lt;p&gt;After months of building, iterating, breaking things, and shipping, I’m excited to finally launch TokenCap on Product Hunt.&lt;/p&gt;
&lt;p&gt;TokenCap helps AI coding agents work with codebases more efficiently by generating graph-ranked, token-budgeted context  so agents spend less time rediscovering the codebase and more time actually building.&lt;/p&gt;
&lt;p&gt;We’ve already crossed 2.1K installs on Open VSX, and this launch is the next step in taking TokenCap further.&lt;/p&gt;
&lt;p&gt;If you build with AI coding agents, I’d love for you to check it out, try it, and share your feedback.&lt;/p&gt;
&lt;p&gt;We’re live on Product Hunt today.&lt;/p&gt;
&lt;p&gt;Your support would mean a lot.&lt;/p&gt;
&lt;p&gt;Links:&lt;/p&gt;
&lt;p&gt;Product Hunt&lt;br&gt;
&lt;a rel=&quot;nofollow&quot; href=&quot;https://www.producthunt.com/products/tokencap-2?launch=tokencap-2&quot;&gt;https://www.producthunt.com/products/tokencap-2?launch=tokencap-2&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Website&lt;br&gt;
&lt;a rel=&quot;nofollow&quot; href=&quot;https://tokencap.vansharora.app&quot;&gt;https://tokencap.vansharora.app&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;NPM&lt;br&gt;
&lt;a rel=&quot;nofollow&quot; href=&quot;https://www.npmjs.com/package/tokencap&quot;&gt;https://www.npmjs.com/package/tokencap&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;VS Code Extension&lt;br&gt;
&lt;a rel=&quot;nofollow&quot; href=&quot;https://marketplace.visualstudio.com/items?itemName=VanshArora.tokencap&quot;&gt;https://marketplace.visualstudio.com/items?itemName=VanshArora.tokencap&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Open VSX&lt;br&gt;
&lt;a rel=&quot;nofollow&quot; href=&quot;https://open-vsx.org/extension/VanshArora/tokencap&quot;&gt;https://open-vsx.org/extension/VanshArora/tokencap&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;GitHub Plugins&lt;br&gt;
&lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/vansharora21/tokencap-plugin&quot;&gt;https://github.com/vansharora21/tokencap-plugin&lt;/a&gt;&lt;/p&gt;
</description>
<category>Articles</category>
<guid isPermaLink="true">https://coderlegion.com/24398/tokencap-is-officially-live-on-product-hunt</guid>
<pubDate>Mon, 10 Aug 2026 17:30:21 +0000</pubDate>
</item>
<item>
<title>Why Your AI Assistant Gets Lost in Large Repositories</title>
<link>https://coderlegion.com/19643/why-your-ai-assistant-gets-lost-in-large-repositories</link>
<description>&lt;p&gt;AI coding assistants are impressive.&lt;/p&gt;
&lt;p&gt;They can:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Generate code&lt;/li&gt;
&lt;li&gt;Explain functions&lt;/li&gt;
&lt;li&gt;Write tests&lt;/li&gt;
&lt;li&gt;Refactor components&lt;/li&gt;
&lt;li&gt;Answer technical questions&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For small projects, they often feel magical.&lt;/p&gt;
&lt;p&gt;But something interesting happens when the repository gets bigger.&lt;/p&gt;
&lt;p&gt;Really big.&lt;/p&gt;
&lt;p&gt;Think:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Monorepos&lt;/li&gt;
&lt;li&gt;Enterprise applications&lt;/li&gt;
&lt;li&gt;Legacy systems&lt;/li&gt;
&lt;li&gt;Multi-service architectures&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Suddenly, your AI assistant starts giving strange answers.&lt;/p&gt;
&lt;p&gt;And you find yourself thinking:&lt;/p&gt;
&lt;p&gt; &quot;Wait... that's not how our system works.&quot;&lt;/p&gt;
&lt;p&gt;So what changed?&lt;/p&gt;
&lt;p&gt;Let's find out.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;the-problem-isn-t-intelligence&quot;&gt;The Problem Isn't Intelligence&lt;/h3&gt;
&lt;p&gt;Most people assume:&lt;/p&gt;
&lt;p&gt; AI gave the wrong answer because it isn't smart enough.&lt;/p&gt;
&lt;p&gt;In reality, that's usually not the problem.&lt;/p&gt;
&lt;p&gt;The real issue is:&lt;/p&gt;
&lt;p&gt; Lack of context.&lt;/p&gt;
&lt;p&gt;AI can understand code.&lt;/p&gt;
&lt;p&gt;But understanding an entire software system is a completely different challenge.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;large-repositories-are-more-than-files&quot;&gt;Large Repositories Are More Than Files&lt;/h3&gt;
&lt;p&gt;Imagine a repository with:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;5,000+ files&lt;/li&gt;
&lt;li&gt;Hundreds of APIs&lt;/li&gt;
&lt;li&gt;Shared libraries&lt;/li&gt;
&lt;li&gt;Multiple services&lt;/li&gt;
&lt;li&gt;Years of engineering decisions&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Now ask:&lt;/p&gt;
&lt;p&gt; &quot;How does user onboarding work?&quot;&lt;/p&gt;
&lt;p&gt;The answer may involve:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Frontend code&lt;/li&gt;
&lt;li&gt;Backend services&lt;/li&gt;
&lt;li&gt;Authentication flows&lt;/li&gt;
&lt;li&gt;Event queues&lt;/li&gt;
&lt;li&gt;Databases&lt;/li&gt;
&lt;li&gt;Third-party integrations&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The logic is spread across dozens of files.&lt;/p&gt;
&lt;p&gt;Maybe hundreds.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;search-is-not-understanding&quot;&gt;Search Is Not Understanding&lt;/h3&gt;
&lt;p&gt;Many AI tools work by finding relevant files and code snippets.&lt;/p&gt;
&lt;p&gt;That helps.&lt;/p&gt;
&lt;p&gt;But there's a problem.&lt;/p&gt;
&lt;p&gt;Finding something is not the same as understanding it.&lt;/p&gt;
&lt;p&gt;For example:&lt;/p&gt;
&lt;p&gt;You search for:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-text&quot;&gt;createUser()
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;You find 15 references.&lt;/p&gt;
&lt;p&gt;Great.&lt;/p&gt;
&lt;p&gt;But now you need to know:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Which one is actually used?&lt;/li&gt;
&lt;li&gt;What service calls it?&lt;/li&gt;
&lt;li&gt;What happens afterward?&lt;/li&gt;
&lt;li&gt;What dependencies exist?&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Suddenly:&lt;/p&gt;
&lt;p&gt; Search results are not enough.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;software-lives-in-relationships&quot;&gt;Software Lives in Relationships&lt;/h3&gt;
&lt;p&gt;Large systems are built from relationships.&lt;/p&gt;
&lt;p&gt;Examples:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Service A depends on Service B&lt;/li&gt;
&lt;li&gt;Component X triggers Event Y&lt;/li&gt;
&lt;li&gt;API Z updates Database Q&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;These connections matter.&lt;/p&gt;
&lt;p&gt;And often they are more important than individual files.&lt;/p&gt;
&lt;p&gt;That's where understanding becomes difficult.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;the-context-window-problem&quot;&gt;The Context Window Problem&lt;/h3&gt;
&lt;p&gt;Another challenge is scale.&lt;/p&gt;
&lt;p&gt;AI models have limited context windows.&lt;/p&gt;
&lt;p&gt;Even when those limits are large...&lt;/p&gt;
&lt;p&gt;Enterprise repositories are often larger.&lt;/p&gt;
&lt;p&gt;Much larger.&lt;/p&gt;
&lt;p&gt;A repository might contain:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Millions of lines of code&lt;/li&gt;
&lt;li&gt;Years of commits&lt;/li&gt;
&lt;li&gt;Thousands of dependencies&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;No AI can load everything at once.&lt;/p&gt;
&lt;p&gt;So it must choose.&lt;/p&gt;
&lt;p&gt;And sometimes it chooses the wrong context.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;why-ai-hallucinates-in-large-codebases&quot;&gt;Why AI Hallucinates in Large Codebases&lt;/h3&gt;
&lt;p&gt;This creates a common situation.&lt;/p&gt;
&lt;p&gt;AI sees:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Some files&lt;/li&gt;
&lt;li&gt;Partial relationships&lt;/li&gt;
&lt;li&gt;Incomplete architecture&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Then tries to fill in the gaps.&lt;/p&gt;
&lt;p&gt;Sometimes correctly.&lt;/p&gt;
&lt;p&gt;Sometimes not.&lt;/p&gt;
&lt;p&gt;That's why you may get answers that look reasonable...&lt;/p&gt;
&lt;p&gt;But are completely wrong for your project.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;why-developers-spend-more-time-understanding-than-coding&quot;&gt;Why Developers Spend More Time Understanding Than Coding&lt;/h3&gt;
&lt;p&gt;In large systems, the hardest task is often not writing code.&lt;/p&gt;
&lt;p&gt;It's understanding:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Existing architecture&lt;/li&gt;
&lt;li&gt;Service dependencies&lt;/li&gt;
&lt;li&gt;Data flow&lt;/li&gt;
&lt;li&gt;Historical decisions&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This is true for humans.&lt;/p&gt;
&lt;p&gt;And it's true for AI.&lt;/p&gt;
&lt;p&gt;Before changing code, you must understand the system.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;the-missing-piece-repository-memory&quot;&gt;The Missing Piece: Repository Memory&lt;/h3&gt;
&lt;p&gt;This is why concepts like:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Repository Memory&lt;/li&gt;
&lt;li&gt;Knowledge Graphs&lt;/li&gt;
&lt;li&gt;Code Graphs&lt;/li&gt;
&lt;li&gt;Architectural Maps&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;are becoming more important.&lt;/p&gt;
&lt;p&gt;Instead of treating code as isolated files...&lt;/p&gt;
&lt;p&gt;They treat the repository as a connected system.&lt;/p&gt;
&lt;p&gt;Now AI can understand:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Relationships&lt;/li&gt;
&lt;li&gt;Dependencies&lt;/li&gt;
&lt;li&gt;Data flow&lt;/li&gt;
&lt;li&gt;Architecture&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Not just raw code.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;-why-tools-like-graphify-exist&quot;&gt;⚙️ Why Tools Like Graphify Exist&lt;/h3&gt;
&lt;p&gt;As repositories grow, developers face a new challenge:&lt;/p&gt;
&lt;p&gt; Knowing where things are is not enough.&lt;/p&gt;
&lt;p&gt;You need to know:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;How things connect&lt;/li&gt;
&lt;li&gt;Why they exist&lt;/li&gt;
&lt;li&gt;What depends on them&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Tools that build repository memory help solve this problem.&lt;/p&gt;
&lt;p&gt;They transform:&lt;/p&gt;
&lt;p&gt;Files → Knowledge&lt;/p&gt;
&lt;p&gt;And that's a big difference.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;the-future-of-ai-coding&quot;&gt;The Future of AI Coding&lt;/h3&gt;
&lt;p&gt;The next challenge for AI isn't generating code.&lt;/p&gt;
&lt;p&gt;It's understanding systems.&lt;/p&gt;
&lt;p&gt;Because real-world software is rarely about a single file.&lt;/p&gt;
&lt;p&gt;It's about:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Architecture&lt;/li&gt;
&lt;li&gt;Relationships&lt;/li&gt;
&lt;li&gt;Context&lt;/li&gt;
&lt;li&gt;Decisions&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;And those things don't fit neatly into a search result.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;final-thought&quot;&gt;Final Thought&lt;/h3&gt;
&lt;p&gt;Your AI assistant isn't getting confused because the repository is large.&lt;/p&gt;
&lt;p&gt;It's getting confused because software isn't just code.&lt;/p&gt;
&lt;p&gt;It's a network of relationships, dependencies, and decisions built over time.&lt;/p&gt;
&lt;p&gt;And until AI understands those connections...&lt;/p&gt;
&lt;p&gt;It will always struggle in large repositories.&lt;/p&gt;
&lt;p&gt;Because reading code is one thing.&lt;/p&gt;
&lt;p&gt; Understanding a system is another.&lt;/p&gt;
&lt;h2 id=&quot;ai-softwareengineering-monorepo-developertools-codebase-llm-aiassistants-architecture-graphify-programming&quot;&gt;AI #SoftwareEngineering #Monorepo #DeveloperTools #Codebase #LLM #AIAssistants #Architecture #Graphify #Programming&lt;/h2&gt;
</description>
<category>Articles</category>
<guid isPermaLink="true">https://coderlegion.com/19643/why-your-ai-assistant-gets-lost-in-large-repositories</guid>
<pubDate>Thu, 04 Jun 2026 07:28:08 +0000</pubDate>
</item>
<item>
<title>[Explained] Cannot read property 'setstate' of undefined / Needs improvements</title>
<link>https://coderlegion.com/17385/explained-cannot-read-property-setstate-of-undefined-needs-improvements</link>
<description>&lt;p&gt;You may have encountered the error &quot;&lt;strong&gt;Cannot read property 'setstate' of undefined&quot;&lt;/strong&gt; while working with &lt;strong&gt;react&lt;/strong&gt; when dealing with &lt;strong&gt;context&lt;/strong&gt;.  Wrong understanding of &lt;strong&gt;context&lt;/strong&gt; especially in &lt;strong&gt;javascript classes&lt;/strong&gt; will result in the error above especially when dealing with the&quot;&lt;strong&gt;this&lt;/strong&gt;&quot; keyword in javascript class methods. This error can be solved by either introducing the &quot;&lt;strong&gt;bind&lt;/strong&gt;&quot; method in the &lt;strong&gt;class constructor&lt;/strong&gt; or replacing the function with an &lt;strong&gt;arrow function&lt;/strong&gt;.In this Post we will go over the causes of this error and how to fix it using relevant examples.&lt;/p&gt;
&lt;div id=&quot;toc-div&quot;&gt;
&lt;h4&gt;&lt;span style=&quot;font-family: arial,helvetica,sans-serif;&quot;&gt;&lt;strong&gt;Â Table of Contents: &lt;a id=&quot;toc-toogle&quot; class=&quot;open&quot;&gt;&lt;/a&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/h4&gt;
&lt;div id=&quot;toc-list&quot;&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;#what&quot;&gt;&lt;span style=&quot;font-family: arial,helvetica,sans-serif;&quot;&gt;uncaught TypeError: 'Cannot read properties of undefined (reading 'setState') (Explanation)&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;#why&quot;&gt;&lt;span style=&quot;font-family: arial,helvetica,sans-serif;&quot;&gt;Reasons that will cause this error.&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;#sol&quot;&gt;&lt;span style=&quot;font-family: arial,helvetica,sans-serif;&quot;&gt;The Solution&lt;/span&gt;&lt;/a&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;#sol1&quot;&gt;&lt;span style=&quot;font-family: arial,helvetica,sans-serif;&quot;&gt;Solution one&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;#sol2&quot;&gt;&lt;span style=&quot;font-family: arial,helvetica,sans-serif;&quot;&gt;Solution two&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;#con&quot;&gt;&lt;span style=&quot;font-family: arial,helvetica,sans-serif;&quot;&gt;The Conclusion&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: arial,helvetica,sans-serif;&quot;&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;#ref&quot;&gt;References &lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;section&gt;&lt;a id=&quot;what&quot; class=&quot;custom_anchor&quot;&gt;&lt;/a&gt;
&lt;h2&gt;&lt;span style=&quot;font-family: arial,helvetica,sans-serif;&quot;&gt;&lt;strong&gt;Uncaught TypeError: Cannot read properties of undefined (reading 'setState') (Explanation)&lt;/strong&gt;&lt;/span&gt;&lt;strong&gt;&lt;a id=&quot;TypeError-str-object&quot; style=&quot;color: blue;&quot; rel=&quot;nofollow&quot; href=&quot;#what&quot;&gt;#&lt;/a&gt;&lt;/strong&gt;&lt;/h2&gt;
&lt;p&gt;&lt;span style=&quot;font-family: arial,helvetica,sans-serif;&quot;&gt;To better understand this problem, let us analyze the error message. New react programmers who don't understand &lt;strong&gt;javascript context&lt;/strong&gt; will most probably encounter this error while using classes  while writing react code. This normally happens when trying to access the &quot;&lt;strong&gt;this&lt;/strong&gt;&quot; keyword inside a method that  has not been &lt;strong&gt;bounded&lt;/strong&gt; to it in terms of the &lt;strong&gt;keyword's  context&lt;/strong&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style=&quot;font-family: arial,helvetica,sans-serif;&quot;&gt;To better understand this lets look at an example&lt;/span&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;
&lt;span style=&quot;font-family: arial,helvetica,sans-serif;&quot;&gt;import React, {Component} from 'react'&lt;br&gt;&lt;br&gt;
class App extends Component{&lt;br&gt;
    constructor(props);{&lt;br&gt;
     super(props)&lt;br&gt;
     this.state = {&lt;br&gt;
     username: &quot;anonymous&quot;,&lt;br&gt;
     }&lt;br&gt;   
    }&lt;br&gt;&lt;br&gt;
    updateUsername(){&lt;br&gt;
    // the bellow code will raise the error because this is undefined inside this method&lt;br&gt;
     this.setState({username: &quot;admin&quot;})&lt;br&gt;
    }&lt;br&gt;&lt;br&gt;
    render(){&lt;br&gt;
     console.log(this.state.username);&lt;br&gt;
     return (&lt;br&gt;     
      &lt;br&gt;
       &lt;button&gt; click to update &lt;/button&gt;&lt;br&gt;
      &lt;br&gt;
     )&lt;br&gt;
    }&lt;br&gt;
}&lt;br&gt;
export default App; &lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;div class=&quot;div-purple&quot;&gt;&lt;span class=&quot;alert-header&quot;&gt;NOTE:&lt;/span&gt; &lt;span class=&quot;alert-body&quot;&gt;.in the above example we have created an &lt;strong&gt;updateUsername&lt;/strong&gt; method which we has not bounded the &lt;strong&gt;context&lt;/strong&gt; of the &lt;strong&gt;keyword&lt;/strong&gt; &quot;&lt;strong&gt;this&lt;/strong&gt;&quot; &lt;/span&gt;&lt;/div&gt;
&lt;p&gt;In the above code since the method has not been bounded to the this keyword it results to &lt;strong&gt;undefined&lt;/strong&gt;  which raises the error as shown below.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;
&lt;span style=&quot;font-family: arial,helvetica,sans-serif;&quot;&gt;$ Uncaught TypeError: cannot read properties of undefined (reading 'setState') &lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/section&gt;
&lt;section&gt;&lt;a id=&quot;why&quot; class=&quot;custom_anchor&quot;&gt;&lt;/a&gt;
&lt;h2&gt;&lt;span style=&quot;font-family: arial,helvetica,sans-serif;&quot;&gt;&lt;strong&gt;Reasons that will cause this error &lt;/strong&gt;&lt;/span&gt;&lt;strong&gt;&lt;a id=&quot;reasons-that-will-cause&quot; style=&quot;color: blue;&quot; rel=&quot;nofollow&quot; href=&quot;#why&quot;&gt;#&lt;/a&gt;&lt;/strong&gt;&lt;/h2&gt;
&lt;p&gt;&lt;span style=&quot;font-family: arial,helvetica,sans-serif;&quot;&gt;The js react error will be raised when context to &lt;strong&gt;this&lt;/strong&gt; keyword is &lt;strong&gt;not properly bounded &lt;/strong&gt;to a class method. From the example above it is clear that the error is as a result of the this keyword returing &quot;&lt;strong&gt;undefined&lt;/strong&gt;&quot; as a value and we clearly know that &quot;&lt;strong&gt;undefined&lt;/strong&gt;&quot; has no &lt;strong&gt;property&lt;/strong&gt; &lt;strong&gt;setState&lt;/strong&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;div class=&quot;div-pink&quot;&gt;&lt;span class=&quot;alert-header&quot;&gt;Caution:&lt;/span&gt; &lt;span class=&quot;alert-body&quot;&gt;trying to access property setState of &quot;undefined&quot; variable will result to an error. It is illegal in the javascript syntax.&lt;/span&gt;&lt;/div&gt;
&lt;/section&gt;
&lt;section&gt;&lt;a id=&quot;sol&quot; class=&quot;custom_anchor&quot;&gt;&lt;/a&gt;
&lt;h2&gt;&lt;span style=&quot;font-family: arial,helvetica,sans-serif;&quot;&gt;&lt;strong&gt;The Solution &lt;/strong&gt;&lt;/span&gt;&lt;strong&gt;&lt;a id=&quot;the-solution&quot; style=&quot;color: blue;&quot; rel=&quot;nofollow&quot; href=&quot;#sol&quot;&gt;#&lt;/a&gt;&lt;/strong&gt;&lt;/h2&gt;
&lt;p&gt;&lt;span style=&quot;font-family: arial,helvetica,sans-serif;&quot;&gt;First of all it is essential to understand  javascript context using classes which in turn will make it  easier to avoid all sorts of context issues.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style=&quot;font-family: arial,helvetica,sans-serif;&quot;&gt;To solve this problem we can replace the &lt;strong&gt;updateUsername&lt;/strong&gt; function  to using an arrow function which will solve your issues automatically.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style=&quot;font-family: arial,helvetica,sans-serif;&quot;&gt;The other way is by using the &lt;strong&gt;bind&lt;/strong&gt; method on the &lt;strong&gt;constructor&lt;/strong&gt; &lt;strong&gt;function&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style=&quot;font-family: arial,helvetica,sans-serif;&quot;&gt;Lets see how we can do this below&lt;/span&gt;&lt;/p&gt;
&lt;/section&gt;
&lt;section&gt;&lt;a id=&quot;sol1&quot; class=&quot;custom_anchor&quot;&gt;&lt;/a&gt;
&lt;h3&gt;&lt;span style=&quot;font-family: arial,helvetica,sans-serif;&quot;&gt;&lt;strong&gt;Solution one(Arrow Function)&lt;/strong&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;p&gt;&lt;span style=&quot;font-family: arial,helvetica,sans-serif;&quot;&gt;By modifying the &lt;strong&gt;updateUsername&lt;/strong&gt; function to using an arrow function we can fix the problem easily without introducing complexities&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style=&quot;font-family: arial,helvetica,sans-serif;&quot;&gt;Lets correct the above example by replacing the updateUsername function to an arrow function&lt;/span&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;
&lt;span style=&quot;font-family: arial,helvetica,sans-serif;&quot;&gt;import React, {Component} from 'react'&lt;br&gt;&lt;br&gt;
 class App extends Component{&lt;br&gt;
    constructor(props);{&lt;br&gt;
     super(props)&lt;br&gt;
     this.state = {&lt;br&gt;
      username: &quot;anonymous&quot;,&lt;br&gt;
      }&lt;br&gt;
    }&lt;br&gt;&lt;br&gt;
    updateUsername = () =&amp;gt; {&lt;br&gt;
     // updateing to arrow funciton corrects the issue&lt;br&gt;
     this.setState({username: &quot;admin&quot;})&lt;br&gt;
    }&lt;br&gt;&lt;br&gt;
    render(){&lt;br&gt;
     console.log(this.state.username);&lt;br&gt;
     return (&lt;br&gt; 
      &lt;br&gt;
       &lt;button&gt; click to update &lt;/button&gt;&lt;br&gt;
      &lt;br&gt;
       )&lt;br&gt;
    }&lt;br&gt;
}&lt;br&gt;
export default App&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;div class=&quot;div-green&quot;&gt;&lt;span class=&quot;alert-header&quot;&gt;Tip:&lt;/span&gt;&lt;span class=&quot;alert-body&quot;&gt; Arrow functions are recommended over the normal functions where applicable. The code looks cleaner and better to understand&lt;/span&gt;&lt;/div&gt;
&lt;p&gt;&lt;span style=&quot;font-family: arial,helvetica,sans-serif;&quot;&gt;Running the above code using the arrow function will solve this issue. This is because the &quot;this&quot; keyword of the &lt;strong&gt;enclosing scope&lt;/strong&gt; is specific to the &lt;strong&gt;component instance &lt;/strong&gt;whie using &lt;strong&gt;arrow functions&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/section&gt;
&lt;section&gt;&lt;a id=&quot;sol2&quot; class=&quot;custom_anchor&quot;&gt;&lt;/a&gt;
&lt;h3&gt;&lt;span style=&quot;font-family: arial,helvetica,sans-serif;&quot;&gt;&lt;strong&gt;Solution two(using &quot;bind&quot; method)&lt;/strong&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;p&gt;&lt;span style=&quot;font-family: arial, helvetica, sans-serif;&quot;&gt;Another way of solving this problem is the use of the &lt;strong&gt;bind&lt;/strong&gt; method on the function in the &lt;strong&gt;constructor&lt;/strong&gt; of the class.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style=&quot;font-family: arial,helvetica,sans-serif;&quot;&gt;Let's see the updated code:&lt;/span&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;
&lt;span style=&quot;font-family: arial,helvetica,sans-serif;&quot;&gt;import React, {Component} from 'react'&lt;br&gt;&lt;br&gt;
class App extends Component{&lt;br&gt;
    constructor(props);{&lt;br&gt;
    super(props)&lt;br&gt;
    this.state = {&lt;br&gt;
     username: &quot;anonymous&quot;,&lt;br&gt;
     }&lt;br&gt;
     // add binding method here&lt;br&gt;
     this.updateUsername = this.updateUsername.bind(this)&lt;br&gt;
    }&lt;br&gt;&lt;br&gt;
    // works after binding &lt;br&gt;
    updateUsername(){&lt;br&gt;
     this.setState({username: &quot;admin&quot;})&lt;br&gt;
    }&lt;br&gt;&lt;br&gt;
    render(){&lt;br&gt;
     console.log(this.state.username);&lt;br&gt;
     return (&lt;br&gt;
      &lt;br&gt;
       &lt;button&gt; click to update &lt;/button&gt;&lt;br&gt;
      &lt;br&gt;
     )&lt;br&gt;
    }&lt;br&gt;
}&lt;br&gt;
export default App; &lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;span style=&quot;font-family: arial,helvetica,sans-serif;&quot;&gt;In the above code we have added the &quot;&lt;strong&gt;bind&lt;/strong&gt;&quot; method in the constructor. This method adds and &lt;strong&gt;returns&lt;/strong&gt; a &lt;strong&gt;new function &lt;/strong&gt;where the correct value is assigned on the &quot;&lt;strong&gt;this&lt;/strong&gt;&quot; keyword. We can then use the &lt;strong&gt;bounded&lt;/strong&gt; version anywhere inside the class body :&lt;/span&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;/section&gt;
&lt;section&gt;&lt;a id=&quot;con&quot; class=&quot;custom_anchor&quot;&gt;&lt;/a&gt;
&lt;h2&gt;&lt;span style=&quot;font-family: arial,helvetica,sans-serif;&quot;&gt;&lt;strong&gt;The Conclusion&lt;/strong&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;&lt;span style=&quot;font-family: arial,helvetica,sans-serif;&quot;&gt;Thank you for sticking to this tutorial all through. We have seen how to properly use the this keyword in react using the correct context to prevent the &lt;strong&gt;this&lt;/strong&gt; keyword from returning an &quot;&lt;strong&gt;undefined&lt;/strong&gt;&quot; value which results to the error above. We have seen how to replicate the issue, the causes and how to fix the issue. We have discussed two approaches of fixing, using the arrow function(recommended since its cleaner) and declaring a bound method in the constructor class. I hope you better understand the problem when you encounter it. Happy Hacking&lt;/span&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;/section&gt;
&lt;section&gt;&lt;a id=&quot;ref&quot; class=&quot;custom_anchor&quot;&gt;&lt;/a&gt;
&lt;ul&gt;

&lt;/ul&gt;&lt;/section&gt;</description>
<category>Articles</category>
<guid isPermaLink="true">https://coderlegion.com/17385/explained-cannot-read-property-setstate-of-undefined-needs-improvements</guid>
<pubDate>Mon, 11 May 2026 06:39:37 +0000</pubDate>
</item>
<item>
<title>Attention Is All You Need - Part 2</title>
<link>https://coderlegion.com/16110/attention-is-all-you-need-part-2</link>
<description>
&lt;p&gt;Hello, I'm Ganesh. I'm building &lt;em&gt;git-lrc&lt;/em&gt;, an AI code reviewer that runs on every commit. It is free, unlimited, and source-available on Github. &lt;a href=&quot;https://github.com/HexmosTech/git-lrc&quot; rel=&quot;noopener noreferrer nofollow&quot;&gt;Star Us&lt;/a&gt; to help devs discover the project. Do give it a try and share your feedback for improving the product.&lt;/p&gt;

&lt;p&gt;In previous article we discussed about the limitations of RNNs and how they were not able to capture long range dependencies and process input in parallel.&lt;/p&gt;

&lt;h2&gt;
  
  
  How was Translation done earlier?
&lt;/h2&gt;

&lt;p&gt;There are many way the translation work but in earlier days it was done using seq2seq models.&lt;/p&gt;

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

&lt;p&gt;Translation: &quot;The cat sat on the mat&quot; -&amp;gt; &quot;Le chat s'est assis sur le tapis&quot;&lt;/p&gt;

&lt;p&gt;This translation was done using RNNs.&lt;/p&gt;

&lt;p&gt;Let's see how this was done.&lt;/p&gt;

&lt;p&gt;Input : Many words&lt;br&gt;
Output : Many words&lt;/p&gt;

&lt;p&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq0yu25m7r775hek361h1.png&quot; class=&quot;article-body-image-wrapper&quot;&gt;&lt;img src=&quot;https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq0yu25m7r775hek361h1.png&quot; alt=&quot;&quot; width=&quot;800&quot; height=&quot;210&quot;&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This had major flaws if the input seqeuence length was long the output was very poor.&lt;/p&gt;

&lt;p&gt;so, this made the accuracy of the model very poor for long sentences.&lt;/p&gt;

&lt;p&gt;If context is very load and it had accuracy issues then decoder might get confused and couldn't predict the correct output.&lt;/p&gt;

&lt;h2&gt;
  
  
  How Long sentence problem was solved?
&lt;/h2&gt;

&lt;p&gt;We had to provide additional context to decoder in order to over come this issues.&lt;/p&gt;

&lt;p&gt;That's when attention mechanism comes into picture.&lt;/p&gt;

&lt;p&gt;This was another improvement over the seq2seq models.&lt;/p&gt;

&lt;p&gt;We add context vector to decoder which help them to have full context vector about the input sequence.&lt;/p&gt;

&lt;h2&gt;
  
  
  What's next?
&lt;/h2&gt;

&lt;p&gt;In this article we discussed how the translation was done earlier and how it was improved with the attention mechanism.&lt;/p&gt;

&lt;p&gt;Reference: &lt;a href=&quot;https://proceedings.neurips.cc/paper_files/paper/2017/file/3f5ee243547dee91fbd053c1c4a845aa-Paper.pdf&quot; rel=&quot;noopener noreferrer nofollow&quot;&gt;https://proceedings.neurips.cc/paper_files/paper/2017/file/3f5ee243547dee91fbd053c1c4a845aa-Paper.pdf&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/HexmosTech/git-lrc&quot; rel=&quot;noopener noreferrer nofollow&quot;&gt;&lt;img src=&quot;https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fabn6nl3iehrohehnxgje.png&quot; alt=&quot;git-lrc&quot; width=&quot;800&quot; height=&quot;373&quot;&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Any feedback or contributors are welcome! It&amp;rsquo;s online, source-available, and ready for anyone to use. &lt;br&gt;
&amp;#11088; Star it on GitHub: &lt;a href=&quot;https://github.com/HexmosTech/git-lrc&quot; rel=&quot;noopener noreferrer nofollow&quot;&gt;https://github.com/HexmosTech/git-lrc&lt;/a&gt;&lt;/p&gt;


</description>
<category>Other</category>
<guid isPermaLink="true">https://coderlegion.com/16110/attention-is-all-you-need-part-2</guid>
<pubDate>Wed, 29 Apr 2026 18:29:58 +0000</pubDate>
</item>
<item>
<title>Your AI Doesn't Have a Brain. It Has a Filing Cabinet.</title>
<link>https://coderlegion.com/14464/your-ai-doesnt-have-a-brain-it-has-a-filing-cabinet</link>
<description>&lt;hr&gt;
&lt;p&gt;title: &quot;Your AI Doesn't Have a Brain. It Has a Filing Cabinet.&quot;&lt;br&gt;
tags: [ai, context, memory, agents]&lt;/p&gt;
&lt;h3 id=&quot;canonical-url-https-pith-run-blog-filing-cabinet-vs-brain&quot;&gt;canonical_url: &lt;a rel=&quot;nofollow&quot; href=&quot;https://pith.run/blog/filing-cabinet-vs-brain&quot;&gt;https://pith.run/blog/filing-cabinet-vs-brain&lt;/a&gt;&lt;/h3&gt;
&lt;h3 id=&quot;your-ai-doesn-t-have-a-brain-it-has-a-filing-cabinet-&quot;&gt;Your AI Doesn't Have a Brain. It Has a Filing Cabinet.&lt;/h3&gt;
&lt;p&gt;Every AI memory tool on the market today makes the same pitch: &quot;We'll remember your conversations so your AI doesn't forget.&quot; Import your chat history. Search across it. Get organized.&lt;/p&gt;
&lt;p&gt;Sounds great. There's just one problem: &lt;strong&gt;search is not memory.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;A Google Drive full of documents doesn't mean your company &quot;knows&quot; what's in them. A Notion workspace with ten thousand pages doesn't mean your team has shared understanding. And a database full of past conversations doesn't mean your AI &quot;remembers&quot; anything. It means your AI has a filing cabinet.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;the-filing-cabinet-test&quot;&gt;The Filing Cabinet Test&lt;/h3&gt;
&lt;p&gt;Here's a thought experiment.&lt;/p&gt;
&lt;p&gt;You've had a thousand conversations with AI assistants over the past year. In conversation #200, you told ChatGPT that your startup should focus on B2B enterprise sales. In conversation #800 — six months later, after watching three enterprise deals collapse — you told Claude that consumer PLG is the only viable path forward.&lt;/p&gt;
&lt;p&gt;A filing cabinet can find both of these when you search for &quot;go-to-market strategy.&quot; It dutifully returns them, side by side, like a librarian handing you two books that happen to contradict each other without mentioning that they do.&lt;/p&gt;
&lt;p&gt;A brain would notice they contradict each other.&lt;/p&gt;
&lt;p&gt;This is the filing cabinet test, and it's the fastest way to evaluate whether an AI memory tool is actually giving your AI memory, or just giving it storage. Ask three questions:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Can it detect when your past self disagreed with your current self?&lt;/strong&gt; Not just retrieve both statements — actually flag the contradiction.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Can it track how your beliefs evolved?&lt;/strong&gt; Not just show you a timeline of conversations — model the arc from B2B conviction to PLG conviction, and know &lt;em&gt;why&lt;/em&gt; the shift happened.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Can it decide which belief to act on?&lt;/strong&gt; Not just return the most recent one — weigh the evidence, consider the context, and surface the stronger position.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;If your memory tool can't do any of these, it's a filing cabinet. A very fast, very expensive filing cabinet.&lt;/p&gt;
&lt;h3 id=&quot;what-search-gets-you-and-where-it-stops-&quot;&gt;What Search Gets You (and Where It Stops)&lt;/h3&gt;
&lt;p&gt;To be clear: search-and-retrieve isn't useless. Being able to pull up &quot;that conversation where I figured out the pricing model&quot; is genuinely valuable. It beats starting from scratch every time your context window resets.&lt;/p&gt;
&lt;p&gt;But search is a solved problem. Embeddings, vector databases, semantic similarity — the tooling is mature. You can build a decent search-over-conversations product in a weekend hackathon. And several companies have.&lt;/p&gt;
&lt;p&gt;The problem is what happens &lt;em&gt;after&lt;/em&gt; retrieval. When your AI pulls up five relevant past conversations to inform a decision, it has no way to reconcile them. It doesn't know that conversation #3 superseded the conclusions from conversation #1. It doesn't know that the budget numbers in conversation #2 were corrected in conversation #5. It doesn't know that your confidence in the technical approach from conversation #4 dropped after the production incident you discussed in a completely separate thread.&lt;/p&gt;
&lt;p&gt;Search gives you recall. It does not give you understanding.&lt;/p&gt;
&lt;p&gt;And this gap isn't academic. It has real consequences every time an AI agent acts on outdated or contradictory information because its &quot;memory&quot; was just a keyword match against a database of past transcripts.&lt;/p&gt;
&lt;h3 id=&quot;what-a-real-cognitive-system-looks-like&quot;&gt;What a Real Cognitive System Looks Like&lt;/h3&gt;
&lt;p&gt;If search-and-retrieve is the filing cabinet, what does the brain look like? Here are the architectural properties that separate cognitive systems from storage systems.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Contradiction detection.&lt;/strong&gt; When new information conflicts with an existing belief, the system doesn't silently store both versions. It surfaces the conflict. &quot;In March you said the API should be REST-only. In June you said GraphQL is non-negotiable. Which position should I operate from?&quot; A filing cabinet stores both. A brain asks.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Confidence scoring.&lt;/strong&gt; Not all information is equal. Something you stated once in passing has different weight than something you've confirmed across fifteen conversations over three months. A cognitive system tracks how confident it should be in each piece of knowledge — and &lt;em&gt;why&lt;/em&gt;. When two beliefs conflict, confidence scores provide a principled way to resolve the tension rather than just defaulting to &quot;most recent wins.&quot;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Belief lifecycle management.&lt;/strong&gt; Beliefs aren't static. They're born from a single observation, strengthened by corroborating evidence, challenged by contradictions, weakened by counter-evidence, superseded by newer conclusions, and eventually retired. A system that models this lifecycle explicitly can answer questions a filing cabinet never could: &quot;When did I change my mind about this?&quot; &quot;What evidence drove that change?&quot; &quot;How stable is my current position?&quot;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Cross-conversation reasoning.&lt;/strong&gt; The hardest test for any memory system: connecting information from conversation A to information from conversation B through an inference that neither conversation made explicitly. &quot;You told me the deployment deadline is April 15. You also told me the security audit takes 6 weeks. You haven't mentioned scheduling the audit yet.&quot; That's not retrieval. That's reasoning over a knowledge graph built from hundreds of separate interactions.&lt;/p&gt;
&lt;h3 id=&quot;the-benchmark-gap-is-not-10-it-s-10x-&quot;&gt;The Benchmark Gap Is Not 10%. It's 10x.&lt;/h3&gt;
&lt;p&gt;Here's what happens when you actually test memory systems on whether they can consolidate and reason over facts scattered across many conversations.&lt;/p&gt;
&lt;p&gt;The FactConsolidation benchmark from the &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/xiaowu0162/LongMemEval&quot;&gt;LongMemEval suite&lt;/a&gt; (ICLR 2025) was designed exactly for this. It doesn't test whether a system can find a needle in a haystack — any decent vector search can do that. It tests whether a system can synthesize facts from 6,000+ sessions into a coherent answer when the relevant information is spread across dozens of conversations and some of it contradicts other parts.&lt;/p&gt;
&lt;p&gt;Most memory systems that score well on simple retrieval tasks — the ones that look good in demos — collapse on consolidation. The gap between &quot;can find the right conversation&quot; and &quot;can reason across all your conversations&quot; isn't marginal. It's categorical. Systems that look great on single-session retrieval — find the right conversation, return the relevant snippet — often fail catastrophically when asked to consolidate facts across many sessions.&lt;/p&gt;
&lt;p&gt;This isn't a tuning problem. It's an architecture problem. You can't bolt consolidation onto a search index after the fact. The system has to be designed from the ground up to model beliefs, track confidence, detect contradictions, and maintain a living knowledge graph — not a dead archive.&lt;/p&gt;
&lt;h3 id=&quot;why-this-matters-now&quot;&gt;Why This Matters Now&lt;/h3&gt;
&lt;p&gt;Context engineering is becoming the defining discipline of 2026. As AI agents take on longer-running, multi-session tasks — coding projects that span weeks, research that builds over months, business decisions that evolve over quarters — the memory layer becomes the bottleneck.&lt;/p&gt;
&lt;p&gt;The agent that forgets what you decided yesterday isn't an agent. It's a very expensive autocomplete that you have to re-brief every morning. And the memory tool that can retrieve your old conversations but can't reason over them is just moving the re-briefing burden from &quot;explain everything from scratch&quot; to &quot;manually reconcile five conflicting search results.&quot;&lt;/p&gt;
&lt;p&gt;We're past the point where &quot;remembers your name and preferences&quot; counts as AI memory. The bar is higher now. Developers building serious agent systems need memory infrastructure that passes the filing cabinet test — that can detect contradictions, track belief evolution, score confidence, and reason across hundreds of sessions.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;we-re-building-the-brain&quot;&gt;We're Building the Brain&lt;/h3&gt;
&lt;p&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://getpith.dev&quot;&gt;Pith&lt;/a&gt; is a context engineering system that works with any MCP-compatible AI client — Claude Desktop, Claude Code, Cursor, Windsurf, Cline, VS Code. It runs locally on your machine, and it passes the filing cabinet test.&lt;/p&gt;
&lt;p&gt;When your AI learns something new that contradicts something it learned before, Pith catches it. When your confidence in a decision should change based on new evidence, Pith tracks it. When information from session #47 connects to information from session #203 in a way that matters for what you're building today, Pith surfaces it.&lt;/p&gt;
&lt;p&gt;It's not a search engine for your past conversations. It's a cognitive layer that actually understands what it knows — and updates that understanding as it learns more.&lt;/p&gt;
&lt;p&gt;If you're building AI agents that need to actually know things — not just search through things — the architecture matters.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://getpith.dev&quot;&gt;Try Pith →&lt;/a&gt;&lt;/strong&gt; &lt;/p&gt;
</description>
<category>Articles</category>
<guid isPermaLink="true">https://coderlegion.com/14464/your-ai-doesnt-have-a-brain-it-has-a-filing-cabinet</guid>
<pubDate>Sat, 11 Apr 2026 03:09:16 +0000</pubDate>
</item>
<item>
<title>Context Chaos to Instant Clarity: The Brutal Manual Way vs. ContextWizard’s 10-Second Mind-Reader</title>
<link>https://coderlegion.com/7932/context-chaos-to-instant-clarity-the-brutal-manual-way-contextwizards-second-mind-reader</link>
<description>&lt;p&gt;&lt;img src=&quot;https://coderlegion.com/?qa=blob&amp;amp;qa_blobid=17398017891017435159&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Too many repos. Too many docs. Too many decisions.&lt;br&gt;
Not enough clarity.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;If you’ve ever:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;opened 14 files just to understand a bug&lt;/li&gt;
&lt;li&gt;combed Slack for a decision someone made 18 months ago&lt;/li&gt;
&lt;li&gt;reverse-engineered your own architecture because documentation drifted&lt;/li&gt;
&lt;li&gt;or spent 45 minutes answering: &lt;em&gt;“Where is this even coming from?”&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;…then you already know the pain.&lt;/p&gt;
&lt;p&gt;This article has two parts:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;The real manual workflow for gathering context — slow, free, and mentally exhausting.&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;How ContextWizard gives you the same answers in 5–10 seconds with zero digging.&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;hr&gt;
&lt;h2 id=&quot;part-1-the-manual-way-prepare-your-sanity-for-eviction-&quot;&gt;&lt;strong&gt;Part 1 — The Manual Way (Prepare Your Sanity for Eviction)&lt;/strong&gt;&lt;/h2&gt;
&lt;p&gt;Every developer’s day technically starts with coding.&lt;br&gt;
But actually? It starts with hunting.&lt;/p&gt;
&lt;h3 id=&quot;1-the-multi-tab-treasure-hunt-5-20-minutes-&quot;&gt;&lt;strong&gt;1. The Multi-Tab Treasure Hunt (5–20 minutes)&lt;/strong&gt;&lt;/h3&gt;
&lt;p&gt;You need to modify one function. Simple. Right?&lt;br&gt;
Not at all.&lt;/p&gt;
&lt;p&gt;Your morning ritual becomes:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Open GitHub → search for name patterns&lt;/li&gt;
&lt;li&gt;Dive into 3 different repos&lt;/li&gt;
&lt;li&gt;Reopen the Confluence doc last updated before the pandemic&lt;/li&gt;
&lt;li&gt;Ctrl+F multiple Slack channels&lt;/li&gt;
&lt;li&gt;Scroll aimlessly through Notion&lt;/li&gt;
&lt;li&gt;Ping the one teammate who “kinda remembers how this works”&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;By the time you find the right file, the dopamine is gone and the coffee is cold.&lt;/p&gt;
&lt;p&gt;This is the “context warm-up” every engineer pretends isn’t half their job.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;2-decision-archaeology-10-40-minutes-&quot;&gt;&lt;strong&gt;2. Decision Archaeology (10–40 minutes)&lt;/strong&gt;&lt;/h3&gt;
&lt;p&gt;Now you found the code, but it raises more questions:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;em&gt;Why is it structured this way?&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Was this intentional or accidental?&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Did someone try a different approach? Why was it rejected?&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;So begins the archaeological dig:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;comb through Git history&lt;/li&gt;
&lt;li&gt;reconstruct timeline from vague commit messages&lt;/li&gt;
&lt;li&gt;search Slack again for keywords&lt;/li&gt;
&lt;li&gt;guess context from broken Jira links&lt;/li&gt;
&lt;li&gt;mentally simulate the system architecture&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This is where engineers start doubting reality itself.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;3-dependency-recon-15-90-minutes-&quot;&gt;&lt;strong&gt;3. Dependency Recon (15–90 minutes)&lt;/strong&gt;&lt;/h3&gt;
&lt;p&gt;You’ve answered “why.”&lt;br&gt;
Now comes “what else will this break?”&lt;/p&gt;
&lt;p&gt;You run through:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;call graphs&lt;/li&gt;
&lt;li&gt;references across repos&lt;/li&gt;
&lt;li&gt;external API contracts&lt;/li&gt;
&lt;li&gt;database and migration history&lt;/li&gt;
&lt;li&gt;test files that may or may not even apply&lt;/li&gt;
&lt;li&gt;the forgotten service only deployed to staging&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;And of course, that one circular dependency that makes no sense.&lt;br&gt;
You ping a teammate: &lt;em&gt;“If I change this, do I explode prod?”&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;They reply 11 minutes later: &lt;em&gt;“Maybe? Hard to say.”&lt;/em&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;4-the-documentation-lie-minutes-&quot;&gt;&lt;strong&gt;4. The Documentation Lie (∞ minutes)&lt;/strong&gt;&lt;/h3&gt;
&lt;p&gt;You remember documentation exists.&lt;/p&gt;
&lt;p&gt;You check:&lt;br&gt;
It’s outdated.&lt;br&gt;
Or vague.&lt;br&gt;
Or contradictory.&lt;br&gt;
Or missing.&lt;br&gt;
Or written by you in 2022 when you were sleep-deprived, optimistic, and wrong.&lt;/p&gt;
&lt;p&gt;You open a fresh tab, whisper “I’ll update this later,” and lie to yourself.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;5-the-mental-merge-the-real-time-sink-&quot;&gt;&lt;strong&gt;5. The Mental Merge (The Real Time Sink)&lt;/strong&gt;&lt;/h3&gt;
&lt;p&gt;Even after all the digging, the true bottleneck isn’t searching — it’s stitching it all together.&lt;/p&gt;
&lt;p&gt;Your brain is forced to do a massive mental join:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;old vs new logic&lt;/li&gt;
&lt;li&gt;expected vs actual behavior&lt;/li&gt;
&lt;li&gt;system flow vs code shape&lt;/li&gt;
&lt;li&gt;transient knowledge vs long-term architecture&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This is where most engineering delays happen:&lt;br&gt;
Not because writing code is slow, but because &lt;em&gt;understanding everything first&lt;/em&gt; is.&lt;/p&gt;
&lt;p&gt;Typical manual context-gathering times:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;&lt;th&gt;Task                                    &lt;/th&gt;&lt;th&gt;Manual Time&lt;/th&gt;&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;Debugging a cross-repo flow             &lt;/td&gt;&lt;td&gt;45–120 min&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Understanding an architectural decision &lt;/td&gt;&lt;td&gt;30–60 min&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Tracking the origin of a bug            &lt;/td&gt;&lt;td&gt;20–90 min&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Investigating a breaking change         &lt;/td&gt;&lt;td&gt;40–150 min&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Onboarding to a new codebase            &lt;/td&gt;&lt;td&gt;Weeks&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Your code editor is ready long before your brain is.&lt;/p&gt;
&lt;p&gt;This is the “free” method — but the cost is brutal.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&quot;part-2-the-contextwizard-way-5-10-seconds-&quot;&gt;&lt;strong&gt;Part 2 — The ContextWizard Way (5–10 Seconds)&lt;/strong&gt;&lt;/h2&gt;
&lt;p&gt;Open the same confusing code, repo, or feature and:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Highlight the function, file, or problem&lt;/li&gt;
&lt;li&gt;Ask ContextWizard in plain language&lt;/li&gt;
&lt;li&gt;Get a clear, structured answer instantly&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Done. No Slack dive. No spelunking. No brain gymnastics.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&quot;what-contextwizard-actually-does-high-level-&quot;&gt;&lt;strong&gt;What ContextWizard Actually Does (High-Level)&lt;/strong&gt;&lt;/h2&gt;
&lt;p&gt;No proprietary secrets here — but here’s the architecture mindset.&lt;/p&gt;
&lt;p&gt;ContextWizard runs a multi-source, multi-layer retrieval system that mimics how senior engineers think:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;indexes code, docs, commits, APIs, discussions, and architectural notes&lt;/li&gt;
&lt;li&gt;builds weighted relationships across them&lt;/li&gt;
&lt;li&gt;models dependencies, purpose, and historical decisions&lt;/li&gt;
&lt;li&gt;extracts explanations that actually match the &lt;em&gt;intent&lt;/em&gt; of your question&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;It doesn’t guess — it reasons.&lt;br&gt;
It doesn’t search — it orients.&lt;/p&gt;
&lt;p&gt;Think of it as an engineer who was present for every meeting, every commit, every discussion…&lt;br&gt;
and remembers &lt;em&gt;everything&lt;/em&gt; perfectly.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&quot;real-world-results&quot;&gt;&lt;strong&gt;Real-World Results&lt;/strong&gt;&lt;/h2&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;&lt;th&gt;Scenario                                       &lt;/th&gt;&lt;th&gt;Manual Time &lt;/th&gt;&lt;th&gt;ContextWizard Time &lt;/th&gt;&lt;th&gt;Result&lt;/th&gt;&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;Understanding why a function behaves strangely &lt;/td&gt;&lt;td&gt;25–60 min   &lt;/td&gt;&lt;td&gt;6 sec              &lt;/td&gt;&lt;td&gt;Full decision trail&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Tracking a bug across 3 repos                  &lt;/td&gt;&lt;td&gt;45–90 min   &lt;/td&gt;&lt;td&gt;10 sec             &lt;/td&gt;&lt;td&gt;Accurate chain-of-causality&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Onboarding to a new codebase                   &lt;/td&gt;&lt;td&gt;Weeks       &lt;/td&gt;&lt;td&gt;Minutes            &lt;/td&gt;&lt;td&gt;Instant mental model&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Documenting a feature retroactively            &lt;/td&gt;&lt;td&gt;Hours       &lt;/td&gt;&lt;td&gt;12 sec             &lt;/td&gt;&lt;td&gt;Clean explanations &amp;amp; diagrams&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Debugging API mismatches                       &lt;/td&gt;&lt;td&gt;30–120 min  &lt;/td&gt;&lt;td&gt;8 sec              &lt;/td&gt;&lt;td&gt;Contract diff + usage map&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;No Slack archaeology.&lt;br&gt;
No guessing.&lt;br&gt;
No lost tribal knowledge.&lt;/p&gt;
&lt;p&gt;Just clarity.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&quot;why-contextwizard-feels-like-magic&quot;&gt;&lt;strong&gt;Why ContextWizard Feels Like Magic&lt;/strong&gt;&lt;/h2&gt;
&lt;p&gt;Manual context-gathering is basically:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;running mental simulations&lt;/li&gt;
&lt;li&gt;hunting down clues&lt;/li&gt;
&lt;li&gt;merging fragmented knowledge&lt;/li&gt;
&lt;li&gt;reconstructing intent from scraps&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;ContextWizard sidesteps all of that.&lt;/p&gt;
&lt;p&gt;It knows the structure.&lt;br&gt;
It knows the relationships.&lt;br&gt;
It knows the reasoning behind the system.&lt;br&gt;
And it surfaces exactly what you’d discover — without the digging.&lt;/p&gt;
&lt;p&gt;It’s not magic.&lt;br&gt;
It’s context modeling, graph reasoning, and ruthless retrieval optimization.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&quot;when-manual-context-gathering-still-makes-sense&quot;&gt;&lt;strong&gt;When Manual Context Gathering Still Makes Sense&lt;/strong&gt;&lt;/h2&gt;
&lt;p&gt;A few cases genuinely benefit from doing it the hard way:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;you’re onboarding and want to “feel the code”&lt;/li&gt;
&lt;li&gt;the codebase is tiny (&amp;lt;5k LOC)&lt;/li&gt;
&lt;li&gt;you’re intentionally reverse-engineering something for learning&lt;/li&gt;
&lt;li&gt;you enjoy Sherlock-Holmes-style debugging sessions&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Everything else?&lt;br&gt;
Your time is worth more than tab juggling and Slack archaeology.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&quot;get-contextwizard-and-reclaim-your-focus&quot;&gt;&lt;strong&gt;Get ContextWizard and Reclaim Your Focus&lt;/strong&gt;&lt;/h2&gt;
&lt;p&gt;Latest version:&lt;br&gt;
&lt;a rel=&quot;nofollow&quot; href=&quot;https://superhivemarket.com/products/contextwizard&quot;&gt;https://superhivemarket.com/products/contextwizard&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;CoderLegion gets 40% off with code:&lt;br&gt;
&lt;strong&gt;LEGIONWIZARD&lt;/strong&gt;&lt;br&gt;
Valid until Dec 28, 2026. Unlimited uses.&lt;/p&gt;
&lt;p&gt;I would love to read your worst context-gathering horror story in the comments &lt;/p&gt;
&lt;p&gt;— Wilson (@wilsonanibe98)&lt;/p&gt;
</description>
<category>Java</category>
<guid isPermaLink="true">https://coderlegion.com/7932/context-chaos-to-instant-clarity-the-brutal-manual-way-contextwizards-second-mind-reader</guid>
<pubDate>Sat, 29 Nov 2025 01:02:56 +0000</pubDate>
</item>
</channel>
</rss>