Skip to content

Commit f4e7719

Browse files
committed
claude: auto-activate mise
Add a hook to auto-activate mise when using Claude Code on the web. Drops need of manual activation section in instructions.
1 parent f3972ce commit f4e7719

File tree

3 files changed

+31
-15
lines changed

3 files changed

+31
-15
lines changed

.claude/settings.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"hooks": {
3+
"SessionStart": [
4+
{
5+
"matcher": "startup",
6+
"hooks": [
7+
{
8+
"type": "command",
9+
"command": "\"$CLAUDE_PROJECT_DIR\"/tools/bin/claude-code-web-activate.sh"
10+
}
11+
]
12+
}
13+
]
14+
}
15+
}

CLAUDE.md

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -560,18 +560,3 @@ when the feature is released.
560560
This requires breaking lines at natural grammatical boundaries
561561
(such as after complete sentences, clauses, or list items),
562562
while remaining within the 80-character limit.
563-
564-
# Common problems
565-
566-
## command not found
567-
568-
If any command above fails because the command is not found, run:
569-
570-
```bash
571-
./tools/bin/mise trust
572-
./tools/bin/mise install
573-
eval "$(./tools/bin/mise env)"
574-
```
575-
576-
The last command will configure the shell environment
577-
to make al tools available in the current terminal session.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/usr/bin/env bash
2+
set -e
3+
4+
if [[ "$CLAUDE_CODE_REMOTE" != "true" ]]; then
5+
exit 0 # nothing to do for local
6+
fi
7+
8+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
9+
MISE="${MISE:-"$SCRIPT_DIR/mise"}"
10+
11+
"$MISE" trust
12+
"$MISE" install
13+
14+
if [[ -n "${CLAUDE_ENV_FILE:-}" ]]; then
15+
"$MISE" env >> "$CLAUDE_ENV_FILE"
16+
fi

0 commit comments

Comments
 (0)