Skip to main content
This workshop teaches advanced context engineering techniques with CodeLayer. Watch the November video: https://hlyr.dev/nva (or read the September post) More links and info: https://github.com/ai-that-works/ai-that-works/tree/main/2025-08-05-advanced-context-engineering-for-coding-agents Thread with all related content: https://x.com/dexhorthy/status/1978676162495688719 All AI That Works episodes: https://github.com/ai-that-works/ai-that-works Want to discuss these techniques? Join us at https://humanlayer.dev/discord

Pre-Requisites

  • This guide is for macOS with M-series architecture. Ask in https://humanlayer.dev/discord for Linux/Windows/Intel Mac support.
  • Claude Code account, logged into your workstation (Max 100 account or higher recommended)
  • A way to view/edit markdown files (Cursor, VS Code, vim, go-grip, etc.)
  • An issue to work on, ideally from an OSS repo you’re familiar with

Objectives / Outcomes

  • Familiarity with managing Claude Code subagents and commands
  • Familiarity with the research / plan / implement workflow and how to get the most out of it

Step-by-step guide

1. Choose an issue to work on

Pick a small issue to help you focus on learning the system. You can use these techniques in your own private repos, but if you want help, I recommend using an open source repo you’re familiar with. A good rule of thumb: pick the OSS repo for a tool you use often enough that when you read a bug ticket, you can understand and reproduce the issue yourself. List of Issues

2. Clone the repository

Whatever issue you choose, you’ll need to clone the repository to your workstation. This will be your “working repository.”

3. Get the issue locally

Save the issue you want to solve as a .txt or .md file in your working repository. You can copy the text from GitHub, use the gh CLI, prompt Claude to use an MCP—whatever works for you.

4. Install CodeLayer

Follow the instructions at https://humanlayer.dev/docs to install CodeLayer.

5. Bootstrap the prompts with a codebase research task

Open CodeLayer:
open /Applications/CodeLayer.app
Open a new CodeLayer session, set the working directory to your repo, and type (don’t paste) /cl:research_codebase
/cl:research_codebase
When you submit, you’ll be prompted to bootstrap the core prompts and agents into your current repo. Then type your research prompt:
We are working on the issue in the issue.txt file. Please read the issue and research the codebase to understand how the system works and what files and line numbers are relevant to the issue.

Do not make an implementation plan or explain how to fix.
Note the “magic words” at the end of the research prompt: Do not make an implementation plan or explain how to fix. This is baked into the base prompt, but it helps to repeat it.

6. Create a plan

Type (don’t paste):
/cl:create_plan
We are working on the issue in the issue.txt file. We've done the following research: PATH_TO_RESEARCH_OUTPUT.md

Create a plan to fix the issue. YOUR ADDITIONAL INSTRUCTIONS HERE


Work back and forth with me, sharing your open questions and phases outline before writing the plan.
Note the “magic words” at the end of every planning prompt: Work back and forth with me, sharing your open questions and phases outline before writing the plan. This is baked into the base prompt, but it helps to repeat it. If Claude just writes a plan file without asking clarifying questions, try again with the magic words.

7. Implement the plan

/cl:implement_plan - PATH_TO_PLAN.md

Please implement the plan. YOUR ADDITIONAL INSTRUCTIONS HERE

Optional: Split phases across sessions

For long, complex plans, you might want to work phase by phase. You can add that guidance at the end:
/cl:implement_plan - PATH_TO_PLAN.md

Please implement the plan. YOUR ADDITIONAL INSTRUCTIONS HERE

Just do phase 1, then update the plan with your progress and await further instructions and confirmation of the manual verification steps.
Once phase 1 is done and you’re happy with it, you can start a new session:
/cl:implement_plan PATH_TO_PLAN.md phase 1 is done, just do phase 2, then update the plan with your progress and await further instructions and confirmation of the manual verification steps

8. Commit and PR

From here it’s up to you. You can borrow the /commit command from github.com/humanlayer/humanlayer/tree/main/.claude/commands/ to generate a commit message, push to a fork, and use /describe_pr to generate a PR description. (You might need to tweak the describe_pr or fetch a template if not present yet—ignore any error about “thoughts setup incomplete.”)

9. Optional Challenge: Set up the thoughts tool

Clone github.com/humanlayer/humanlayer and launch a new CodeLayer session in the repo:
Tell me about how the "thoughts tool" works and why it exists, and then walk me through setting it up for my project in PATH/TO/YOUR/PROJECT
The thoughts tool creates a separate git repo on your workstation to store all your research, plans, etc. outside of the working repo, so you can share them across projects and teams without versioning them in your git repo.

List of potential issues to work on

A curated list of open source issues that might be good candidates for testing the Research/Plan/Implement workflow. This list is from November 2025, so some may already be solved.
  1. https://github.com/oven-sh/bun/issues/24752
  2. https://github.com/electric-sql/electric/issues/3284
  3. https://github.com/electric-sql/electric/issues/3260
  4. https://github.com/TanStack/db/issues/593
  5. https://github.com/drizzle-team/drizzle-orm/issues/5001
  6. https://github.com/unnoq/orpc/issues/1058
  7. https://github.com/unnoq/orpc/issues/954
  8. https://github.com/unnoq/orpc/issues/889
  9. https://github.com/unnoq/orpc/issues/729