Point agents at /agents/<name>/work and default subagents to it
The system prompt now names the work dir for worktrees, clones and build trees, and keeps state/ for notes. A subagent started without a dir runs in the agent's work dir instead of the daemon's own cwd.
This commit is contained in:
parent
db8f144a11
commit
043c9445f6
7 changed files with 32 additions and 12 deletions
|
|
@ -30,6 +30,15 @@ pub fn state_dir() -> PathBuf {
|
|||
PathBuf::from(format!("/agents/{label}/state"))
|
||||
}
|
||||
|
||||
/// The agent's persistent work dir, a sibling of [`state_dir`]
|
||||
/// (`/agents/<name>/work`). It has no `CLAUDE.md` above it, so a subagent
|
||||
/// started here does not load the agent's own. This is the working
|
||||
/// directory a subagent gets when `start` is given no `dir`.
|
||||
#[must_use]
|
||||
pub fn work_dir() -> PathBuf {
|
||||
state_dir().with_file_name("work")
|
||||
}
|
||||
|
||||
/// Where this agent's named subagent role files live, one markdown file per
|
||||
/// role under the agent's own [`state_dir`]. Per-agent rather than
|
||||
/// hive-wide: the clauses a role carries came out of one agent's own prompt
|
||||
|
|
|
|||
Loading…
Reference in a new issue