Chapter 9: Further Reading
Annotated Bibliography
1. "Lost in the Middle: How Language Models Use Long Contexts"
Authors: Nelson F. Liu, Kevin Lin, John Hewitt, Ashwin Paranjape, Michele Bevilacqua, Fabio Petroni, Percy Liang Published: 2023 (Stanford University, Meta AI) Where to find: arXiv:2307.03172
The foundational research paper that documents the "lost in the middle" effect discussed throughout this chapter. The authors demonstrate that language models perform significantly better when relevant information is placed at the beginning or end of the input context rather than in the middle. Essential reading for understanding why information placement strategies matter. The experiments are rigorous and the findings are directly applicable to practical context management.
2. "Attention Is All You Need"
Authors: Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, Illia Polosukhin Published: 2017 (Google Brain, Google Research, University of Toronto) Where to find: arXiv:1706.03762
The original transformer paper that introduced the attention mechanism underlying all modern AI coding assistants. While highly technical, understanding the basics of how attention works (covered in Chapter 2 of this book) provides a deeper appreciation for why context management strategies are effective. The paper explains the self-attention mechanism that determines how much each token "attends to" every other token in the context.
3. "Anthropic's Claude Documentation: Prompt Engineering Guide"
Publisher: Anthropic Where to find: docs.anthropic.com/en/docs/build-with-claude/prompt-engineering
Anthropic's official guide to prompting Claude effectively. Includes practical advice on context window usage, system prompts, and conversation design that directly complements this chapter. The sections on "giving Claude a role" and "using system prompts" provide additional techniques beyond what this chapter covers. Updated regularly as new model versions are released.
4. "OpenAI Prompt Engineering Guide"
Publisher: OpenAI Where to find: platform.openai.com/docs/guides/prompt-engineering
OpenAI's official guide to getting the best results from their models. Covers strategies for providing context, using system messages, and structuring multi-turn conversations. While focused on GPT models, many of the principles apply broadly to all AI coding assistants. The section on "tactic: use delimiters to clearly indicate distinct parts of the input" is particularly relevant to the context structuring strategies in this chapter.
5. "The Art of Prompt Engineering with ChatGPT"
Author: Nathan Hunter Published: 2023 Where to find: Major bookstores and online retailers
An accessible, practical book on prompt engineering that includes extensive discussion of conversation design and context management. Chapters on "conversation architecture" and "prompt chaining" provide additional frameworks and examples that complement this chapter. Recommended for readers who want more worked examples of multi-turn conversation patterns.
6. "Effective Prompts for Coding Assistants" (Blog Series)
Author: Simon Willison Where to find: simonwillison.net
Simon Willison's blog is one of the best ongoing resources for practical AI usage, including extensive writing about coding assistant workflows. His posts on context management, prompt injection awareness, and practical token management are grounded in real-world experience. Particularly relevant are his posts on using AI for large codebase maintenance, which demonstrate the file context strategies discussed in Section 9.9.
7. "Building LLM Applications: A Clear Step-by-Step Guide"
Author: Valentina Alto Published: 2023 (Packt) Where to find: Major bookstores and online retailers
While focused on building applications that use LLMs, this book contains excellent chapters on managing context windows programmatically. The sections on token counting, context truncation strategies, and conversation memory management provide a developer's perspective on the same problems discussed in this chapter. Recommended for readers who want to understand the engineering behind the tools they use.
8. "Cursor Documentation: Rules for AI"
Publisher: Cursor (Anysphere) Where to find: docs.cursor.com
Documentation for Cursor's .cursorrules file and context management features. Provides practical guidance on writing project-level AI instructions that persist across conversations. Reading this alongside the Section 9.8 discussion of system prompts gives a concrete understanding of how project-level context files work in practice.
9. "Claude Code Documentation: CLAUDE.md"
Publisher: Anthropic Where to find: docs.anthropic.com/en/docs/claude-code
Documentation for Claude Code's CLAUDE.md file format and usage. Explains how project-level instructions are injected into the context, how they interact with the conversation, and best practices for writing them. The examples section is particularly useful for readers setting up their first CLAUDE.md file.
10. "Tiktoken: OpenAI's Token Counting Library"
Publisher: OpenAI Where to find: github.com/openai/tiktoken
The open-source library used to count tokens for OpenAI models. Understanding tokenization is fundamental to context budget planning. The library's documentation includes examples of how different text types (natural language, code, special characters) tokenize differently, which is valuable for accurate budget estimation. While specific to OpenAI's tokenizers, the principles apply broadly.
11. "Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks"
Authors: Patrick Lewis, Ethan Perez, Aleksandra Piktus, et al. Published: 2020 (Facebook AI Research, University College London, New York University) Where to find: arXiv:2005.11401
The foundational paper on Retrieval-Augmented Generation (RAG), which is increasingly used by AI coding tools to dynamically select relevant context from large codebases. Understanding RAG explains how tools like Cursor and GitHub Copilot automatically choose which files to include in context---knowledge that helps you work with (rather than against) these automatic context selection systems.
12. "A Survey on Context Management for Large Language Models"
Authors: Various Published: 2024 Where to find: Search arXiv for recent survey papers on LLM context management
Survey papers in this area are published frequently and provide an up-to-date overview of research on context window utilization, attention patterns, and strategies for managing information within the context. Look for surveys published in the last 12 months for the most current findings.
13. "The Pragmatic Programmer: Your Journey to Mastery" (20th Anniversary Edition)
Authors: David Thomas, Andrew Hunt Published: 2019 (Addison-Wesley) Where to find: Major bookstores and online retailers
While not about AI, this classic software engineering text contains timeless wisdom about managing complexity---the core challenge of context management. The sections on "don't repeat yourself" (DRY), "orthogonality," and "tracer bullets" map directly to context management principles: minimize redundancy in your conversations, keep topics orthogonal across sessions, and use small, focused probes to establish direction before committing to large context investments.
14. "Working Memory and Language Processing"
Authors: Various cognitive science researchers Where to find: Search Google Scholar for review articles
For readers interested in the cognitive science parallels, research on human working memory capacity and its impact on language processing provides fascinating context for understanding AI context windows. The parallels between Miller's "7 plus or minus 2" principle for human working memory and the practical limits of AI context utilization are striking. Understanding human context limitations helps build intuition for why AI context management matters.
15. "Prompt Engineering for Developers" (Course)
Publisher: DeepLearning.AI (in collaboration with OpenAI) Where to find: deeplearning.ai
A free online course that covers prompt engineering with practical coding exercises. The modules on "iterative prompt development" and "chatbot" design are directly relevant to the multi-turn conversation patterns and context management strategies in this chapter. Recommended as a hands-on complement to the textbook material.