Skip to content

fix(server): Claude picks up project slash commands - #13077

Closed
JoeEverest wants to merge 4 commits into
pingdotgg:mainfrom
JoeEverest:fix/claude-workspace-slash-commands
Closed

JoeEverest wants to merge 4 commits into
pingdotgg:mainfrom
JoeEverest:fix/claude-workspace-slash-commands

Conversation

@JoeEverest

@JoeEverest JoeEverest commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Claude Code resolves slash commands from the working directory, but T3 Code only ever probed for them once, in the server's own directory. Project commands in <project>/.claude/commands never reached the / menu.

snapshotForCwd already re-discovered skills per workspace; it now re-probes slash commands there too. A failed probe keeps the machine-wide list instead of emptying the menu.

Workspace snapshots also never expired, so anything added to a project after it was first opened stayed invisible until a restart — for skills as much as commands. They now carry a five-minute window, shared from contracts so the registry and both composers change their minds at the same moment. A stale snapshot still serves the menu while its replacement is probed; falling back to the machine-wide lists would make project commands vanish and reappear.

Before After
before.mov
after.mov

Reproduced with a project holding one .claude/commands/should-exist.md: the command is absent from the / menu before the change and present after. A live init handshake from ~/Work/glide reports 146 commands; the cached machine-wide snapshot held 125, and the 21 missing were exactly that project's commands and skills.

Claude Opus 5 (1M context) in Claude Code.

Summary by CodeRabbit

  • New Features

    • Claude slash commands are now discovered for the active project directory, with duplicates removed and commands sorted consistently.
    • Slash command descriptions prioritize built-in details while retaining descriptions for project-specific commands.
  • Bug Fixes

    • Workspace provider snapshots now expire after five minutes and refresh automatically when stale.
    • Chat and mobile command menus now consistently detect current workspace snapshots, improving provider capability availability.

Copilot AI lite review requested due to automatic review settings September 22, 2026 15:23
@github-actions github-actions Bot added the vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. label Sep 22, 2026
@github-actions github-actions Bot added the size:M 30-99 changed lines (additions + deletions). label Sep 22, 2026
Comment thread apps/server/src/provider/Drivers/ClaudeDriver.ts Outdated
@JoeEverest
JoeEverest force-pushed the fix/claude-workspace-slash-commands branch from fe672f7 to 726b5ec Compare September 22, 2026 15:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

The cache freshness issue blocks approval, and driver-level integration coverage is missing.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 High severity

Open (1)
What changed in this PR

Adds workspace-aware Claude slash-command discovery so project commands appear in the / menu.

Changes:

  • Adds cwd-specific command probing with fallback behavior.
  • Integrates workspace probes into cached provider snapshots.
  • Adds probe behavior and failure-handling tests.
File Summary Findings
apps/​server/​src/​provider/​Layers/​ClaudeProvider.ts Implements cwd-specific slash-command probing. None
apps/​server/​src/​provider/​Layers/​ClaudeCapabilitiesProbe.test.ts Tests workspace discovery and fallback behavior. None
apps/​server/​src/​provider/​Drivers/​ClaudeDriver.ts Integrates workspace command probes into snapshots. Critical cache freshness issue (3 votes); moderate driver-level coverage gap (1 vote).

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread apps/server/src/provider/Drivers/ClaudeDriver.ts Outdated
@JoeEverest
JoeEverest force-pushed the fix/claude-workspace-slash-commands branch from 726b5ec to ba5c9e5 Compare September 22, 2026 15:29
Claude Code resolves slash commands from the working directory, but T3
Code only ever probed for them once, in the server's own directory.
Project commands in `<project>/.claude/commands` never reached the `/`
menu.

`snapshotForCwd` already re-discovered skills per workspace; it now
re-probes slash commands there too. A failed probe keeps the
machine-wide list instead of emptying the menu.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@JoeEverest
JoeEverest force-pushed the fix/claude-workspace-slash-commands branch from ba5c9e5 to 96390f7 Compare September 22, 2026 15:29
@github-actions github-actions Bot added size:S 10-29 changed lines (additions + deletions). and removed size:M 30-99 changed lines (additions + deletions). labels Sep 22, 2026
@coderabbitai

coderabbitai Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: pingdotgg/t3code/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 40a2c10a-a3f2-45a3-9bcd-766e0add84b4

📥 Commits

Reviewing files that changed from the base of the PR and between 96390f7 and a191ee4.

📒 Files selected for processing (7)
  • apps/mobile/src/features/threads/use-composer-command-menu.ts
  • apps/server/src/provider/Layers/ProviderRegistry.test.ts
  • apps/server/src/provider/Layers/ProviderRegistry.ts
  • apps/web/src/components/chat/ChatComposer.tsx
  • packages/client-runtime/src/providerSkills.ts
  • packages/contracts/src/server.test.ts
  • packages/contracts/src/server.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

