fix(kugetsu): init creates base session in ~/.kugetsu-worktrees and adds context to forked sessions #114

Merged
shoko merged 1 commits from fix/session-context-and-init-worktree into main 2026-04-02 16:35:12 +02:00
Owner

Changes

  1. Init worktree directory: During kugetsu init, cd to ~/.kugetsu-worktrees before creating base session. This keeps everything inside a predictable directory structure.

  2. Fork context: Add kugetsu_get_fork_context() that provides:

    • Important working rules (stop on error, do NOT pivot to other work)
    • Repository configuration from repos.json
    • Environment file location info
  3. Fork message: Prepend context to user message when forking session

Why

  • Prevents external_directory permission errors by keeping base session in ~/.kugetsu-worktrees
  • Prevents agent from pivoting to other work when encountering errors
  • Provides repository URLs and tokens to help agent work correctly
## Changes 1. **Init worktree directory**: During `kugetsu init`, cd to `~/.kugetsu-worktrees` before creating base session. This keeps everything inside a predictable directory structure. 2. **Fork context**: Add `kugetsu_get_fork_context()` that provides: - Important working rules (stop on error, do NOT pivot to other work) - Repository configuration from repos.json - Environment file location info 3. **Fork message**: Prepend context to user message when forking session ## Why - Prevents external_directory permission errors by keeping base session in ~/.kugetsu-worktrees - Prevents agent from pivoting to other work when encountering errors - Provides repository URLs and tokens to help agent work correctly
shoko added 1 commit 2026-04-02 16:29:38 +02:00
1. Init: cd to ~/.kugetsu-worktrees before creating base session
   This keeps all worktrees inside a predictable directory structure
   and avoids external_directory permission issues

2. Fork context: Add kugetsu_get_fork_context() that provides:
   - Important working rules (stop on error, don't pivot)
   - Repository configuration from repos.json
   - Environment file location info

3. Fork message: Prepend context to user message when forking session
shoko force-pushed fix/session-context-and-init-worktree from 78ed3bde7f to 8c639e2928 2026-04-02 16:32:18 +02:00 Compare
han approved these changes 2026-04-02 16:34:41 +02:00
han left a comment
First-time contributor

lgtm

lgtm
shoko merged commit 1c1d18b9ae into main 2026-04-02 16:35:12 +02:00
Sign in to join this conversation.