IamBishal

Find anything I’ve written or built

Articles, tutorials, books, case studies, AI Lab experiments and projects, searched in one place, down to single lessons and chapters.

Search results

78 results

  • Lesson

    Pick a policy with numbers

    Runs raw, trim, clear, summary+pin and fresh on the same 24-ticket shift and compares cost, cache-hit rate, tickets handled and standing-instruction retention, with the summariser's calls charged. Scripted, trim is cheapest on Sonnet; live runs on Sonnet and Haiku both put fresh first, so policy.json gates fresh, and check_policy.py fails CI when a change breaks it.

    • 15 min read
    • In Build a long-running support copilot
  • Lesson

    Summaries, compaction and memory across shifts

    Run four ways to rebuild a Claude copilot's window at a ticket boundary: running summary, summary with pinned standing instructions, a fresh window and beta compaction. Reproduce dropped instructions and the stale-open-item stall, pass the compaction block back exactly, and carry a standing instruction into the next shift with the memory tool.

    • 19 min read
    • In Build a long-running support copilot
  • Lesson

    Trim at the tool boundary, clear with honest placeholders

    Shrinks the window at the tool boundary with per-tool trimmers and clears finished tickets with placeholders, on the client or with clear_tool_uses on the server. On the scripted Sonnet shift trim cuts cost 26% and clear 9%, because clearing rebuilds the cache at every ticket; on a live Haiku shift clear cost more than raw while trim saved 27%. A misleading placeholder stops the copilot; wording is checked with a live run.

    • 17 min read
    • In Build a long-running support copilot
  • Lesson

    Lay out the prompt for the cache

    This lesson orders the support copilot's request from stable to volatile, with automatic caching on: deterministic tools through stable_tools(), a frozen system prompt, then an append-only history. You run layout.py to compare six layouts by cache-hit rate and cost per shift. You add operator notes as mid-conversation system messages after a user turn. Then you write tests on the scripted model that fail when a silent invalidator breaks the cache.

    • 18 min read
    • In Build a long-running support copilot
  • Tutorial

    Build a long-running support copilot

    Keep an assistant sharp and affordable through a whole shift: a prompt laid out for the cache, tool results trimmed at the boundary, honest clearing, summaries and memory that don't fail silently, and numbers that tell you which policy to run.

    • 5 lessons
    • Beginner
  • Lesson

    What fills the window, and what actually goes wrong

    Breaks a long copilot session into what each request carries (tools, system prompt, a growing message history with every tool result) and reads window size and cost from window.py over a 24-ticket shift. Tool results are 79% of the last request; the shift costs $2.6657 on Sonnet 5.5 without caching and $0.3097 with it. Experiment 7 found no context rot up to 73k tokens, so the failures to plan for are the bill, cache-busting edits, misleading placeholders and summaries that fail quietly.

    • 19 min read
    • In Build a long-running support copilot

Didn't find what you're looking for?

I'm always happy to help! Get in touch if you have a specific topic in mind.

Contact Me
The more you learn, the more you create opportunities for yourself and others.
— Bishal Saha

Bishal SahaLet's build together

Have a system to design, or an AI feature to get right?

Tell me about the problem. You'll get a clear, honest view of the best way forward.

  • Reply within 24 hoursOn business days, with my honest view and a next step.
  • Accepting select engagementsArchitecture, AI features and full builds.
  • Remote, worldwideWorking with startups, SMEs and enterprises.