Workspace snapshots now expire after five minutes. Server, web, and mobile consumers use shared freshness checks. Claude snapshot creation probes workspace-specific slash commands and merges successful results.

Changes

Workspace snapshot capabilities

Layer / File(s) Summary
Snapshot freshness contract
packages/contracts/src/server.ts, packages/contracts/src/server.test.ts
Adds a five-minute TTL and isWorkspaceSnapshotFresh, with tests for expiry, invalid timestamps, and future timestamps.
Freshness-aware snapshot refresh and consumers
packages/client-runtime/src/providerSkills.ts, apps/server/src/provider/Layers/ProviderRegistry.ts, apps/server/src/provider/Layers/ProviderRegistry.test.ts, apps/mobile/src/features/threads/use-composer-command-menu.ts, apps/web/src/components/chat/ChatComposer.tsx
Uses the shared freshness predicate when refreshing, retaining, and validating workspace snapshots. The registry captures one timestamp for refresh guards and tests re-probing after expiry.
Workspace Claude slash-command probe
apps/server/src/provider/Layers/ClaudeProvider.ts, apps/server/src/provider/Layers/ClaudeCapabilitiesProbe.test.ts, apps/server/src/provider/Drivers/ClaudeDriver.ts
Probes slash commands for the snapshot cwd, deduplicates them with the built-in compact command, and adds successful results to Claude snapshots. Tests cover cwd propagation, ordering, duplicate precedence, and probe failure.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Bug fix

Sequence Diagram(s)

sequenceDiagram
  participant ClaudeDriver
  participant probeClaudeSlashCommandsForCwd
  participant ClaudeSdk
  ClaudeDriver->>probeClaudeSlashCommandsForCwd: request slash commands for cwd
  probeClaudeSlashCommandsForCwd->>ClaudeSdk: query capabilities with cwd
  ClaudeSdk-->>probeClaudeSlashCommandsForCwd: commands or failure
  probeClaudeSlashCommandsForCwd-->>ClaudeDriver: deduplicated commands or undefined
  ClaudeDriver->>ClaudeDriver: add commands to snapshot
Loading

Suggested reviewers: t3dotgg

Merge Risk: ⚪ Minimal · up to a191e

No concrete merge-blocking defect is established by the available evidence.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 10 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely identifies the main change: Claude now detects project slash commands.
Description check ✅ Passed The description explains the problem, implementation, fallback behavior, snapshot expiration, and user-visible result. It includes before-and-after UI videos. The template headings and checklist are n…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

Comment @coderabbitai help to get the list of available commands.

@macroscopeapp

macroscopeapp Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — The PR adds cwd-specific Claude command discovery and changes retained workspace snapshots to re-probe after five minutes across server and client paths. It also introduces a line-level suppression for a static-analysis diagnostic, making the change unsuitable for automatic approval.

Adjust the Minimum Blocking Severity for this repo — including turning it Off — in Settings. You can add or adjust custom eligibility rules. Learn more.

A workspace snapshot was kept for the life of the server process, so a
command or skill added to a project after it was first opened never
appeared. The registry returned early whenever the cwd was already
present, and both composers stopped asking once they saw a snapshot.

Give the snapshot a five-minute window, shared from contracts so the
registry and both clients change their minds at the same moment. Stale
snapshots still serve the menu while a refresh runs; dropping back to
the machine-wide lists would make project commands disappear and return.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added size:L 100-499 changed lines (additions + deletions). and removed size:S 10-29 changed lines (additions + deletions). labels Sep 22, 2026
Comment thread packages/client-runtime/src/providerSkills.ts
@macroscopeapp

This comment has been minimized.

…e wall clock

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

Copy link
Copy Markdown
Member

Note

This comment is posted by Julius' dot

The workspace probe fixes Claude commands missing on first load; the shared five-minute expiry also changes existing skill/command refresh across the registry and both clients. Could you explain why those need to ship together, given the earlier reply described staleness as a separate issue? Under the one-problem rule, please explain the dependency or split the independently useful refresh work so triage can finish.

@juliusmarminge

Copy link
Copy Markdown
Member

Thanks for working on this. We merged the orchestrator V2 rewrite in #2829, and we are closing this PR as part of that transition.

The patch conflicts with the rewrite in apps/server/src/provider/Drivers/ClaudeDriver.ts, packages/contracts/src/server.ts. Even where the conflict is small enough to rebase, we are asking for fresh PRs against the new base so we can review and verify the behavior in V2.

Sorry for the extra work this creates. If the change is still needed on V2, please rebuild it on current main, verify it there, and open a new PR linking back here. We're closing the current implementation without assuming the underlying request is resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants