Skip to content

Instantly share code, notes, and snippets.

View tennox's full-sized avatar
💭
mainly on gitlab.com/txlab

Manuel tennox

💭
mainly on gitlab.com/txlab
View GitHub Profile
@tennox
tennox / fix-cc-session-for-gist.nu
Created February 9, 2026 01:24
Fix Claude Code session JSONL corruption (history not loading after upgrade to 2.1.24+)
#!/usr/bin/env nu
# Fix Claude Code session JSONL files with data corruption issues
#
# PROBLEM:
# After upgrading to Claude Code 2.1.24+, resuming sessions created in earlier versions
# shows only the last message, ignoring all prior conversation history. This affects
# sessions even when downgrading back to earlier versions (the corruption happened at
# write time, not read time).
#
@tennox
tennox / dev-link.nix
Created November 15, 2025 20:08
Conditional Dev Mode Symlinks for Nix Config

🐛 CLAUDE CODE MCP PARAMETER BUG REPRODUCTION SCRIPT

anthropics/claude-code#3966

CRITICAL BUG: Claude Code fails to pass parameters when schema contains union types with null defaults combined with required fields.

🎯 EXACT BUG TRIGGER: Schema pattern: {"type": ["string", "null"], "default": null} + required fields Result: Claude Code sends {} instead of actual parameters

🐛 CLAUDE CODE MCP PARAMETER BUG REPRODUCTION SCRIPT

anthropics/claude-code#3966

CRITICAL BUG: Claude Code fails to pass parameters when schema contains union types with null defaults combined with required fields.

🎯 EXACT BUG TRIGGER: Schema pattern: {"type": ["string", "null"], "default": null} + required fields Result: Claude Code sends {} instead of actual parameters

@tennox
tennox / flake.nix
Created March 23, 2025 08:09
clan config
{
inputs = {
# NIX BASE #
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
clan-core = {
url = "git+https://git.clan.lol/clan/clan-core";
# Don't do this if your machines are on nixpkgs stable.
inputs.nixpkgs.follows = "nixpkgs"; # https://git.clan.lol/clan/clan-core/issues/3079
};
};
@tennox
tennox / apiv3.ts
Last active November 26, 2024 13:05 — forked from gotjoshua/apiv3.ts
civi v3
import qs from 'npm:qs';
/*
ex:
var config = {
server:'http://example.org',
path:'/sites/all/modules/civicrm/extern/rest.php',
key:'your key from settings.civicrm.php',
api_key:'the user key'
};
@tennox
tennox / migadu-dnscontrol-example.js
Last active March 20, 2024 12:12
Migadu DNSControl setup
// Adapt all occurrences of `EXAMPLE.org` and `REPLACEME` with the correct values
D("EXAMPLE.org", REG_MY_PROVIDER, DnsProvider(DSP_MY_PROVIDER),
// other records - e.g.
//A("@", "1.2.3.4"),
////////////
// MIGADU //
////////////
TXT("@", "hosted-email-verify=REPLACEME"),
@tennox
tennox / .envrc
Last active June 7, 2023 12:11
devenv reproduction - exit code
#!/usr/bin/env bash
set -euo pipefail
# Docs: https://direnv.net/
if ! has nix_direnv_version || ! nix_direnv_version 2.3.0; then
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/2.3.0/direnvrc" "sha256-Dmd+j63L84wuzgyjITIfSxSD57Tx7v51DMxVZOsiUD8="
fi
nix_direnv_watch_file devenv.nix
@tennox
tennox / Readme.md
Created May 26, 2023 20:54
Nix: Flatten VSCode settings to allow structured config

Instead of

{
  "editor.fontLigatures" = true;
  "editor.inlayHints.enabled" = "offUnlessPressed";
  "editor.inlayHints.fontSize" = 12;
}

I want to be able to write

@tennox
tennox / .state-to-child.tsx
Last active December 9, 2021 22:58
React: Pass useState hook to child
import React, { FC, useState } from 'react';
const Component = () => {
const [barFoo, setBarFoo] = useState(1);
return <Foo bar={[barFoo, setBarFoo]} />;
};
const Foo: FC<{ bar: StateRef<number> }> = ({ ...state }) => {
const [bar, setBar] = state.bar;
return <div />;