diff --git a/README.md b/README.md index 1629ed0..2597938 100644 --- a/README.md +++ b/README.md @@ -187,6 +187,7 @@ Type `/` in the TUI to open the autocomplete popup. Available commands: | `/btw` | Side chat with full context that doesn't add to the main thread. | | `/skills` | List discovered skills (SKILL.md files) and preview their bodies. | | `/compact` | Summarize the transcript into one message to free up context. | +| `/study` | Run the canned prompt "Read and understand everything in the current directory." so the agent has full project context before you start asking targeted questions. | | `/jail` | Confine tools to the current directory. | | `/unjail` | Allow tools to touch paths outside again. | | `/reload-ext` | Hot-reload all extensions (re-read manifests, respawn subprocesses, rebuild tool registry). | diff --git a/internal/agent/modes/interactive.go b/internal/agent/modes/interactive.go index 8dab21a..f86cf94 100644 --- a/internal/agent/modes/interactive.go +++ b/internal/agent/modes/interactive.go @@ -1452,6 +1452,22 @@ func (i *Interactive) runSlash(ctx context.Context, cmd string) (done bool) { i.openSkillsDialog() case "/compact": i.runCompact(ctx, false) + case "/study": + // Canned prompt that tells the agent to read every file + // in the current directory so its later turns have the + // whole project in context. Dispatched through the normal + // queue-or-start path so it behaves identically to + // typing the prompt by hand. + const studyPrompt = "Read and understand everything in the current directory." + i.mu.Lock() + if i.busy { + i.queued = append(i.queued, studyPrompt) + i.mu.Unlock() + i.invalidate() + break + } + i.mu.Unlock() + i.startTurn(ctx, studyPrompt) case "/jail": if i.cfg.Sandbox == nil { i.mu.Lock() diff --git a/internal/agent/modes/slash_suggest.go b/internal/agent/modes/slash_suggest.go index 929535f..dc80de8 100644 --- a/internal/agent/modes/slash_suggest.go +++ b/internal/agent/modes/slash_suggest.go @@ -40,6 +40,7 @@ var slashCatalog = []slashCommand{ {Name: "/session", Desc: "export the current session to a .zotsession file, or import one"}, {Name: "/jump", Desc: "scroll the chat to a previous turn (or /jump )"}, {Name: "/compact", Desc: "summarize and replace the transcript to free up context"}, + {Name: "/study", Desc: "read every file in the current directory so the agent has full project context"}, {Name: "/btw", Desc: "side-chat that doesn't add to the main thread (saves tokens)"}, {Name: "/jail", Desc: "confine tools to the current directory"}, {Name: "/skills", Desc: "list discovered skills (SKILL.md files)"},