Skip to content

Instantly share code, notes, and snippets.

@iboss-ptk
iboss-ptk / CLAUDE_CODE_NOTIFICATION.md
Last active April 21, 2026 05:02
Claude Code stop hook: ntfy.sh + say notification

Claude Code Stop Hook — ntfy.sh Push Notification

Sends a push notification when a Claude Code session finishes — but only if it ran longer than 30 seconds.

Motivation

When Claude is doing a long agentic task (running tests, implementing a feature, exploring a codebase), you often switch context and forget to check back. Short sessions don't need a ping — you're still watching. Long ones do — you've moved on.

This hook solves that by tracking session duration and only notifying when Claude actually did meaningful work.

import { LitActionResource } from "@lit-protocol/auth-helpers";
import {
AUTH_METHOD_SCOPE,
AUTH_METHOD_TYPE,
LIT_ABILITY,
LIT_NETWORK,
LIT_RPC,
} from "@lit-protocol/constants";
import { LitContracts } from "@lit-protocol/contracts-sdk";
import { EthWalletProvider } from "@lit-protocol/lit-auth-client";
import { SigningCosmWasmClient } from "@cosmjs/cosmwasm-stargate";
const rpcURL = "https://rpc.osmosis.zone:443";
const contractAddress =
"osmo1em6xs47hd82806f5cxgyufguxrrc7l0aqx7nzzptjuqgswczk8csavdxek";
const client = await SigningCosmWasmClient.connect(rpcURL);
type Limiter = [[string, string], { static_limiter: { upper_limit: string } }];
import { SigningStargateClient, StdFee, coin } from "@cosmjs/stargate";
import { chains } from "chain-registry";
import { getOfflineSignerProto } from "cosmjs-utils";
import { cosmwasm } from "osmojs";
import { ExecuteMsg } from "./contracts/WbtcController.types";
const { executeContract } = cosmwasm.wasm.v1.MessageComposer.withTypeUrl;
async function main() {
// get offline signer
#include <cs50.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <limits.h>
int main(int argc, string argv[])
{
if (argc != 2)
{
#include <cs50.h>
#include <stdio.h>
#include <string.h>
#include <math.h>
int count_sentences(string text);
int count_words(string text);
int count_letters(string text);
int main(void)
#include <ctype.h>
#include <cs50.h>
#include <stdio.h>
#include <string.h>
// Points assigned to each letter of the alphabet
int POINTS[] = {1, 3, 3, 2, 1, 4, 2, 4, 1, 8, 5, 1, 3, 1, 1, 3, 10, 1, 1, 1, 1, 4, 4, 8, 4, 10};
int compute_score(string word);
@iboss-ptk
iboss-ptk / credit.c
Last active November 27, 2022 04:10
#include <cs50.h>
#include <stdio.h>
#include <math.h>
long exp10(int exponent);
long get_digit(long cc_num, int pos);
bool has_exact_digit(long cc_num, int digit);
string check_credit_card_number(long cc_num);
int main(void)
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq)]
struct Pool {
id: String,
address: String,
pool_params: osmosis_std::types::osmosis::gamm::v1beta1::PoolParams,
future_pool_governor: String,
pool_assets: Vec<osmosis_std::types::osmosis::gamm::v1beta1::PoolAsset>,
total_shares: osmosis_std::types::cosmos::base::v1beta1::Coin,
total_weight: String,