Measuring and compacting a session
After shipping the label fix from your last task, your tech lead asks you to take a fresh look at the session model in src/lib/auth.ts — the team is planning a refactor and wants a second pair of eyes. As you dig in, you begin to see how Claude Code's context window quickly fills up, so you'll need to manage this context using Claude Code's built-in commands.
Bài tập này là một phần của khóa học
Claude Code in Action
Hướng dẫn bài tập
- Start Claude Code with
claude. - Ask Claude to read
src/lib/auth.tsand explain the session functions, plus howprisma/schema.prismamodels sessions. Let it finish without interrupting. - Run
/contextto see how much of the context window you've used. - Run
/compactto compress the conversation into a summary. - Keep working on the compacted session: ask Claude to explain
src/components/chat/MessageList.tsx. - Run
/contextonce more to see usage after compacting, then type/exitto exit Claude Code.
Bài tập tương tác thực hành
Biến lý thuyết thành hành động với một trong các bài tập tương tác của chúng tôi
Bắt đầu bài tập