Back to browse
Fixing Agent / LLM Context Decay in VS Code with Git Worktrees

Fixing Agent / LLM Context Decay in VS Code with Git Worktrees

by gbro3n·Mar 12, 2026·4 points·0 comments

AI Analysis

●●SolidBig BrainNiche Gem

Maps Git worktrees to AI tasks to stop context decay in VS Code.

Strengths
  • Mapping Git worktrees to agent tasks enforces context boundaries automatically.
  • Injects task references into AGENTS.md based on active worktree branch.
  • Extends existing file-based Kanban workflow rather than replacing it entirely.
Weaknesses
  • Git worktrees add complexity for developers unfamiliar with advanced Git features.
  • Workflow depends on strict file conventions that may not fit every team.
Target Audience

Developers using AI coding agents in VS Code

Similar To

Cursor · Continue · Cline

Post Description

In a previous post, I introduced VS Code Agent Kanban. The key idea in this extension is the formalisation of a plan, todo implement flow that required the agent to converse in markdown files that I'd been using for a while - but manually managing the files (The reasoning and benefits of that flow are covered in the linked post). This post covers the evolution of that process to the use of Git Worktrees.

Similar Projects

AI/ML●●Solid

Contexa – Git-inspired context management for LLM agents

Git metaphor for agent memory is clever; execution and adoption remain unproven.

Big BrainWizardry
0x0003r
103mo ago