Skip to content

Instantly share code, notes, and snippets.

View jcohen66's full-sized avatar

Jonathan T. Cohen jcohen66

View GitHub Profile
@jcohen66
jcohen66 / ai_claude_token_sparing.md
Created October 9, 2026 19:00
AI Claude Token Sparing #ai #claude #token #sparing #cost

Very Important

Don't overlook.

Use Medium Effort. Never Max

Low for grammar. High for one-shots. Never extra.

Save your free reset for a bad day

Never use it on Mon AM. Limits reset every Sunday anyway.

Use Opus 5.5. Never Fable

@jcohen66
jcohen66 / ai_claude_prompt_libaray_1.md
Created October 9, 2026 18:31
AI Claude Prompt Library #ai #claude #prompt

Codebase Onboarding Map

Explore this repository and explain its purpose, main directories, entry points, local setup, tests, and key dependencies. Cite tfile paths and flag anything you couldn't verify.

Failing Test Fix

Run [test command] and fix [test]. Determine whether the test or code is wrong, preserve assertions, rerun the suite, and report results.

Feature Implementation

Implement the approved [feature] plan. Follow existing conventions, add tests for key behaviors, keep changes focused and summarize every changed file.

Safe Refactor

@jcohen66
jcohen66 / ai_claude_automation.md
Created September 9, 2026 20:44
AI Claude Automation Setup #ai #claude #automation #routine #skill

Easiest Way To Automate with Claude

Trigger

What causes it to run: Claude Routines

Logic

What it actually does: Claude Skills

Monitoring

What happens and if you need to fix it: Claude Desktop App

@jcohen66
jcohen66 / api_idempotency.md
Created August 27, 2026 14:27
API Idempotency #api #idempotency #best #practice

6 ways to design an idempotent API:

Networks retry. Queues deliver twice, and users double-click.

If your API charges a card or creates an order, "it ran twice" is not an edge case...

Here's how to make duplicates harmless:

  1. Idempotency keys. ↳ The client sends a unique key. The server stores the first result.
@jcohen66
jcohen66 / ai_sr_engineer_prompt.md
Created August 27, 2026 13:58
AI Claude Sr Engineer Prompt #ai #claude #engineer #prompt

Prompt

Work like a contractor who bills for rework: the cost of a wrong assumption is yiurs to avoid, and the cost of an unnecessary questio is mine to pay.

1. Investigate before you ask

Read the relevant code, tests, configs, and dependency manifests first. Anything discoverable in under a minute of searching is not a question -- it's research you owe me. Never ask about test framework, language version, lint rules, error handling conventions, directory layout, or existing abstractions that already exist in the repo. If the codebase contradicts itself, that's worth raising.

2. Then produce this, and stop

Goal One paragraph restating what I asked for in your own words, including the acceptance criteria you'll hold yourself to. If your restatement is wrong, that's the cheapest possible place to find out.

@jcohen66
jcohen66 / ai_claude_dos_and_donts.md
Created August 26, 2026 18:50
AI Claude Dos and Don'ts #claude #ai #dos #donts #best #practice

Dos

Use Projects for Every Workstream

Projects keep instructions, memory, and files separate for each workflow.

Load Context Before Prompting

Claude who you are, what you're doing, and what's already decided.

Define Role, Audience, and Format.

Clear role, audience and output format produce better results.

@jcohen66
jcohen66 / ai_claude_truth_prompt.md
Created August 25, 2026 14:04
AI Claude Truth Instructions #ai #claude #truth #instruction #prompt

1/ Open Claude settings

→ Click your profile picture in the bottom left corner. → Go to Settings. → Click General. → Find the "Instructions for Claude" field.

Prompt

@jcohen66
jcohen66 / ai_anthropic_prompting_guidance.md
Last active August 22, 2026 20:22
AI Anthropic Prompting Guidance #ai #prompt #best #practice #guidance #query #done #criteria

Before

You are a senior copywriter with 20 yrs experience who writes all my marketing copy. Take a deep breath. This task is very important.

  • Where to look = the client notes are in the onboarding folder.
  • Definition of done = a one-page proposal covering their three pain points, with price listed at the bottom.
  • Self-check = Before you finish, check every number against the notes and flag anything you couldn't back up.

After

You write all my marketing copy.

@jcohen66
jcohen66 / ai_claude_token_optimization.md
Last active August 22, 2026 00:48
AI Claude Token Optimization #ai #claude #token #optimization #report #memory #tools #cache #model #hooks #subagents #schedule #consumption

https://www.youtube.com/watch?v=kHtOSJRUkLs

Claude Token Consumption

Every turn resends the whole conversation.

  1. First message costs what you typed.
  2. Second message costs what you typed + answer + the first message
  3. Compounds tokens: 3000 tokens x 37
  4. Read once. Pay for on every turn that follows.
@jcohen66
jcohen66 / ai_claude_handoff.md
Created August 21, 2026 21:59
AI Claude Handoff File #ai #claude #handoff #context #window

handoff.md

Goal

  • Continue from the approved reel scenes.
  • Keep Claude visuals readable.

Current state

  • Context rot graph is built.
  • Compacting scenes are registered.
  • Handoff direction is approved.