Skip to content
Source
Sign inSign up
pingdotgg/t3code

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

ClosedJoeEverest(GitHub profile, opens in a new tab)wants to merge 4 commits intomain fromrefs/pull/13077/headopened View on GitHub

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

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.
    1. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted

    2. Copilot review overview

      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)
      • High severity [Workspace snapshot cache never refreshes after its initial lookup](#discussion_r4073370485) · New
    3. 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.
      FileSummaryFindings
      apps/​server/​src/​provider/​Layers/​ClaudeProvider.tsImplements cwd-specific slash-command probing.None
      apps/​server/​src/​provider/​Layers/​ClaudeCapabilitiesProbe.test.tsTests workspace discovery and fallback behavior.None
      apps/​server/​src/​provider/​Drivers/​ClaudeDriver.tsIntegrates 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.

  • coderabbitai[bot](GitHub profile, opens in a new tab)commented
    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 96390f7ac64f8126c6cbb2b7677d923a372ccb4e and a191ee4f77e606bb9cae610c2d16e4fc2c1175f1.

    📒 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

    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 nameStatusExplanationResolution
    Docstring Coverage⚠️ WarningDocstring 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 nameStatusExplanation
    Title check✅ PassedThe title clearly and concisely identifies the main change: Claude now detects project slash commands.
    Description check✅ PassedThe 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✅ PassedCheck skipped because no linked issues were found for this pull request.
    Out of Scope Changes check✅ PassedCheck 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[bot](GitHub profile, opens in a new tab)commented

    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](https://app.macroscope.com/pingdotgg/settings#Repos). You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
  • macroscopeapp[bot](GitHub profile, opens in a new tab)commented

    Effect Service Conventions found one blocking issue: packages/client-runtime/src/providerSkills.ts adds an Effect diagnostic suppression without an adjacent explanation. An inline review comment includes the suggested fix.

    Posted via Macroscope — Effect Service Conventions
  • 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.

  • 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.

  • juliusmarminge closed this

  • Sign in to join this conversation.