The usefulness of dynamic analysis tools for programcomprehension increases with the amount oftime a given analyzed program is monitored. Thus, monitoring the analyzed program in a production environment should give the best picture of how the program actually works. However, high performance overhead is especially undesirable in such a setting, because it decreases the user’s productivity. Performance overhead occurs due to recognizing events that are of interest to the agent monitoring the program run and storing those events in data-structures. We propose to address this issue by creating a custom-made agent for each program. By using static analysis to get a priori knowledge about which events of interest can occur and where they can occur, tailored code for recognizing and storing those events can be generated for each program. We evaluate our idea by comparing a "general purpose" dynamic agent that captures fine-grained points-to information with custom-made agents that do the same job for specific programs. The latter show highly reduced performance overhead in practice. We also investigate how the precision of the static analysis affects the performance of the custom-made agents.