From 3b6be0d732c37bce99b5d9afc6970312a1b710d4 Mon Sep 17 00:00:00 2001 From: typebasedio Date: Thu, 7 May 2026 19:47:43 -0400 Subject: [PATCH] feat(v0.5.2): cross-workspace context section in seed CLAUDE.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds a concise "## Cross-Workspace Context" section to both the task and project CLAUDE.md seed templates. Teaches the agent to inspect related workspaces with the new commands before making changes: ctask list --all discover all workspaces, including archived ctask info view metadata and status of any workspace ctask notes read another workspace's notes.md ctask path get the filesystem path to inspect files Closes the v0.5.2 design loop: ctask exposes workspace context through CLI commands and lets agents consume it themselves. The seed text is read-only by convention — the section explicitly asks the agent to treat other workspaces as read-only unless the user grants modification rights. Applies to newly created workspaces only. Existing workspaces keep their current CLAUDE.md (per spec: no retroactive overwrite). Users with custom seed directories see this only if they update their seeds. --- internal/seed/templates.go | 32 +++++++++++++++++++++++++++++++ internal/seed/templates_test.go | 34 +++++++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+) diff --git a/internal/seed/templates.go b/internal/seed/templates.go index a65e1ed..195792c 100644 --- a/internal/seed/templates.go +++ b/internal/seed/templates.go @@ -26,6 +26,22 @@ This is a ctask workspace. Prefer operating inside this directory unless explici - Record important assumptions and actions in notes.md - Keep the workspace root clean -- use subdirectories for organization +## Cross-Workspace Context + +Related work may exist in other ctask workspaces. For project continuation, +migration, debugging, or building on prior work, inspect related workspaces +before making changes. + +Available commands: + + ctask list --all discover all workspaces, including archived + ctask info view metadata and status of any workspace + ctask notes read another workspace's notes.md + ctask path get the filesystem path to inspect files directly + +Treat other workspaces as read-only unless the user explicitly asks you to +modify them. + ## Session Handoff Before ending a session, append a brief summary to notes.md with: @@ -84,6 +100,22 @@ Do not initialize additional git repositories inside the project subdirectory or any other subdirectory. If you need to check git status or make commits, the repo root is the workspace root. +## Cross-Workspace Context + +Related work may exist in other ctask workspaces. For project continuation, +migration, debugging, or building on prior work, inspect related workspaces +before making changes. + +Available commands: + + ctask list --all discover all workspaces, including archived + ctask info view metadata and status of any workspace + ctask notes read another workspace's notes.md + ctask path get the filesystem path to inspect files directly + +Treat other workspaces as read-only unless the user explicitly asks you to +modify them. + ## Session Handoff Before ending a session, append a brief summary to notes.md with: diff --git a/internal/seed/templates_test.go b/internal/seed/templates_test.go index 50c04af..9f3bcf2 100644 --- a/internal/seed/templates_test.go +++ b/internal/seed/templates_test.go @@ -89,6 +89,40 @@ func TestClaudeMDProjectDescribesWorkspaceStructure(t *testing.T) { } } +func TestClaudeMDContainsCrossWorkspaceSection(t *testing.T) { + // v0.5.2: both templates teach agents to use ctask's read-only context + // commands before starting work. + content := ClaudeMD("ignored", "ignored", "ignored") + for _, must := range []string{ + "## Cross-Workspace Context", + "ctask list --all", + "ctask info ", + "ctask notes ", + "ctask path ", + "Treat other workspaces as read-only", + } { + if !strings.Contains(content, must) { + t.Errorf("task CLAUDE.md missing cross-workspace marker %q", must) + } + } +} + +func TestClaudeMDProjectContainsCrossWorkspaceSection(t *testing.T) { + content := ClaudeMDProject() + for _, must := range []string{ + "## Cross-Workspace Context", + "ctask list --all", + "ctask info ", + "ctask notes ", + "ctask path ", + "Treat other workspaces as read-only", + } { + if !strings.Contains(content, must) { + t.Errorf("project CLAUDE.md missing cross-workspace marker %q", must) + } + } +} + func TestNotesMDIsASCII(t *testing.T) { content := NotesMD("test title") for i, b := range []byte(content) {