Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion plugin/scripts/session-start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ CONTEXT=""
if ! command_exists git-kb; then
CONTEXT="# GitKB Setup${NL}${NL}The GitKB CLI is not installed, so GitKB code intelligence is unavailable in this session.${NL}${NL}Install it with:${NL}${NL}\`\`\`bash${NL}brew install gitkb/tap/gitkb${NL}# or${NL}curl -fsSL https://get.gitkb.com/install.sh | bash${NL}\`\`\`${NL}${NL}After installing, use \`git-kb code doctor --json\`, \`git-kb code index\`, and related \`git-kb code ... --json\` commands in any Git repo. Full persistent KB setup is optional via \`git-kb init && git-kb init claude\`."
elif GITKB_ROOT="$CWD" git-kb info >/dev/null 2>&1; then
CONTEXT="# GitKB Ready${NL}${NL}This project has a full \`.kb\` setup. For durable tasks, knowledge, sync, or full Claude integration, use the canonical assets installed by \`git-kb init claude\`. If setup appears stale or missing, ask the user before running \`git-kb init claude --dry-run\` or \`git-kb doctor --check repos,code,kb --json\`."
CONTEXT="# GitKB Ready${NL}${NL}This project has a full \`.kb\` setup. For durable tasks, knowledge, sync, or full Claude integration, use the canonical assets installed by \`git-kb init claude\`. If setup appears stale or missing, ask the user before running \`git-kb init claude --dry-run\`, \`git-kb doctor --check repos,kb --json\`, or \`git-kb code doctor --json\`."
elif git -C "$CWD" rev-parse --show-toplevel >/dev/null 2>&1; then
CONTEXT="# GitKB Code Intelligence${NL}${NL}This Git repo does not have a full \`.kb\` yet, but GitKB code intelligence works without initialization.${NL}${NL}**Prefer \`git-kb code ... --json\` over grep for code exploration.** Grep matches text; \`git-kb code\` understands the AST and call graph, and JSON output preserves complete symbol IDs and stable fields.${NL}${NL}For code questions, prefer these local CLI commands:${NL}${NL}- \`git-kb code doctor --json\` to inspect language/index health.${NL}- \`git-kb code index\` before first analysis or after large changes.${NL}- \`git-kb code symbols --json\`, \`git-kb code callers <symbol> --json\`, \`git-kb code callees <symbol> --json\`, \`git-kb code impact <path> --json\`, \`git-kb code dead --json\`, and \`git-kb code query hotspots --json\` for code intelligence.${NL}${NL}Do not require \`git-kb init\` for code intelligence. If the user wants durable tasks, knowledge, sync, or full Claude integration, guide them through:${NL}${NL}\`\`\`bash${NL}git-kb init${NL}git-kb init claude${NL}\`\`\`${NL}${NL}MCP is supported after full KB setup today; use CLI fallback when MCP is unavailable."
else
Expand Down
3 changes: 2 additions & 1 deletion tests/session-start.bats
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ teardown() {
ctx=$(echo "$output" | jq -r '.hookSpecificOutput.additionalContext')
[[ "$ctx" == *"GitKB Ready"* ]]
[[ "$ctx" == *"git-kb init claude"* ]]
[[ "$ctx" == *"git-kb doctor --check repos,code,kb --json"* ]]
[[ "$ctx" == *"git-kb doctor --check repos,kb --json"* ]]
[[ "$ctx" == *"git-kb code doctor --json"* ]]
[[ "$ctx" != *"tasks/test-1"* ]]

local wp
Expand Down
Loading