Command
aspens doc init
What happened?
When running aspens doc init from a subdirectory of a monorepo
(e.g. repo/backend/), docs and hooks are generated correctly in
backend/.claude/. However:
- Hook paths break — settings.json uses
$CLAUDE_PROJECT_DIR/.claude/hooks/..., but Claude Code sets
CLAUDE_PROJECT_DIR to the git root (e.g. repo/), not the cwd
where claude was launched. So the hooks resolve to
repo/.claude/hooks/... instead of repo/backend/.claude/hooks/...,
causing UserPromptSubmit hook error on every prompt.
- aspens doc sync fails — Running aspens doc sync --install-hook
from the subdirectory returns Error: Not a git repository
because .git/ lives at the parent.
Environment:
- Monorepo: tutor/ (git root) with tutor/backend/ and
tutor/frontend/ as separate projects
- aspens v0.6.0
- Claude Code on macOS
Workaround:
Replace $CLAUDE_PROJECT_DIR with a hardcoded absolute path or the
subdirectory-relative path in settings.json.
What did you expect?
Expected behavior:
- Hook paths should account for subdirectory offset from git root
(e.g. $CLAUDE_PROJECT_DIR/backend/.claude/hooks/...)
- aspens doc sync should walk up to find .git/ or accept a
--git-root flag
Steps to reproduce
No response
Node.js version
No response
OS
No response
Additional context
No response
Command
aspens doc init
What happened?
When running aspens doc init from a subdirectory of a monorepo
(e.g. repo/backend/), docs and hooks are generated correctly in
backend/.claude/. However:
$CLAUDE_PROJECT_DIR/.claude/hooks/..., but Claude Code sets
CLAUDE_PROJECT_DIR to the git root (e.g. repo/), not the cwd
where claude was launched. So the hooks resolve to
repo/.claude/hooks/... instead of repo/backend/.claude/hooks/...,
causing UserPromptSubmit hook error on every prompt.
from the subdirectory returns Error: Not a git repository
because .git/ lives at the parent.
Environment:
tutor/frontend/ as separate projects
Workaround:
Replace $CLAUDE_PROJECT_DIR with a hardcoded absolute path or the
subdirectory-relative path in settings.json.
What did you expect?
Expected behavior:
(e.g. $CLAUDE_PROJECT_DIR/backend/.claude/hooks/...)
--git-root flag
Steps to reproduce
No response
Node.js version
No response
OS
No response
Additional context
No response