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: scripts/track-code-change.sh
+8-2Lines changed: 8 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -67,6 +67,12 @@ if command -v jq &> /dev/null; then
67
67
fi
68
68
fi
69
69
70
+
# Skip non-educational file changes without consuming the session budget
71
+
if [ "$TECH"="other" ];then
72
+
echo"{}"
73
+
exit 0
74
+
fi
75
+
70
76
# --- Rate limiting ---
71
77
NOW=$(date +%s)
72
78
@@ -114,10 +120,10 @@ if command -v jq &> /dev/null; then
114
120
115
121
if [ "$IS_FIRST_EVER"="true" ];then
116
122
# First-time encounter: micro-lesson about the technology
117
-
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."
123
+
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."
118
124
else
119
125
# Already-seen technology: inline insight about the specific change
120
-
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."
126
+
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."
Copy file name to clipboardExpand all lines: scripts/track-command.sh
+8-5Lines changed: 8 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -74,6 +74,12 @@ if command -v jq &> /dev/null; then
74
74
# Log the command
75
75
echo"{\"timestamp\":\"$TIMESTAMP\",\"command\":\"$(echo "$COMMAND"| head -c 200)\",\"concept\":\"$CONCEPT\"}">>"$COMMANDS_LOG"
76
76
77
+
# Skip non-educational commands without consuming the session budget
78
+
if [ -z"$CONCEPT" ];then
79
+
echo"{}"
80
+
exit 0
81
+
fi
82
+
77
83
# Track concept in session and lifetime if new and meaningful
78
84
IS_FIRST_EVER="false"
79
85
if [ -n"$CONCEPT" ] && [ -f"$PROFILE_FILE" ];then
@@ -140,13 +146,10 @@ if command -v jq &> /dev/null; then
140
146
141
147
if [ "$IS_FIRST_EVER"="true" ] && [ -n"$CONCEPT" ];then
142
148
# First-time encounter: micro-lesson about the concept
143
-
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."
149
+
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."
144
150
elif [ -n"$CONCEPT" ];then
145
151
# Already-seen concept: brief inline insight about this specific command
146
-
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."
147
-
else
148
-
# Unknown command type: still provide a brief hint
149
-
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."
152
+
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."
0 commit comments