<?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>Forem: evan-kyr</title>
    <description>The latest articles on Forem by evan-kyr (@evankyr).</description>
    <link>https://forem.com/evankyr</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3737041%2F9847ed92-baf6-4854-a648-1a732b40517c.jpeg</url>
      <title>Forem: evan-kyr</title>
      <link>https://forem.com/evankyr</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/evankyr"/>
    <language>en</language>
    <item>
      <title>How I gave Claude Code access to real user behavior</title>
      <dc:creator>evan-kyr</dc:creator>
      <pubDate>Fri, 30 Jan 2026 10:26:47 +0000</pubDate>
      <link>https://forem.com/evankyr/how-i-gave-claude-code-access-to-real-user-behavior-5dhk</link>
      <guid>https://forem.com/evankyr/how-i-gave-claude-code-access-to-real-user-behavior-5dhk</guid>
      <description>&lt;p&gt;When I’m working with Claude Code, it’s very good at reasoning about code, but blind to everything that happens after deployment.&lt;/p&gt;

&lt;p&gt;It does not know:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;which flows users actually follow&lt;/li&gt;
&lt;li&gt;where they hesitate&lt;/li&gt;
&lt;li&gt;what they never discover&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;At some point I realized I was spending more time explaining user behavior to Claude than actually thinking about the problem.&lt;/p&gt;

&lt;p&gt;So I tried a different approach. Instead of describing context, I let Claude read it directly.&lt;/p&gt;

&lt;p&gt;This post walks through how I set that up.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Step 1: Capture only high-signal user behavior&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The first requirement was to capture real user behavior without slowing down the app or collecting noise.&lt;/p&gt;

&lt;p&gt;Most session replay tools capture the full DOM and every mutation. That gives you very rich data, but it also adds noticeable overhead and a lot of information that is irrelevant for reasoning.&lt;/p&gt;

&lt;p&gt;For this setup, I went in the opposite direction.&lt;/p&gt;

&lt;p&gt;The tracking script is intentionally lightweight and opinionated:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;it captures only essential interaction signals&lt;/li&gt;
&lt;li&gt;it does not record full DOM snapshots or mutations&lt;/li&gt;
&lt;li&gt;no PII is captured&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The goal is not replay fidelity. The goal is to capture just enough signal for an LLM to understand how users interact with the app.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Step 2: Auto-capture and structure everything&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;There is no manual event tagging.&lt;/p&gt;

&lt;p&gt;All interactions are auto-captured and organized into a structured model:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;page paths&lt;/li&gt;
&lt;li&gt;elements users interact with&lt;/li&gt;
&lt;li&gt;navigation patterns&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Over time, this forms a kind of inventory of the app, describing:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;which pages exist&lt;/li&gt;
&lt;li&gt;which elements matter&lt;/li&gt;
&lt;li&gt;how users move between them&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This structure is important because Claude Code does not just need raw events.&lt;br&gt;
It needs to understand entities that real users interact with, and how those entities relate to the actual codebase.&lt;/p&gt;

&lt;p&gt;This makes it possible to correlate:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;“users keep clicking this button”
with:&lt;/li&gt;
&lt;li&gt;“this component in the code behaves like this”&lt;/li&gt;
&lt;/ul&gt;



&lt;p&gt;&lt;strong&gt;Step 3: Select and pre-process high-signal sessions&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Raw session data is still too noisy to hand directly to Claude Code.&lt;/p&gt;

&lt;p&gt;Instead of feeding everything, the system cherry-picks high-signal sessions, such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;frustrated sessions&lt;/li&gt;
&lt;li&gt;unusual navigation patterns&lt;/li&gt;
&lt;li&gt;sessions around specific pages or elements&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These sessions are then processed with an LLM to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;summarize what happened&lt;/li&gt;
&lt;li&gt;extract common flows&lt;/li&gt;
&lt;li&gt;highlight friction points&lt;/li&gt;
&lt;li&gt;build visitor-level profiles&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The output is not logs or events, but ready-to-use context that Claude can reason over.&lt;/p&gt;

&lt;p&gt;This preprocessing step is critical. It keeps the context small, relevant, and useful.&lt;/p&gt;



&lt;p&gt;&lt;strong&gt;Step 4: Expose the processed context via MCP&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Claude Code supports MCP, which allows external systems to expose tools that Claude can call.&lt;/p&gt;

&lt;p&gt;The MCP server exposes several tools at different levels:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;app-level overviews&lt;/li&gt;
&lt;li&gt;page-level behavior summaries&lt;/li&gt;
&lt;li&gt;specific visitor profiles&lt;/li&gt;
&lt;li&gt;individual sessions for deep dives&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This allows a top-down workflow:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;start from a high-level usage overview&lt;/li&gt;
&lt;li&gt;zoom into a page that looks problematic&lt;/li&gt;
&lt;li&gt;drill down into specific sessions or visitors&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;From Claude’s point of view, this is just structured context it can ask for when needed.&lt;/p&gt;



&lt;p&gt;&lt;strong&gt;Step 5: Use it directly inside the terminal&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;At this point, everything happens inside Claude Code.&lt;/p&gt;

&lt;p&gt;Instead of prompts like:&lt;br&gt;
“Users seem confused on onboarding”&lt;/p&gt;

&lt;p&gt;I can ask:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;“Which pages have the highest frustration signals?”&lt;/li&gt;
&lt;li&gt;“How do users typically reach this feature?”&lt;/li&gt;
&lt;li&gt;“What happens in sessions where users abandon checkout?”&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Claude answers based on pre-processed real usage data, not guesses or manually described context.&lt;/p&gt;



&lt;p&gt;&lt;strong&gt;Demo&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Below is a short video showing this end to end, entirely inside the terminal.&lt;/p&gt;

&lt;p&gt;

  &lt;iframe src="https://www.youtube.com/embed/iyaX8NVKPKU"&gt;
  &lt;/iframe&gt;


&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;What changed for me&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The biggest difference was not better answers, but less explanation.&lt;/p&gt;

&lt;p&gt;No dashboards.&lt;br&gt;
No screenshots.&lt;br&gt;
No manual summarizing before prompting.&lt;/p&gt;

&lt;p&gt;I stayed in a single loop:&lt;br&gt;
code, usage, reasoning, code.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;The tool behind this&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I wrapped this approach into a tool called Lcontext.&lt;/p&gt;

&lt;p&gt;It combines:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;a lightweight, opinionated tracking script&lt;/li&gt;
&lt;li&gt;automatic structuring of app entities&lt;/li&gt;
&lt;li&gt;LLM-based preprocessing of high-signal sessions&lt;/li&gt;
&lt;li&gt;an MCP server exposing this context to Claude Code&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It is still early and evolving, but it has been useful enough in my own workflow that I decided to share it.&lt;/p&gt;

&lt;p&gt;If you have experimented with MCP or Claude Code tools, I would love to hear how you think about these problems.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Links&lt;/strong&gt;&lt;br&gt;
Project site: &lt;a href="https://lcontext.com" rel="noopener noreferrer"&gt;https://lcontext.com&lt;/a&gt;&lt;br&gt;
MCP server (open source): &lt;a href="https://github.com/Lcontext/Lcontext" rel="noopener noreferrer"&gt;https://github.com/Lcontext/Lcontext&lt;/a&gt;&lt;/p&gt;

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