Skip to content
Go back

The Golden Context: How I Turned Claude Code's Session Management Into a Git-Like Workflow

I used to start every morning the same way. I’d grab my coffee, open Claude Code, and begin the painstaking ritual of preparing my AI pair programmer for the day’s work.

First, I’d feed it my meticulously crafted CLAUDE.md file. Then came the project plan, outlining the feature I was about to build. Finally, I’d manually point it to relevant parts of the codebase, file by file.

The whole process took five, sometimes ten minutes. And every single time I had to restart the session—whether for a meeting, a context switch, or because the conversation had drifted—I’d do it all over again. I was watching 50,000 tokens of context slowly load, holding my breath and hoping I hadn’t missed a crucial detail.

Then one morning, as I was typing claude --resume for the third time that day, it hit me: I’m spending all this energy building a priceless asset and then treating it like it was disposable.

That’s when I stopped building disposable contexts and started crafting what I call a “Golden Context.”

The Root of the Problem: Context Amnesia

After collaborating with Claude on dozens of features, I realized the friction wasn’t in the prompting—it was in the setup and teardown. The default AI workflow is fundamentally broken for complex software development.

The Morning Context Tax: That 10-minute ritual of loading everything up, every single time. It’s a momentum killer and time hog.

Mid-day Amnesia: You close your terminal for whatever reason, and everything you’ve built up is gone. Sure, you can use --continue to resume your last conversation, but what if you need to switch between multiple features?

Context Creep (The Rotten Session): A session that starts focused on a new API endpoint slowly drifts. After a few hours, it’s full of debugging tangents, old code snippets, and test output. The signal-to-noise ratio plummets. You want to start fresh, but you dread paying the context tax again.

My Discovery: Session IDs Are Your Secret Weapon

Here’s what changed everything: Claude Code’s --session-id flag. Most people use --continue to resume their last conversation or --resume to pick from recent sessions. But when you combine session IDs with a strategic workflow, magic happens.

# This changed my life
claude --session-id $(uuidgen)

That simple command creates a new session with a specific UUID that you control. And here’s the kicker: you can return to that exact session state anytime.

The Golden Context Workflow

Here’s the workflow that reclaimed almost an an hour of my day, every day:

Step 1: The Morning “Golden Build” (15 Minutes, Once)

First thing in the morning, I invest in creating the perfect context. This is my “main branch” of knowledge for the day.

# Generate and save a UUID for today's golden context
export GOLDEN_CONTEXT=$(uuidgen)
echo "Today's Golden Context: $GOLDEN_CONTEXT" > ~/.claude-golden

# Start Claude with this specific session ID
claude --session-id $GOLDEN_CONTEXT --add-dir ./src

Now, within this session, I do the heavy lifting:

  1. Load my CLAUDE.md principles: “Read the CLAUDE.md file in the root directory”
  2. Share today’s plan: “Here’s what we’re building today…” (paste plan)
  3. Use the Task tool to analyze the codebase: “Use the Task tool with a general-purpose agent to map out our authentication system”

The Task tool is Claude Code’s hidden superpower. It launches specialized subagents that can search, analyze, and understand your codebase in parallel.

Step 2: Branch Off for Every Task

When I start working on a feature, I don’t pollute my golden context. I “branch” from it on a new terminal tab:

# Read the golden context UUID
GOLDEN_CONTEXT=$(tail -1 ~/.claude-golden | cut -d' ' -f4)

# Resume from golden context
claude --resume $GOLDEN_CONTEXT

Claude instantly has all 50,000 tokens of project knowledge ready to go. No waiting, no re-reading files, no missed details. I can immediately start with: “Let’s implement the user profile component for TICKET-123.”

Step 3: When Things Get Messy, Return to Gold

Here’s what I do when a session gets polluted with debugging artifacts and random explorations:

# Current session is confused. Just abandon it.
exit

# Start fresh from the golden context
claude --resume $GOLDEN_CONTEXT

It’s liberating. No guilt about “wasting” the built-up context. No time lost rebuilding. Just instant access to that pristine, morning-fresh understanding of your codebase.

The Reality Check: What’s Actually Happening

Let me be clear about what this workflow does and doesn’t do:

What it DOES do:

What it DOESN’T do:

What I’m Still Figuring Out

This workflow has transformed my development process, but it’s not perfect:

No Named Sessions: I’m tracking UUIDs in text files. I dream of claude --save-as "golden-auth-v2". Shouldn’t be that hard to build a simple mapping…but that’s just another Claude session.

Task Tool Limitations: While powerful, the Task tool’s subagents work differently than I initially imagined. They’re more like specialized searchers than parallel file readers. Sometimes I use the copychat tool with Claude Desktop and that seems faster to build some quick context.

The Unexpected Benefits

What surprised me most wasn’t the time saved—it was the mental clarity. When you know you can always return to a clean state, you become more experimental. I’ll try wild refactoring approaches, knowing I can just go back to safety.

My debugging has improved too. Instead of trying to “fix” a confused conversation, I just start fresh. It’s like having infinite mulligans (I don’t play golf; Claude wrote this).

What’s Your Workflow?

This golden context pattern has been a game-changer for me, but I know there are other approaches out there. Some developers are building elaborate prompt libraries. Others are experimenting with MCPs.

How are you managing long-term context in your AI development workflow? Have you found other ways to reduce the context tax?

I’m particularly curious if anyone has figured out how to do true “context diffs”—seeing exactly how a session has diverged from its starting point.

Drop me an email at hello@ashishacharya.com. I’m collecting these workflows and might build some tooling around the best patterns.

And if you work at Anthropic: please, please give us named sessions.


Share this post on:

Previous Post
The Two-Key System: How We Turned House Hunting Into a Team Sport with AI
Next Post
Strategic Test Design: Reduce AI-Generated Test Bloat