AWS Builder Center
Weekend Productivity Challenge: Context Switcher

Weekend Productivity Challenge: Context Switcher

How I built Context Switcher, an AI-powered CLI that captures your git working state when you switch projects and uses Amazon Bedrock to generate a resumption briefing — taking you from 0 to productive in under 2 minutes. Built in half a day with Kiro on a serverless AWS stack (Lambda, DynamoDB, API Gateway, S3).

Vision and What the App does

The Problem:

If you're like me and are working on multiple projects at work or personally, you may lose track of where you are in each project when you are switching between them or take extended breaks from them. You can lose minutes re-orienting every time you switch projects, in fact Kiro suggests on average you can lose 10-15 minutes to re-orient yourself! You can forget what branch you were on, what you were working on and what PR comments still need addressing. Your mental context is expensive to rebuild, especially when you have multiple active projects.
So I built Context Switcher.
What does Context Switcher Do?
It is a CLI tool that captures your full working state: git branch, recent commits, uncommitted diff, modified files, and an optional note ( ctx park ). When you return to that project the  ctx resume  generates an AI-powered briefing via Amazon Bedrock that tells you exactly where you left off. The briefing has 4 sections, and is under 500 words to give you a nice summary. The sections are: Last Session Summary, Key Changes, Open Items, and Suggested Next Steps. Context Switcher supports GitHub integration for PR status and review comments. If you use this for your work, the backend supports Multi-user with API key authentication and tenant data isolation.
How Context Switcher Works (screenshots show the pre-bundled command names):
  •  ctx park --note "Debugging auth token expiry"  → snapshots everything
Context Switcher Park

  •  ctx list  → shows all your parked projects with timestamps
Context Switcher List

  •  ctx resume  → AI reads your snapshot and generates a concise briefing
Context Switcher Resume

  • Takes you from 0 to productive in under 2 minutes

How I Built Context Switcher

Development Process
I used Kiro's spec-driven development workflow to go from idea to requirements to design to implementation tasks. I use Kiro to develop as it helps me expand upon my project ideas. I had this context switcher idea, and had an image in my head of what I would like it to do and I gave Kiro what I had. Kiro then used that and expanded it to include things I either would not have thought about or would have discovered down the road, and not quickly! In fact there is a web based version in this and Kiro didn't have authentication built into it in the requirements, so I had to tell Kiro to add that. So Kiro is a tool I use to assist me, I don't use it to just build for me, it's like another developer who listens to my ideas and gives me feedback and opinions. The other thing I really like about Kiro is, and yes I'm admitting to this, I never really wrote tests, unit or property based. I would just build, deploy and manually test. With Kiro, it'll build these tests for me and I can confidently say things are working-ish. I still deploy and manually test and find bugs, but not as many!
So in this project, Kiro started by creating a requirements document defining 8 requirement areas and acceptance criteria. Once I was happy with it and after making changes, I had it move forward with creating a technical design with DynamoDB single-table schema, API contracts, and correctness properties. After reviewing that to ensure it looked good, I had Kiro go ahead and create the implementation plan where it created 49 tasks with a dependency graph for parallel execution. I once again reviewed each task before having Kiro run each task.
Key Decisions:
This became a TypeScript monorepo with 5 packages (shared, lambdas, cli, web, infra) to keep the code organized and types shared across all packages. This avoids sharing of packages across repos, and keeps everything simple. As already mentioned, Kiro helps with creating property-based testing and it uses fast-check and in the end we ended up with 12 correctness properties validated across over 100 iterations each. I'm a big fan of serverless so this project was made in a serverless-first mindset so that there is no infrastructure to manage, and also so it's a pay as you use model. It also uses NodejsFunction in CDK with esbuild bundling to resolve workspace dependencies at build time and to produce minimal Lambda bundles.
Challenges & Solutions:
  • Bedrock model IDs changed: newer Anthropic models require inference profile IDs (e.g.,  us.anthropic.claude-sonnet-4-6  not  anthropic.claude-sonnet-4-6 ). Discovered via trial and error. I'll admit I used Kiro for this as I haven't used Bedrock extensively, so Kiro led me down the wrong path here.
  • Lambda bundling: workspace  @ctx-switch/shared  imports weren't resolving at runtime. Switched from raw  tsc  output to CDK's  NodejsFunction  which esbuild-bundles everything into standalone files.
  • API Gateway Token Authorizer: passes the key via  authorizationToken  field, not headers. Had to update the Lambda to read from both sources.
  • Authorizer caching: initial Deny responses get cached for the TTL duration. Set to 0 during development, restored to 5 minutes for production.
