feat(v0.5.2): cross-workspace context section in seed CLAUDE.md

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 <workspace>    view metadata and status of any workspace
  ctask notes <workspace>   read another workspace's notes.md
  ctask path <workspace>    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.
This commit is contained in:
2026-05-07 19:47:43 -04:00
parent 56d2e07716
commit 3b6be0d732
2 changed files with 66 additions and 0 deletions
+32
View File
@@ -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 <workspace> view metadata and status of any workspace
ctask notes <workspace> read another workspace's notes.md
ctask path <workspace> 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 <workspace> view metadata and status of any workspace
ctask notes <workspace> read another workspace's notes.md
ctask path <workspace> 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:
+34
View File
@@ -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 <workspace>",
"ctask notes <workspace>",
"ctask path <workspace>",
"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 <workspace>",
"ctask notes <workspace>",
"ctask path <workspace>",
"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) {