Initial commit
This commit is contained in:
11
.claude-plugin/plugin.json
Normal file
11
.claude-plugin/plugin.json
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"name": "time-awareness",
|
||||
"description": "Automatic temporal context with environment variables for time-aware Claude Code sessions",
|
||||
"version": "1.0.0",
|
||||
"author": {
|
||||
"name": "Time Awareness Developer"
|
||||
},
|
||||
"hooks": [
|
||||
"./hooks"
|
||||
]
|
||||
}
|
||||
3
README.md
Normal file
3
README.md
Normal file
@@ -0,0 +1,3 @@
|
||||
# time-awareness
|
||||
|
||||
Automatic temporal context with environment variables for time-aware Claude Code sessions
|
||||
15
hooks/hooks.json
Normal file
15
hooks/hooks.json
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"hooks": {
|
||||
"SessionStart": [
|
||||
{
|
||||
"hooks": [
|
||||
{
|
||||
"type": "command",
|
||||
"command": "${CLAUDE_PLUGIN_ROOT}/hooks/setup-temporal-context.sh",
|
||||
"timeout": 60
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
71
hooks/setup-temporal-context.sh
Normal file
71
hooks/setup-temporal-context.sh
Normal file
@@ -0,0 +1,71 @@
|
||||
#!/usr/bin/env bash
|
||||
# Claude Code Temporal Context Hook
|
||||
# Exports comprehensive temporal environment variables on session start
|
||||
|
||||
# ===== ISO 8601 UTC Timestamp =====
|
||||
export CLAUDE_TIMESTAMP_UTC=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
|
||||
export CLAUDE_DATE_UTC=$(date -u +"%Y-%m-%d")
|
||||
export CLAUDE_TIME_UTC=$(date -u +"%H:%M:%S")
|
||||
|
||||
# ===== Local Timestamp =====
|
||||
export CLAUDE_TIMESTAMP_LOCAL=$(date +"%Y-%m-%dT%H:%M:%S%z")
|
||||
export CLAUDE_DATE_LOCAL=$(date +"%Y-%m-%d")
|
||||
export CLAUDE_TIME_LOCAL=$(date +"%H:%M:%S")
|
||||
export CLAUDE_TIMEZONE=$(date +"%Z")
|
||||
export CLAUDE_TIMEZONE_OFFSET=$(date +"%z")
|
||||
|
||||
# ===== Day/Week Context =====
|
||||
export CLAUDE_DAY_OF_WEEK=$(date +"%A")
|
||||
export CLAUDE_DAY_OF_WEEK_NUM=$(date +"%u")
|
||||
export CLAUDE_DAY_OF_MONTH=$(date +"%d")
|
||||
export CLAUDE_DAY_OF_YEAR=$(date +"%j")
|
||||
export CLAUDE_WEEK_OF_YEAR=$(date +"%V")
|
||||
export CLAUDE_MONTH=$(date +"%B")
|
||||
export CLAUDE_MONTH_NUM=$(date +"%m")
|
||||
export CLAUDE_YEAR=$(date +"%Y")
|
||||
export CLAUDE_QUARTER=$(( ($(date +%-m)-1)/3 + 1 ))
|
||||
|
||||
# ===== Time Period Flags =====
|
||||
HOUR=$(date +%-H)
|
||||
|
||||
# Market hours (NYSE: 9:30 AM - 4:00 PM ET)
|
||||
export CLAUDE_IS_MARKET_HOURS="false"
|
||||
if [ "$CLAUDE_TIMEZONE" = "EST" ] || [ "$CLAUDE_TIMEZONE" = "EDT" ]; then
|
||||
if [ $HOUR -ge 9 ] && [ $HOUR -lt 16 ]; then
|
||||
if [ $HOUR -eq 9 ] && [ $(date +%-M) -lt 30 ]; then
|
||||
CLAUDE_IS_MARKET_HOURS="false"
|
||||
else
|
||||
CLAUDE_IS_MARKET_HOURS="true"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
export CLAUDE_IS_MARKET_HOURS
|
||||
|
||||
# Business hours (9 AM - 5 PM local)
|
||||
export CLAUDE_IS_BUSINESS_HOURS="false"
|
||||
if [ $HOUR -ge 9 ] && [ $HOUR -lt 17 ]; then
|
||||
CLAUDE_IS_BUSINESS_HOURS="true"
|
||||
fi
|
||||
export CLAUDE_IS_BUSINESS_HOURS
|
||||
|
||||
# Weekend check
|
||||
export CLAUDE_IS_WEEKEND="false"
|
||||
if [ "$CLAUDE_DAY_OF_WEEK_NUM" -ge 6 ]; then
|
||||
CLAUDE_IS_WEEKEND="true"
|
||||
fi
|
||||
export CLAUDE_IS_WEEKEND
|
||||
|
||||
# ===== Unix Timestamp =====
|
||||
export CLAUDE_UNIX_TIMESTAMP=$(date +%s)
|
||||
|
||||
# ===== Relative Time =====
|
||||
export CLAUDE_HOUR_12=$(date +"%I %p")
|
||||
export CLAUDE_HOUR_24=$(date +"%H")
|
||||
|
||||
# ===== Human-Readable Summary =====
|
||||
export CLAUDE_TIME_SUMMARY="$CLAUDE_DAY_OF_WEEK, $CLAUDE_MONTH $CLAUDE_DAY_OF_MONTH, $CLAUDE_YEAR at $CLAUDE_TIME_LOCAL $CLAUDE_TIMEZONE"
|
||||
|
||||
# ===== Output temporal context to session =====
|
||||
echo "🕐 Temporal Context Loaded: $CLAUDE_TIME_SUMMARY"
|
||||
echo "📅 $CLAUDE_DATE_LOCAL | ⏰ Week $CLAUDE_WEEK_OF_YEAR, Q$CLAUDE_QUARTER | 🌍 $CLAUDE_TIMEZONE"
|
||||
echo "💼 Business Hours: $CLAUDE_IS_BUSINESS_HOURS | 📈 Market Hours: $CLAUDE_IS_MARKET_HOURS | 🎉 Weekend: $CLAUDE_IS_WEEKEND"
|
||||
49
plugin.lock.json
Normal file
49
plugin.lock.json
Normal file
@@ -0,0 +1,49 @@
|
||||
{
|
||||
"$schema": "internal://schemas/plugin.lock.v1.json",
|
||||
"pluginId": "gh:Sycochucky/claude-code-toolkit:plugins/time-awareness",
|
||||
"normalized": {
|
||||
"repo": null,
|
||||
"ref": "refs/tags/v20251128.0",
|
||||
"commit": "3a42e5d24bcb6828a9f7af402468fc00b9f60a4a",
|
||||
"treeHash": "148e88d28a7222be276c736975d4c48c82dea4e06ce8c722f0bc23caa910567e",
|
||||
"generatedAt": "2025-11-28T10:12:49.993814Z",
|
||||
"toolVersion": "publish_plugins.py@0.2.0"
|
||||
},
|
||||
"origin": {
|
||||
"remote": "git@github.com:zhongweili/42plugin-data.git",
|
||||
"branch": "master",
|
||||
"commit": "aa1497ed0949fd50e99e70d6324a29c5b34f9390",
|
||||
"repoRoot": "/Users/zhongweili/projects/openmind/42plugin-data"
|
||||
},
|
||||
"manifest": {
|
||||
"name": "time-awareness",
|
||||
"description": "Automatic temporal context with environment variables for time-aware Claude Code sessions",
|
||||
"version": "1.0.0"
|
||||
},
|
||||
"content": {
|
||||
"files": [
|
||||
{
|
||||
"path": "README.md",
|
||||
"sha256": "1c65556d1b99d1e98cc82338ae1253ad69580866cee465562b6e72048b831a78"
|
||||
},
|
||||
{
|
||||
"path": "hooks/setup-temporal-context.sh",
|
||||
"sha256": "e886154a453cc0c9fbf9667036445b1b0dd3ca1b894a95adfecdcdf93b073164"
|
||||
},
|
||||
{
|
||||
"path": "hooks/hooks.json",
|
||||
"sha256": "6c26cb8a78c4c34ed94e3621c0ad5601473caaec94d79418decad257bf8b0384"
|
||||
},
|
||||
{
|
||||
"path": ".claude-plugin/plugin.json",
|
||||
"sha256": "07177a2d50bb4ec49863a7e14d76183bd4ea7cf7fd797299eb6c05f2f14968b7"
|
||||
}
|
||||
],
|
||||
"dirSha256": "148e88d28a7222be276c736975d4c48c82dea4e06ce8c722f0bc23caa910567e"
|
||||
},
|
||||
"security": {
|
||||
"scannedAt": null,
|
||||
"scannerVersion": null,
|
||||
"flags": []
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user