claude-code - 💡(How to fix) Fix [FEATURE] Surface the active Claude Code environment (CLI / Desktop Code tab / Cowork) in the model's context [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#54140Fetched 2026-04-28 06:38:10
View on GitHub
Comments
1
Participants
2
Timeline
3
Reactions
0
Timeline (top)
labeled ×2commented ×1

Root Cause

I had to correct the model multiple times. The information it needed to behave correctly was already in my project-level memory — but the model didn't know to look there because it didn't know which surface it was in.

Fix Action

Fix / Workaround

  1. Misidentified my session as Cowork based on plugin namespace prefixes in the available skill list.
  2. Recommended two slash commands that, when I tried them, returned /plugin isn't available in this environment.
  3. Recommended a workaround that involved packaging skills as .skill files — the Cowork-specific path — when the right answer was just to use the Code tab's actual plugin install flow.
  4. Wrote a long explanation conflating "Claude Desktop" with "Cowork," even though those are different tabs in the same app.
RAW_BUFFERClick to expand / collapse

Problem

When I'm using Claude Code, the model has no awareness of which surface I'm working in:

  • Claude Code CLI (claude in a terminal)
  • Claude Code in the Code tab of the Claude Desktop app
  • Cowork tab in the Claude Desktop app

These three surfaces share a lot of plumbing (~/.claude/settings.json, plugins, skills, MCP servers) but differ in meaningful ways:

  • Available slash commands — e.g. /plugin marketplace add works in the CLI but my Code tab in Desktop returned /plugin isn't available in this environment
  • How sessions/windows work — Cmd+N + sidebar in Desktop vs claude + interactive prompt in CLI
  • Cowork's frozen skill bundle vs the Code tab's live ~/.claude/skills/ symlinks
  • Pane availability — Terminal pane only in local Desktop sessions; absent in Cowork; absent in CLI
  • Permission and approval models look slightly different
  • Computer-use availability and tier rules

Today, the model just sees currentDate, the cwd, and basic OS info. It has to guess which surface I'm using based on indirect signals (which slash commands are available, plugin namespace prefixes that appear in the skill list, etc.) — and it gets it wrong, repeatedly.

A concrete recent example

I asked Claude to help install a plugin. I'm in the Code tab of the Desktop app. The model:

  1. Misidentified my session as Cowork based on plugin namespace prefixes in the available skill list.
  2. Recommended two slash commands that, when I tried them, returned /plugin isn't available in this environment.
  3. Recommended a workaround that involved packaging skills as .skill files — the Cowork-specific path — when the right answer was just to use the Code tab's actual plugin install flow.
  4. Wrote a long explanation conflating "Claude Desktop" with "Cowork," even though those are different tabs in the same app.

I had to correct the model multiple times. The information it needed to behave correctly was already in my project-level memory — but the model didn't know to look there because it didn't know which surface it was in.

Why it matters

Recommendations from the model are only as good as its knowledge of the operating environment. Telling someone in the Code tab to "run /plugin install in your terminal" is wrong; telling someone in CLI to "open Settings and click X" is also wrong. The capability matrix across surfaces is non-trivial and seems to keep diverging as Claude Code spreads to more surfaces (CLI, Desktop tabs, IDE extensions, web, mobile remote control).

This is foundational context — at least as important as currentDate, arguably more important, since it changes the entire menu of viable actions the model can recommend.

Suggested fix — part 1: tell the model where it is

Surface the active Claude Code environment to the model on every turn, the same way currentDate is exposed today. One line is enough:

claude-code-environment: desktop-code-tab

…with possible values like cli, desktop-code-tab, desktop-cowork, desktop-chat, vs-code-extension, jetbrains-plugin, web — whatever set of surfaces the team supports.

Bonus points for including the app/CLI version so the model can also reason about features that have shipped or been removed since training cutoff.

Suggested fix — part 2: tell the model what that environment can DO

Knowing the surface is half the battle. The model also needs current knowledge of what each surface is capable of — and these surfaces evolve fast (new panes, new shortcuts, new slash commands, deprecated flags, changing permission models). Training data goes stale within months.

Two reasonable ways to keep the model honest, in order of preference:

Option A — Anthropic-maintained skills, auto-loaded by environment. Ship official skills (one per surface, or a consolidated one with sections) that document each environment's current capabilities: available slash commands, panes, shortcuts, plugin install flow, permission modes, what's NOT supported, etc. The model auto-loads the relevant one based on the environment ID. Skills are already the right abstraction for this kind of just-in-time procedural knowledge — and Anthropic can update them in lockstep with product changes, giving the whole user base a single source of truth instead of a drift-prone training cutoff.

Option B — bake it into the system context directly. Higher token cost, harder to update independent of model rollouts, but guaranteed visibility.

Either is fine. The status quo — where users like me write our own reference_claude_code_desktop.md files in personal memory just to give the model a fighting chance — should not be the path Anthropic relies on. It's asking individual users to compensate for missing first-party context, and the results vary wildly depending on whether someone thought to do it.

Why this matters to me

It's genuinely frustrating that an Anthropic application running an Anthropic model has no idea what Anthropic surface it's running in, or what that surface is currently capable of. I'm filing this issue from a Code tab in the Desktop app — the model that helped me draft it had to be corrected mid-conversation because it assumed I was in Cowork.

I currently maintain a hand-written 200-line reference file in personal memory that documents how the Desktop app works, including a section on "when this memory is stale, re-fetch the source URL." That shouldn't be on me. As Claude Code spreads across more surfaces (CLI, three Desktop tabs, IDE extensions, web, mobile remote control) this gap only grows.

extent analysis

TL;DR

The model needs to be informed about the active Claude Code environment to provide accurate recommendations, and this can be achieved by surfacing the environment to the model on every turn.

Guidance

  • Expose the active Claude Code environment to the model using a unique identifier, such as claude-code-environment: desktop-code-tab, to help it understand the context.
  • Provide the model with current knowledge of what each surface is capable of, either through Anthropic-maintained skills or by baking it into the system context directly.
  • Consider including the app/CLI version to enable the model to reason about features that have shipped or been removed since training cutoff.
  • Update the model's training data to reflect the evolving capabilities of each surface, such as new panes, shortcuts, and slash commands.

Example

claude-code-environment: desktop-code-tab
available-slash-commands: [/plugin, /skill, /pane]
available-panes: [Terminal, Code, Chat]

This example illustrates how the model can be informed about the active environment and its capabilities.

Notes

The suggested fix requires changes to the model's architecture and training data to accommodate the dynamic nature of the Claude Code surfaces. The approach should be flexible enough to adapt to new surfaces and features as they are introduced.

Recommendation

Apply the suggested fix by surfacing the active Claude Code environment to the model and providing it with current knowledge of what each surface is capable of, using either Anthropic-maintained skills or system context updates. This will enable the model to provide more accurate and relevant recommendations to users.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING