You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+12Lines changed: 12 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -73,6 +73,18 @@ That's it. Start building — CodeSensei activates automatically.
73
73
74
74
> **Requires:**[Claude Code](https://code.claude.com) with plugin support. Hook scripts use `jq` for profile tracking — install with `brew install jq` (macOS) or `apt install jq` (Linux).
75
75
76
+
### Updating
77
+
78
+
```bash
79
+
# Update the marketplace catalog first:
80
+
claude plugin marketplace update DojoCodingLabs/code-sensei
81
+
82
+
# Then update the plugin:
83
+
claude plugin update code-sensei@code-sensei
84
+
```
85
+
86
+
Restart your Claude Code session after updating — hooks are loaded at session start.
Copy file name to clipboardExpand all lines: agents/sensei.md
+11Lines changed: 11 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -83,6 +83,17 @@ When a PostToolUse hook injects `additionalContext` containing "🥋 CodeSensei
83
83
- Calibrate language to the user's belt level (included in the trigger)
84
84
- Example for White Belt: "By the way, that `.css` file Claude just created? That's what controls how your page LOOKS — the colors, sizes, and spacing. Think of HTML as the skeleton and CSS as the clothing."
85
85
86
+
## Automatic Inline Insights
87
+
88
+
When a PostToolUse hook injects `additionalContext` containing "🥋 CodeSensei inline insight:", you MUST act on it:
89
+
- The hook fires after EVERY code change or shell command, not just first-time encounters
90
+
- Provide a brief 1-2 sentence explanation of what the change does and why
91
+
- Weave it naturally into your response — don't interrupt the flow
92
+
- If the change is trivial (e.g. whitespace, minor formatting), skip the explanation
93
+
- Calibrate language to the user's belt level (included in the trigger)
94
+
- Example for White Belt: "That edit added a 'click listener' — it's like telling a button 'when someone clicks you, do THIS.'"
95
+
- Example for Blue Belt: "Added an event handler on the submit button that prevents default form behavior and posts the data via fetch."
96
+
86
97
## Quiz Format
87
98
88
99
Quizzes come in three formats. The /code-sensei:quiz command runs a quiz-selector script that determines the format.
# First-time encounter: micro-lesson about the technology
68
70
CONTEXT="🥋 CodeSensei micro-lesson trigger: The user just encountered '$TECH' for the FIRST TIME (file: $FILE_PATH). Their belt level is '$BELT'. Provide a brief 2-sentence explanation of what $TECH is and why it matters for their project. Adapt language to their belt level. Keep it concise and non-intrusive — weave it naturally into your response, don't stop everything for a lecture."
69
-
# Output structured JSON so Claude sees the teaching trigger via additionalContext
# Already-seen technology: inline insight about the specific change
73
+
CONTEXT="🥋 CodeSensei inline insight: Claude just used '$TOOL_NAME' on '$FILE_PATH' ($TECH). The user's belt level is '$BELT'. Provide a brief 1-2 sentence explanation of what this change does and why, adapted to their belt level. Keep it natural and non-intrusive — weave it into your response as a quick teaching moment."
# Sanitize command for JSON (remove quotes and special chars)
70
+
SAFE_CMD=$(echo "$COMMAND"| head -c 80 | tr '"'"'"| tr '\\''/')
71
+
72
+
if [ "$IS_FIRST_EVER"="true" ] && [ -n"$CONCEPT" ];then
73
+
# First-time encounter: micro-lesson about the concept
72
74
CONTEXT="🥋 CodeSensei micro-lesson trigger: The user just encountered '$CONCEPT' for the FIRST TIME (command: $SAFE_CMD). Their belt level is '$BELT'. Provide a brief 2-sentence explanation of what $CONCEPT means and why it matters. Adapt language to their belt level. Keep it concise and non-intrusive."
# Already-seen concept: brief inline insight about this specific command
77
+
CONTEXT="🥋 CodeSensei inline insight: Claude just ran a '$CONCEPT' command ($SAFE_CMD). The user's belt level is '$BELT'. Provide a brief 1-sentence explanation of what this command does, adapted to their belt level. Keep it natural and non-intrusive."
78
+
else
79
+
# Unknown command type: still provide a brief hint
80
+
CONTEXT="🥋 CodeSensei inline insight: Claude just ran a shell command ($SAFE_CMD). The user's belt level is '$BELT'. If this command is educational, briefly explain what it does in 1 sentence. If trivial, skip the explanation."
0 commit comments