cli: new books dirs get a SessionStart hook that checks the viewer

The viewer offer (open_at_start) lived only in AGENTS.md, so it depended
on the agent remembering it on its first turn. The scaffold's
.claude/settings.json now runs just gui-status at session start and hands
the agent the result plus open_at_start.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Tpv1gBaepKjQiAVJqejGbA
This commit is contained in:
swaitsandClaude Opus 5.5 committed 2026-10-12 19:41:48 -06:00
1 parent b38c9e39cc
commit 799aee58ea
2 files changed
+22 -2

No files matched your search

+5
View File
@@ -97,6 +97,11 @@ fn the_server_is_registered_for_this_dir() {
settings["enabledMcpjsonServers"],
serde_json::json!(["wanderbooks"])
);
// Every session starts by checking the viewer against open_at_start.
let hook = settings["hooks"]["SessionStart"][0]["hooks"][0]["command"]
.as_str()
.expect("SessionStart hook command");
assert!(hook.contains("just gui-status") && hook.contains("open_at_start"));
// The justfile opens this dir's books in the GUI.
let just = fs::read_to_string(books.join("justfile")).unwrap();
assert!(just.contains("ledger-gui\" --data-dir \"{{justfile_directory()}}/books-data\""));