Skip to content

Commit 9c0bb50

Browse files
committed
remove hook
1 parent a12ce84 commit 9c0bb50

File tree

3 files changed

+15
-10
lines changed

3 files changed

+15
-10
lines changed

nix/hm/ai/claude/hooks/session_save.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ def generate_summary(messages: list, cwd: str) -> str:
225225
return ""
226226

227227

228-
def save_summary(cwd: str, summary: str, timestamp: str, session_id: str):
228+
def save_summary(cwd: str, summary: str, timestamp: str, session_id: str, session_file: str = ""):
229229
"""Save summary to session-summary directory with session ID.
230230
231231
NOTE: This function is paired with `session_summary.py` which reads these files
@@ -241,6 +241,7 @@ def save_summary(cwd: str, summary: str, timestamp: str, session_id: str):
241241
summary: Summary text
242242
timestamp: Timestamp string (YYYYMMDD-HHMMSS)
243243
session_id: Session ID
244+
session_file: Path to the full session file (relative to cwd)
244245
"""
245246
if not summary or not session_id:
246247
return
@@ -257,10 +258,15 @@ def save_summary(cwd: str, summary: str, timestamp: str, session_id: str):
257258
# Use existing file or create new one with timestamp
258259
summary_file = existing_file or summary_dir / f"{timestamp}-summary-ID_{session_id}.md"
259260

261+
# Append session file reference if available
262+
content = summary
263+
if session_file:
264+
content = f"{summary}\n\nFull session: {session_file}"
265+
260266
try:
261267
# Always overwrite summary (update, don't append)
262268
with open(summary_file, "w") as f:
263-
f.write(summary)
269+
f.write(content)
264270
os.chmod(summary_file, 0o600)
265271
print(f"✓ Summary saved to {summary_file.name}", file=sys.stderr)
266272
except Exception as e:
@@ -322,7 +328,9 @@ def save_session(cwd: str, messages: list, session_id: str, reason: str = ""):
322328
# Generate and save summary for next session (only on "clear" reason)
323329
if reason == "clear":
324330
summary = generate_summary(messages, cwd)
325-
save_summary(cwd, summary, timestamp, session_id)
331+
# Pass relative session file path
332+
session_file_rel = str(filepath.relative_to(cwd)) if filepath else ""
333+
save_summary(cwd, summary, timestamp, session_id, session_file_rel)
326334
elif reason:
327335
print(f"⊘ Summary skipped (reason='{reason}', need 'clear')", file=sys.stderr)
328336

nix/hm/ai/claude/hooks/session_summary.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,12 @@ def main():
7979
sys.exit(0)
8080

8181
# Return as additional context for new session
82-
context = f"""## Previous Session Context
82+
context = f"""<history-summary>
8383
84-
{summary}"""
84+
{summary}</history-summary>"""
8585

8686
# Create a visible system message
87-
system_msg = f"📝 Previous session: {summary}"
87+
system_msg = f"History context loaded"
8888

8989
output = {
9090
"systemMessage": system_msg,

nix/hm/ai/claude/settings.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@
151151
"WebFetch",
152152
"WebSearch",
153153
"Read(./.env)",
154+
"Read(/dev/**)",
154155
"Read(./.env.*)",
155156
"Read(.private.*)",
156157
"Read(./secrets/**)",
@@ -205,10 +206,6 @@
205206
{
206207
"type": "command",
207208
"command": "uv run ~/.dotfiles/nix/hm/ai/claude/hooks/session_summary.py"
208-
},
209-
{
210-
"type": "command",
211-
"command": "uv run ~/.dotfiles/nix/hm/ai/claude/hooks/session_start_handoff.py"
212209
}
213210
]
214211
}

0 commit comments

Comments
 (0)