Skip to content

Instantly share code, notes, and snippets.

View joematthews's full-sized avatar
💭

Joe Matthews joematthews

💭
View GitHub Profile
@joematthews
joematthews / CLAUDE_CUSTOM_STATUS_PROMPT.md
Last active March 24, 2026 16:31
Claude Code Custom Status Prompt

Claude Code Custom Status Line

A bash script that adds a rich status bar to Claude Code CLI, showing model info, context usage, rate limits with countdown timers, update alerts, and git status at a glance.

What it looks like

Single repo:

Opus 4.6 (1M context) 45K (12%) 5h: 21% ↻2h13m 7d: 11% ↻4d3h
my-project → main  !3 ?2 ↑1
@joematthews
joematthews / humble-pi.md
Last active July 25, 2026 23:27
Humble Pi -- local agentic coding on minimal hardware

Humble Pi -- local agentic coding on minimal hardware

A coding agent that runs entirely on your own machine. No API keys, no cloud, works offline.

web_search in pi -- search, fetch, answer

pi is the agent you talk to. It runs against a local llama.cpp server hosting Google Gemma 4 (the unsloth

@joematthews
joematthews / gemma-e4b-retain.jinja
Created June 20, 2026 03:27
Gemma 4 E4B chat template — retains reasoning in history to stop llama.cpp KV-cache reprocessing. Credit: vevi33 & aldehir, llama.cpp#21912
{%- macro format_parameters(properties, required) -%}
{%- set standard_keys = ['description', 'type', 'properties', 'required', 'nullable'] -%}
{%- set ns = namespace(found_first=false) -%}
{%- for key, value in properties | dictsort -%}
{%- set add_comma = false -%}
{%- if key not in standard_keys -%}
{%- if ns.found_first %},{% endif -%}
{%- set ns.found_first = true -%}
{{ key }}:{
{%- if value['description'] -%}
@joematthews
joematthews / prompt.md
Last active July 25, 2026 22:23
SOCIAL CONRACT

Shared Compact

  • Our Drive: Curiosity
  • Our Philosophy: Pragmatism
  • Our Goal: Actionability
  • Our Standard: Verification
  • Our Duty: Collaboration
  • Our Communication: Monosemy

Both parties of this exchange, the prompter and the responder, must hold each other accountable to the Shared Compact that governs the exchange and the artifacts produced.

@joematthews
joematthews / gemma-4-e4b-pi.jinja
Created July 20, 2026 13:23
Gemma 4 E4B pi chat template (KV-cache-stable retain build for the pi coding agent + llama.cpp)
{#
Template: Gemma 4 E4B -- KV-cache-stable "retain" build (WORKING / active starting point)
Base: unsloth/gemma-4-E4B-it chat_template.jinja @ 2026-07-17
(tool-calling + turn-balance fixes, string/JSON tool-arg tolerant, null-safe)
Compiled: 2026-07-18 for joe -- baseline for agent-harness workflows (KV-cache + tool-calling monitoring).
Changes vs base (only two, both about reasoning retention):
1. preserve_thinking now DEFAULTS TO true. llama.cpp does not pass this kwarg, and retaining
reasoning across turns keeps the rendered prompt prefix byte-stable -- confirmed to stop the
KV-cache busting / full reprocessing described in ggml-org/llama.cpp#21912.
@joematthews
joematthews / gemma-4-12b-pi.jinja
Created July 20, 2026 13:23
Gemma 4 12B pi chat template (KV-cache-stable retain build for the pi coding agent + llama.cpp)
{#
Template: Gemma 4 12B -- KV-cache-stable "retain" build (WORKING / active)
Base: unsloth/gemma-4-12b-it tokenizer_config.json chat_template, fetched 2026-07-20.
The 12B sibling of gemma-4-e4b-pi.jinja -- same pi communication-flow deltas
ported onto the 12B base (NOT copied from the E4B pi file).
Changes vs the 12B base (four, matching the E4B pi build):
1. preserve_thinking now DEFAULTS TO true. llama.cpp does not pass this kwarg, and retaining
reasoning across turns keeps the rendered prompt prefix byte-stable -- stops the KV-cache
busting / full reprocessing described in ggml-org/llama.cpp#21912.
@joematthews
joematthews / claude-code-secret-echo-hook.md
Created July 27, 2026 16:55
Blocking secret leakage in Claude Code: why the permission deny-list isn't enough, and the PreToolUse hook that helps

Blocking secret leakage in Claude Code: why the permission deny-list isn't enough

A short write-up of a guardrail test and the hook that came out of it.

The setup

A reasonable-looking protection in ~/.claude/settings.json:

{
@joematthews
joematthews / settings.json
Last active July 28, 2026 23:41
My claude code settings
{
"$schema": "https://json.schemastore.org/claude-code-settings.json",
"attribution": {
"commit": "",
"pr": "",
"sessionUrl": false
},
"permissions": {
"deny": [
"Read(//**/.env*)",
@joematthews
joematthews / statusline-command.sh
Created July 28, 2026 23:43
Claude Code status line
#!/bin/bash
# =============================================================================
# Claude Code Status Line Script
# =============================================================================
#
# Adapted from https://gist.github.com/joematthews/a6a10a3a56a7c2387cbac546fe491719
#
# Displays a status bar inside Claude Code with:
# Line 1: Model info, context usage, rate limits
# Line 2: Current directory with git branch and file change indicators