Timeline:
  • Spec (requirements + design): ~30 minutes with Kiro
  • Implementation (49 tasks): ~2 hours with parallel subagent execution
  • Deployment + debugging: ~30 minutes
  • Total: roughly half a day from idea to working deployed product
Before Kiro, and because I have a perfectionist mindset, this project would have taken me most likely at minimum a month to build. Having Kiro as a tool to assist me has greatly sped up my development process and has allowed me to build more of my ideas, and also to experiment and learn more.

AWS Services Used / Architecture Overview

AWS Services:
Service
Purpose
Amazon Bedrock (Claude Sonnet 4.6)
Generates AI resumption briefings from snapshot data
AWS Lambda (7 functions)
All business logic: capture, resume, list, delete, history, auto-capture, authorizer
Amazon DynamoDB
Single-table design storing snapshots, project records, and API keys
Amazon S3
Overflow storage for snapshots exceeding DynamoDB's 400KB item limit
Amazon API Gateway
REST API with custom Lambda authorizer for multi-user auth
Amazon EventBridge
Scheduled auto-capture rule (cron-based)
AWS CDK
Infrastructure as code for the entire stack
Architecture:
CLI (ctx) ──→ API Gateway ──→ Lambda Authorizer ──→ Lambda Handlers
│
Web Dashboard ─┘ ┌────────┴────────┐
│ │
DynamoDB S3 (overflow)
│
Amazon Bedrock
(briefing generation)
Key Architecture Decisions:
  • Single-table DynamoDB: all entities share one table with composite keys ( USER#{userId}  as PK), enabling efficient access patterns and automatic tenant isolation
  • Overflow pattern: large diffs (>400KB) stored in S3 with a pointer in DynamoDB
  • Graceful degradation: if Bedrock times out (>15s), raw snapshot data is returned instead of failing
  • esbuild bundling via NodejsFunction: each Lambda is a self-contained ~2-4KB minified bundle

What I Learned

  • Bedrock inference profiles: as of 2025+, newer Anthropic models on Bedrock require inference profile IDs rather than raw model IDs. The error message ("Invocation of model ID with on-demand throughput isn't supported") points you to use the  us.  prefixed profiles.
  • Kiro's spec workflow scales: going from 0 to 462 passing tests across a full-stack app in a few hours is real. The spec-driven approach (requirements → design → tasks → parallel execution) keeps you focused on decisions while the agent handles implementation. I use Kiro as if it is another dev to help me flesh out my ideas and to speed up my development. I ensure I review what it is doing and still do manual testing as I still find bugs that I have to fix, but there are fewer bugs than if I did it on my own and Kiro helps me find ideas faster than on my own and actually write unit and property based tests.
  • CDK NodejsFunction is the right choice for monorepos: it handles TypeScript compilation + workspace dependency resolution + tree-shaking in one step. No need to manually bundle or configure esbuild separately.
  • Property-based testing catches edge cases you'd never write: fast-check found the  fc.date()  issue where generated dates could be invalid (NaN). Using integer milliseconds with bounded ranges avoids this entirely.
  • API Gateway Token Authorizers are different from Request Authorizers: the token comes in  event.authorizationToken , not in headers. Small detail, big debugging headache.
  • DynamoDB single-table design makes tenant isolation trivial: if every query starts with  PK = USER#{userId} , cross-user data access is physically impossible at the query level.

Link to Repo

Tech Stack:

  • TypeScript monorepo (5 packages)
  • 462 tests (including 12 property-based tests)
  • Full CDK infrastructure
  • CLI, Lambda backend, React dashboard
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article